diff --git a/.gitignore b/.gitignore index 1559f2e9..3e59d8e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ *.pyc *.swp *.swo +cof/settings.py +settings.py +*~ diff --git a/apache/wsgi.py b/apache/wsgi.py new file mode 100644 index 00000000..254e36f5 --- /dev/null +++ b/apache/wsgi.py @@ -0,0 +1,12 @@ +""" +WSGI config for myproject project. +It exposes the WSGI callable as a module-level variable named ``application``. +For more information on this file, see +https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() diff --git a/bda/autocomplete_light_registry.py b/bda/autocomplete_light_registry.py new file mode 100644 index 00000000..3254b3c8 --- /dev/null +++ b/bda/autocomplete_light_registry.py @@ -0,0 +1,9 @@ +import autocomplete_light + +from bda.models import Participant, Spectacle + +autocomplete_light.register(Participant, search_fields=('user__username','user__first_name','user__last_name'), + autocomplete_js_attributes={'placeholder': 'participant...'}) + +autocomplete_light.register(Spectacle, search_fields=('title',), + autocomplete_js_attributes={'placeholder': 'spectacle...'}) diff --git a/bda/views.py b/bda/views.py index ffe6eb8d..78ac0c83 100644 --- a/bda/views.py +++ b/bda/views.py @@ -12,7 +12,7 @@ import hashlib from django.core.mail import send_mail -from datetime import datetime +from datetime import datetime, timedelta import time from gestioncof.decorators import cof_required, buro_required @@ -54,7 +54,7 @@ def etat_places(request): spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) total += spectacle["total"] for spectacle in spectacles2: - spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] + spectacles_dict[spectacle["spectacle"]].total += 2*spectacle["total"] spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) total += spectacle["total"] return render(request, "etat-places.html", {"spectacles": spectacles, "total": total}) @@ -94,9 +94,30 @@ def places(request): "total": total, "warning": warning}) +@cof_required +def places_ics(request): + participant, created = Participant.objects.get_or_create(user = request.user) + places = participant.attribution_set.order_by("spectacle__date", "spectacle").all() + filtered_places = [] + places_dict = {} + spectacles = [] + for place in places: + if place.spectacle in spectacles: + places_dict[place.spectacle].double = True + else: + place.double = False + place.spectacle.dtend = place.spectacle.date + timedelta(seconds=7200) + places_dict[place.spectacle] = place + spectacles.append(place.spectacle) + filtered_places.append(place) + date = place.spectacle.date.date() + return render(request, "resume_places.ics", + {"participant": participant, + "places": filtered_places}, content_type="text/calendar") + @cof_required def inscription(request): - if datetime.now() > datetime(2014, 10, 5, 12, 00) and request.user.username != "seguin": + if datetime.now() > datetime(2015, 10, 4, 12, 00) and request.user.username != "seguin": participant, created = Participant.objects.get_or_create(user = request.user) choices = participant.choixspectacle_set.order_by("priority").all() return render(request, "resume_inscription.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort dans la journée !", "choices": choices}) @@ -176,7 +197,7 @@ def do_tirage(request): member.total += show.price members2 = members2.items() data["members2"] = sorted(members2, key = lambda m: m[0].user.last_name) - if False and request.user.username in ["seguin", "harazi","fromherz"]: + if False and request.user.username in ["seguin", "harazi","fromherz", "ccadiou"]: Attribution.objects.all().delete() for (show, members, _) in results: for (member, _, _, _) in members: @@ -259,3 +280,11 @@ def spectacle(request, spectacle_id): @buro_required def unpaid(request): return render(request, "bda-unpaid.html", {"unpaid": Participant.objects.filter(paid = False).all()}) + +@buro_required +def liste_spectacles_ics(request): + spectacles = Spectacle.objects.order_by("date").all() + for spectacle in spectacles: + spectacle.dtend = spectacle.date + timedelta(seconds=7200) + return render(request, "liste_spectacles.ics", + {"spectacles": spectacles}, content_type="text/calendar") \ No newline at end of file diff --git a/bda2/__init__.py b/bda2/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/bda2/admin.py b/bda2/admin.py new file mode 100644 index 00000000..32325b0b --- /dev/null +++ b/bda2/admin.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +from django.core.mail import send_mail +from django.contrib.contenttypes.models import ContentType + +from django.contrib import admin +from django.db.models import Sum, Count +from bda2.models import Spectacle, Salle, Participant, ChoixSpectacle, Attribution + +class ChoixSpectacleInline(admin.TabularInline): + model = ChoixSpectacle + sortable_field_name = "priority" + +class AttributionInline(admin.TabularInline): + model = Attribution + +class ParticipantAdmin(admin.ModelAdmin): + #inlines = [ChoixSpectacleInline] + inlines = [AttributionInline] + def queryset(self, request): + return Participant.objects.annotate(nb_places = Count('attributions'), + total = Sum('attributions__price')) + def nb_places(self, obj): + return obj.nb_places + nb_places.admin_order_field = "nb_places" + nb_places.short_description = "Nombre de places" + def total(self, obj): + tot = obj.total + if tot: return u"%.02f €" % tot + else: return u"0 €" + total.admin_order_field = "total" + total.short_description = "Total à payer" + list_display = ("user", "nb_places", "total", "paid", "paymenttype") + list_filter = ("paid",) + search_fields = ('user__username', 'user__first_name', 'user__last_name') + actions = ['send_attribs',] + actions_on_bottom = True + list_per_page = 400 + + def send_choices(self, request, queryset): + for member in queryset.all(): + choices = member.choixspectacle_set.order_by('priority').all() + if len(choices) == 0: + continue + mail = u"""Cher(e) %s, +Voici tes choix de spectacles tels que notre système les a enregistrés :\n\n""" % member.user.get_full_name() + next_rank = 1 + member_shows = {} + for choice in choices: + if choice.spectacle in member_shows: continue + else: member_shows[choice.spectacle] = True + extra = "" + if choice.double: + extra += u" ; deux places" + if choice.autoquit: + extra += u" ; désistement automatique" + mail += u"- Choix %d : %s%s\n" % (next_rank, choice.spectacle, extra) + next_rank += 1 + mail += u"""\nSi cette liste est incorrecte, merci de nous contacter au plus vite (avant samedi 6 octobre 18h). + +Artistiquement, +Le BdA""" + send_mail ("Choix de spectacles (BdA du COF)", mail, + "bda@ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: + message_bit = u"1 membre a" + plural = "" + else: + message_bit = u"%d membres ont" % count + plural = "s" + self.message_user(request, u"%s été informé%s avec succès." % (message_bit, plural)) + send_choices.short_description = u"Envoyer les choix par mail" + + def send_attribs(self, request, queryset): + for member in queryset.all(): + attribs = member.attributions.all() + if len(attribs) == 0: + mail = u"""Cher-e %s, + +Tu t'es inscrit-e pour le tirage au sort du BdA. Malheureusement, tu n'as +obtenu aucune place. + +Nous sommes conscients que le nombre de places proposées lors de ce tirage +au sort est très restreint, mais nous sommes limités par les quotas que +nous imposent les théâtres. + +Nous proposons cependant de nombreuses offres hors-tirage tout au long de +l'année, et nous t'invitons à nous contacter si l'une d'entre elles t'intéresse ! +-- +Le (nouveau) Bureau des Arts +(Thomas, Caroline, Antonin, Cécile, Hugo) + +""" + name = member.user.get_full_name() + mail = mail % name + else: + mail = u"""Cher-e %s, + +Tu t'es inscrit-e pour le tirage au sort du BdA. Tu as été sélectionné-e +pour les spectacles suivants : + +%s + +Nous sommes conscients que le nombre de places proposées lors de ce tirage +au sort est très restreint, mais nous sommes limités par les quotas que +nous imposent les théâtres. + +*Paiement* +L'intégralité de ces places de spectacles est à régler à partir du lundi +18 janvier et AVANT le vendredi 22 janvier, au bureau du COF pendant les +heures de permanences (du lundi au vendredi entre 12h et 14h, et entre 18h +et 20h). Des facilités de paiement sont bien évidemment possibles : nous +pouvons ne pas encaisser le chèque immédiatement, ou bien découper votre +paiement en deux fois. Il est possible de payer par carte, chèque ou en espèces. + +*Mode de retrait des places* +Lors du paiement, nous vous donnerons les places physiques que nous possédons, et vous indiquerons +quelles places sont sur listing, à retirer le soir même de la représentation. Nous vous enverrons un mail de rappel quelques jours avant les spectacles. + +Nous vous rappelons que l'obtention de places du BdA vous engage à +respecter les règles de fonctionnement : +http://www.cof.ens.fr/bda/?page_id=1370 +Le système de revente des places via les mails BdA-revente est accessible +directement sur votre compte GestioCOF. + +En vous souhaitant de belles représentations, +-- +Le (nouveau) Bureau des Arts +(Thomas, Caroline, Antonin, Cécile, Hugo) +""" + attribs_text = "" + name = member.user.get_full_name() + for attrib in attribs: + attribs_text += u"- 1 place pour %s\n" % attrib + mail = mail % (name, attribs_text) + + send_mail ("[BdA] Résultats du tirage au sort", mail, + "bda@ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: + message_bit = u"1 membre a" + plural = "" + else: + message_bit = u"%d membres ont" % count + plural = "s" + self.message_user(request, u"%s été informé%s avec succès." % (message_bit, plural)) + send_attribs.short_description = u"Envoyer les résultats par mail" + +class AttributionAdmin(admin.ModelAdmin): + def paid(self, obj): + return obj.participant.paid + paid.short_description = 'A payé' + paid.boolean = True + list_display = ("id", "spectacle", "participant", "given", "paid") + search_fields = ('spectacle__title', 'participant__user__username', 'participant__user__first_name', 'participant__user__last_name') + +import autocomplete_light +class ChoixSpectacleAdmin(admin.ModelAdmin): + form = autocomplete_light.modelform_factory(ChoixSpectacle) + list_display = ("participant", "spectacle", "priority", "double", "autoquit") + list_filter = ("double", "autoquit") + search_fields = ('participant__user__username', 'participant__user__first_name', 'participant__user__last_name') + +class SpectacleAdmin(admin.ModelAdmin): + model = Spectacle + list_display = ("title", "date", "location", "slots", "price") + list_filter = ("location",) + search_fields = ("title", "location__name") + +admin.site.register(Spectacle, SpectacleAdmin) +admin.site.register(Salle) +admin.site.register(Participant, ParticipantAdmin) +admin.site.register(Attribution, AttributionAdmin) +admin.site.register(ChoixSpectacle, ChoixSpectacleAdmin) diff --git a/bda2/algorithm.py b/bda2/algorithm.py new file mode 100644 index 00000000..623f9756 --- /dev/null +++ b/bda2/algorithm.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +from django.conf import settings +from django.db.models import Max + +import random + +class Algorithm(object): + + shows = None + ranks = None + origranks = None + double = None + + def __init__(self, shows, members, choices): + """Initialisation : + - on aggrège toutes les demandes pour chaque spectacle dans + show.requests + - on crée des tables de demandes pour chaque personne, afin de + pouvoir modifier les rankings""" + self.max_group = 2 * choices.aggregate(Max('priority'))['priority__max'] + self.shows = [] + showdict = {} + for show in shows: + show.nrequests = 0 + showdict[show] = show + show.requests = [] + self.shows.append(show) + self.ranks = {} + self.origranks = {} + self.choices = {} + next_rank = {} + member_shows = {} + for member in members: + self.ranks[member] = {} + self.choices[member] = {} + next_rank[member] = 1 + member_shows[member] = {} + for choice in choices: + member = choice.participant + if choice.spectacle in member_shows[member]: continue + else: member_shows[member][choice.spectacle] = True + showdict[choice.spectacle].requests.append(member) + showdict[choice.spectacle].nrequests += 2 if choice.double else 1 + self.ranks[member][choice.spectacle] = next_rank[member] + next_rank[member] += 2 if choice.double else 1 + self.choices[member][choice.spectacle] = choice + for member in members: + self.origranks[member] = dict(self.ranks[member]) + + def IncrementRanks(self, member, currank, increment = 1): + for show in self.ranks[member]: + if self.ranks[member][show] > currank: + self.ranks[member][show] -= increment + + def appendResult(self, l, member, show): + l.append((member, + self.ranks[member][show], + self.origranks[member][show], + self.choices[member][show].double)) + + """ + Pour les 2 Walkyries: c'est Sandefer + + Pour les 4 places pour l'Oratorio c'est Maxence Arutkin + """ + + def __call__(self, seed): + random.seed(seed) + results = [] + shows = sorted(self.shows, key = lambda x: float(x.nrequests) / x.slots, reverse = True) + for show in shows: + # On regroupe tous les gens ayant le même rang + groups = dict([(i, []) for i in range(1, self.max_group + 1)]) + for member in show.requests: + if self.ranks[member][show] == 0: + raise RuntimeError, (member, show.title) + groups[self.ranks[member][show]].append(member) + # On passe à l'attribution + winners = [] + losers = [] + for i in range(1, self.max_group + 1): + group = list(groups[i]) + random.shuffle(group) + for member in group: + if self.choices[member][show].double: # double + if len(winners) + 1 < show.slots: + self.appendResult(winners, member, show) + self.appendResult(winners, member, show) + elif not self.choices[member][show].autoquit and len(winners) < show.slots: + self.appendResult(winners, member, show) + self.appendResult(losers, member, show) + else: + self.appendResult(losers, member, show) + self.appendResult(losers, member, show) + self.IncrementRanks(member, i, 2) + else: # simple + if len(winners) < show.slots: + self.appendResult(winners, member, show) + else: + self.appendResult(losers, member, show) + self.IncrementRanks(member, i) + results.append((show,winners,losers)) + return results diff --git a/bda2/autocomplete_light_registry.py b/bda2/autocomplete_light_registry.py new file mode 100644 index 00000000..3254b3c8 --- /dev/null +++ b/bda2/autocomplete_light_registry.py @@ -0,0 +1,9 @@ +import autocomplete_light + +from bda.models import Participant, Spectacle + +autocomplete_light.register(Participant, search_fields=('user__username','user__first_name','user__last_name'), + autocomplete_js_attributes={'placeholder': 'participant...'}) + +autocomplete_light.register(Spectacle, search_fields=('title',), + autocomplete_js_attributes={'placeholder': 'spectacle...'}) diff --git a/bda2/difftobda b/bda2/difftobda new file mode 100644 index 00000000..3e6686e5 --- /dev/null +++ b/bda2/difftobda @@ -0,0 +1,421 @@ +Only in .: .admin.py.swp +Binary files ../bda/__init__.pyc and ./__init__.pyc differ +diff -p -u -r ../bda/admin.py ./admin.py +--- ../bda/admin.py 2013-12-17 10:19:56.000000000 +0100 ++++ ./admin.py 2012-12-08 22:31:46.000000000 +0100 +@@ -4,8 +4,8 @@ from django.core.mail import send_mail + from django.contrib.contenttypes.models import ContentType + + from django.contrib import admin +-from django.db.models import Sum, Count +-from bda.models import Spectacle, Salle, Participant, ChoixSpectacle, Attribution ++from django.db.models import Sum ++from bda2.models import Spectacle, Salle, Participant, ChoixSpectacle, Attribution + + class ChoixSpectacleInline(admin.TabularInline): + model = ChoixSpectacle +@@ -17,18 +17,13 @@ class AttributionInline(admin.TabularInl + class ParticipantAdmin(admin.ModelAdmin): + #inlines = [ChoixSpectacleInline] + inlines = [AttributionInline] +- def queryset(self, request): +- return Participant.objects.annotate(nb_places = Count('attributions'), +- total = Sum('attributions__price')) + def nb_places(self, obj): +- return obj.nb_places +- nb_places.admin_order_field = "nb_places" ++ return len(obj.attribution_set.all()) + nb_places.short_description = "Nombre de places" + def total(self, obj): +- tot = obj.total ++ tot = obj.attributions.aggregate(total = Sum('price'))['total'] + if tot: return u"%.02f €" % tot + else: return u"0 €" +- total.admin_order_field = "total" + total.short_description = "Total à payer" + list_display = ("user", "nb_places", "total", "paid", "paymenttype") + list_filter = ("paid",) +@@ -61,7 +56,7 @@ Voici tes choix de spectacles tels que n + Artistiquement, + Le BdA""" + send_mail ("Choix de spectacles (BdA du COF)", mail, +- "bda@ens.fr", [member.user.email], ++ "bda@clipper.ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: +@@ -86,48 +81,41 @@ pour les spectacles suivants : + %s + + *Paiement* +-L'intégralité de ces places de spectacles est à régler à partir du jeudi +-10 octobre et AVANT le mercredi 23 octobre, au bureau du COF pendant les +-heures de permanences (du lundi au vendredi entre 12h et 14h, et entre 18h +-et 20h). Des facilités de paiement sont bien évidemment possibles : nous +-pouvons ne pas encaisser le chèque immédiatement, ou bien découper votre +-paiement en deux fois. ++Ces spectacles sont à régler avant le lundi 17 décembre, pendant les ++heures de permanences du COF (tous les jours de la semaine entre 12h et ++14h, et entre 18h et 20h). Des facilités de paiement sont bien évidemment ++possibles (encaissement échelonné des chèques). + + *Mode de retrait des places* +-Au moment du paiement, une enveloppe vous sera remise, contenant les +-places pour l'Opéra de Paris, pour les premiers spectacles de la Comédie +-française, certains spectacles du Châtelet et du Théâtre de la Ville. +- +-Pour les concerts Radio France, le Théâtre des Champs-Élysées, le théâtre +-du Rond-Point, le théâtre de la Colline, le théâtre de l'Athénée, l'IRCAM, +-la Cité de la musique et le 104, le Studio-Théâtre de la Comédie +-française, les places seront nominatives et à retirer au théâtre le soir +-de la représentation au moins une demi-heure avant le début du spectacle. +- +-Pour le théâtre de l'Odéon, la salle Richelieu le théâtre du Vieux +-colombier de la Comédie française, certains spectacles du théâtre de la +-Ville et du théâtre de Châtelet ainsi que pour le théâtre de Chaillot, les +-places seront distribuées environ une semaine avant la représentation (un +-mail vous en avertira). +- +-Nous vous rappelons que l'obtention de places du BdA vous engage à +-respecter les règles de fonctionnement : +-http://www.cof.ens.fr/bda/?page_id=1370 +-Le système de revente des places via les mails BdA-revente sera très +-prochainement disponible, directement sur votre compte GestioCOF. ++Pour l'Opéra de Paris, le théâtre de la Colline et le théâtre du Châtelet, ++les places sont à retirer au COF le jour du paiement. ++ ++Pour les concerts Radio France, le théâtre des Champs-Élysées, l'IRCAM ++et le 104, les places seront nominatives et à retirer à la salle le soir de ++la représentation au moins une demi-heure avant le début du spectacle. ++ ++Pour le théâtre de l'Odéon, la Comédie Française, le théâtre de la Ville, ++le théâtre de Chaillot, les places seront distribuées dans vos ++casiers environ une semaine avant la représentation (un mail vous en ++avertira). ++ ++Dans tous les cas, n'hésitez pas à nous contacter si vous avez un doute ! ++ ++Nous profitons aussi de ce message pour vous annoncer qu'un festival de ++courts métrages aura lieu le 21 décembre dans l'école. ++Plus d'informations : http://www.cof.ens.fr/bda/courts. ++ ++Culturellement vôtre, + +-En vous souhaitant de très beaux spectacles tout au long de l'année, + -- +-Le Bureau des Arts +-(Chloé, Emilie, Jaime, Maxime, Olivier) +-""" ++Le BdA""" + attribs_text = "" + name = member.user.get_full_name() + for attrib in attribs: + attribs_text += u"- 1 place pour %s\n" % attrib + mail = mail % (name, attribs_text) +- send_mail ("Résultats du tirage au sort", mail, +- "bda@ens.fr", [member.user.email], ++ send_mail ("Places de spectacle (BdA du COF)", mail, ++ "bda@clipper.ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: +@@ -154,13 +142,7 @@ class ChoixSpectacleAdmin(admin.ModelAdm + list_filter = ("double", "autoquit") + search_fields = ('participant__user__username', 'participant__user__first_name', 'participant__user__last_name') + +-class SpectacleAdmin(admin.ModelAdmin): +- model = Spectacle +- list_display = ("title", "date", "location", "slots", "price") +- list_filter = ("location",) +- search_fields = ("title", "location__name") +- +-admin.site.register(Spectacle, SpectacleAdmin) ++admin.site.register(Spectacle) + admin.site.register(Salle) + admin.site.register(Participant, ParticipantAdmin) + admin.site.register(Attribution, AttributionAdmin) +diff -p -u -r ../bda/algorithm.py ./algorithm.py +--- ../bda/algorithm.py 2013-10-07 14:08:44.000000000 +0200 ++++ ./algorithm.py 2012-10-31 23:01:48.000000000 +0100 +@@ -29,24 +29,25 @@ class Algorithm(object): + self.ranks = {} + self.origranks = {} + self.choices = {} +- next_rank = {} +- member_shows = {} + for member in members: +- self.ranks[member] = {} +- self.choices[member] = {} +- next_rank[member] = 1 +- member_shows[member] = {} +- for choice in choices: +- member = choice.participant +- if choice.spectacle in member_shows[member]: continue +- else: member_shows[member][choice.spectacle] = True +- showdict[choice.spectacle].requests.append(member) +- showdict[choice.spectacle].nrequests += 2 if choice.double else 1 +- self.ranks[member][choice.spectacle] = next_rank[member] +- next_rank[member] += 2 if choice.double else 1 +- self.choices[member][choice.spectacle] = choice +- for member in members: +- self.origranks[member] = dict(self.ranks[member]) ++ ranks = {} ++ member_choices = {} ++ member_shows = {} ++ #next_priority = 1 ++ next_rank = 1 ++ for choice in member.choixspectacle_set.order_by('priority').all(): ++ if choice.spectacle in member_shows: continue ++ else: member_shows[choice.spectacle] = True ++ #assert choice.priority == next_priority ++ #next_priority += 1 ++ showdict[choice.spectacle].requests.append(member) ++ showdict[choice.spectacle].nrequests += 2 if choice.double else 1 ++ ranks[choice.spectacle] = next_rank ++ next_rank += 2 if choice.double else 1 ++ member_choices[choice.spectacle] = choice ++ self.ranks[member] = ranks ++ self.choices[member] = member_choices ++ self.origranks[member] = dict(ranks) + + def IncrementRanks(self, member, currank, increment = 1): + for show in self.ranks[member]: +Only in ../bda: algorithm.pyc +Only in .: difftobda +diff -p -u -r ../bda/models.py ./models.py +--- ../bda/models.py 2013-10-10 10:44:43.000000000 +0200 ++++ ./models.py 2012-10-31 23:12:56.000000000 +0100 +@@ -1,7 +1,5 @@ + # coding: utf-8 + +-import calendar +- + from django.db import models + from django.contrib.auth.models import User + from django.utils.translation import ugettext_lazy as _ +@@ -19,7 +17,7 @@ class Spectacle (models.Model): + date = models.DateTimeField ("Date & heure") + location = models.ForeignKey(Salle) + description = models.TextField ("Description", blank = True) +- slots_description = models.TextField ("Description des places", blank = True) ++ #slots_description = models.TextField ("Description des places", blank = True) + price = models.FloatField("Prix d'une place", blank = True) + slots = models.IntegerField ("Places") + priority = models.IntegerField ("Priorité", default = 1000) +@@ -31,14 +29,11 @@ class Spectacle (models.Model): + def __repr__ (self): + return u"[%s]" % self.__unicode__() + +- def timestamp(self): +- return "%d" % calendar.timegm(self.date.utctimetuple()) +- + def date_no_seconds(self): + return self.date.strftime('%d %b %Y %H:%M') + + def __unicode__ (self): +- return u"%s - %s, %s, %.02f€" % (self.title, self.date_no_seconds(), self.location, self.price) ++ return u"%s - %s @ %s, %.02f€" % (self.title, self.date_no_seconds(), self.location, self.price) + + PAYMENT_TYPES = ( + ("cash",u"Cash"), +@@ -48,7 +43,7 @@ PAYMENT_TYPES = ( + ) + + class Participant (models.Model): +- user = models.ForeignKey(User, unique = True) ++ user = models.ForeignKey(User, unique = True, related_name = "participants2") + choices = models.ManyToManyField(Spectacle, through = "ChoixSpectacle", related_name = "chosen_by") + attributions = models.ManyToManyField(Spectacle, through = "Attribution", related_name = "attributed_to") + paid = models.BooleanField (u"A payé", default = False) +Binary files ../bda/models.pyc and ./models.pyc differ +diff -p -u -r ../bda/views.py ./views.py +--- ../bda/views.py 2014-01-04 21:37:15.000000000 +0100 ++++ ./views.py 2013-02-12 22:03:38.000000000 +0100 +@@ -1,23 +1,19 @@ + # coding: utf-8 + +-from django.contrib.auth.models import User + from django.shortcuts import render, get_object_or_404 + from django.contrib.auth.decorators import login_required + from django.db import models + from django.http import Http404 + from django import forms + from django.forms.models import inlineformset_factory, BaseInlineFormSet +-from django.core import serializers +-import hashlib + + from django.core.mail import send_mail + +-from datetime import datetime + import time + + from gestioncof.decorators import cof_required, buro_required +-from bda.models import Spectacle, Participant, ChoixSpectacle, Attribution +-from bda.algorithm import Algorithm ++from bda2.models import Spectacle, Participant, ChoixSpectacle, Attribution ++from bda2.algorithm import Algorithm + + class BaseBdaFormSet(BaseInlineFormSet): + def clean(self): +@@ -37,7 +33,7 @@ class BaseBdaFormSet(BaseInlineFormSet): + raise forms.ValidationError("Vous ne pouvez pas vous inscrire deux fois pour le même spectacle.") + spectacles.append(spectacle) + +-@cof_required ++@buro_required + def etat_places(request): + spectacles1 = ChoixSpectacle.objects.all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) + spectacles2 = ChoixSpectacle.objects.filter(double = True).all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) +@@ -46,93 +42,47 @@ def etat_places(request): + total = 0 + for spectacle in spectacles: + spectacle.total = 0 +- spectacle.ratio = -1.0 + spectacles_dict[spectacle.id] = spectacle + for spectacle in spectacles1: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] +- spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + for spectacle in spectacles2: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] +- spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + return render(request, "etat-places.html", {"spectacles": spectacles, "total": total}) + +-def _hash_queryset(queryset): +- data = serializers.serialize("json", queryset) +- hasher = hashlib.sha256() +- hasher.update(data) +- return hasher.hexdigest() +- +-@cof_required +-def places(request): +- participant, created = Participant.objects.get_or_create(user = request.user) +- places = participant.attribution_set.order_by("spectacle__date", "spectacle").all() +- total = sum([place.spectacle.price for place in places]) +- filtered_places = [] +- places_dict = {} +- spectacles = [] +- dates = [] +- warning = False +- for place in places: +- if place.spectacle in spectacles: +- places_dict[place.spectacle].double = True +- else: +- place.double = False +- places_dict[place.spectacle] = place +- spectacles.append(place.spectacle) +- filtered_places.append(place) +- date = place.spectacle.date.date() +- if date in dates: +- warning = True +- else: +- dates.append(date) +- return render(request, "resume_places.html", +- {"participant": participant, +- "places": filtered_places, +- "total": total, +- "warning": warning}) +- + @cof_required + def inscription(request): +- if datetime.now() > datetime(2013, 10, 6, 23, 59): +- participant, created = Participant.objects.get_or_create(user = request.user) +- choices = participant.choixspectacle_set.order_by("priority").all() +- return render(request, "resume_inscription.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort le 7 octobre !", "choices": choices}) ++ if time.time() > 1354921200: ++ return render(request, "error.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort le 6 octobre dans la soirée "}) + BdaFormSet = inlineformset_factory(Participant, ChoixSpectacle, fields = ("spectacle","double","autoquit","priority",), formset = BaseBdaFormSet) + participant, created = Participant.objects.get_or_create(user = request.user) + success = False +- stateerror = False + if request.method == "POST": +- dbstate = _hash_queryset(participant.choixspectacle_set.all()) +- if "dbstate" in request.POST and dbstate != request.POST["dbstate"]: +- stateerror = True ++ formset = BdaFormSet(request.POST, instance = participant) ++ if formset.is_valid(): ++ #ChoixSpectacle.objects.filter(participant = participant).delete() ++ formset.save() ++ success = True + formset = BdaFormSet(instance = participant) +- else: +- formset = BdaFormSet(request.POST, instance = participant) +- if formset.is_valid(): +- #ChoixSpectacle.objects.filter(participant = participant).delete() +- formset.save() +- success = True +- formset = BdaFormSet(instance = participant) + else: + formset = BdaFormSet(instance = participant) +- dbstate = _hash_queryset(participant.choixspectacle_set.all()) + total_price = 0 + for choice in participant.choixspectacle_set.all(): + total_price += choice.spectacle.price + if choice.double: total_price += choice.spectacle.price +- return render(request, "inscription-bda.html", {"formset": formset, "success": success, "total_price": total_price, "dbstate": dbstate, "stateerror": stateerror}) ++ return render(request, "inscription-bda.html", {"formset": formset, "success": success, "total_price": total_price}) ++ ++Spectacle.deficit = lambda x: (x.slots-x.nrequests)*x.price + + def do_tirage(request): + form = TokenForm(request.POST) + if not form.is_valid(): + return tirage(request) +- start = time.time() + data = {} +- shows = Spectacle.objects.select_related().all() ++ shows = Spectacle.objects.all() + members = Participant.objects.all() +- choices = ChoixSpectacle.objects.order_by('participant', 'priority').select_related().all() ++ choices = ChoixSpectacle.objects.all() + algo = Algorithm(shows, members, choices) + results = algo(form.cleaned_data["token"]) + total_slots = 0 +@@ -149,8 +99,8 @@ def do_tirage(request): + total_sold = 0 + total_deficit = 0 + opera_deficit = 0 +- for (show, members, _) in results: +- deficit = (show.slots - len(members)) * show.price ++ for show in shows: ++ deficit = show.deficit() + total_sold += show.slots * show.price + if deficit >= 0: + if u"Opéra" in show.location.name: +@@ -159,23 +109,18 @@ def do_tirage(request): + data["total_sold"] = total_sold - total_deficit + data["total_deficit"] = total_deficit + data["opera_deficit"] = opera_deficit +- data["duration"] = time.time() - start + if request.user.is_authenticated(): + members2 = {} +- members_uniq = {} # Participant objects are not shared accross spectacle results, +- # So assign a single object for each Participant id + for (show, members, _) in results: + for (member, _, _, _) in members: +- if member.id not in members_uniq: +- members_uniq[member.id] = member ++ if member not in members2: + members2[member] = [] + member.total = 0 +- member = members_uniq[member.id] + members2[member].append(show) + member.total += show.price + members2 = members2.items() + data["members2"] = sorted(members2, key = lambda m: m[0].user.last_name) +- if False and request.user.username in ["seguin", "harazi"]: ++ if False and request.user.username == "seguin": + Attribution.objects.all().delete() + for (show, members, _) in results: + for (member, _, _, _) in members: +@@ -220,7 +165,7 @@ Je souhaite revendre %s pour %s le %s (% + Contactez moi par email si vous êtes intéressés ! + + %s (%s)""" % (places, spectacle.title, spectacle.date_no_seconds(), spectacle.location, spectacle.price, request.user.get_full_name(), request.user.email) +- send_mail("%s" % spectacle, mail, ++ send_mail("Revente de place: %s" % spectacle, mail, + request.user.email, ["bda-revente@lists.ens.fr"], + fail_silently = True) + return render(request, "bda-success.html", {"show": spectacle, "places": places}) +Only in .: views.py~ diff --git a/bda2/models.py b/bda2/models.py new file mode 100644 index 00000000..bcc4e15c --- /dev/null +++ b/bda2/models.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +import calendar + +from django.db import models +from django.contrib.auth.models import User +from django.utils.translation import ugettext_lazy as _ +from django.db.models.signals import post_save + +class Salle (models.Model): + name = models.CharField ("Nom", max_length = 300) + address = models.TextField ("Adresse") + + def __unicode__ (self): + return self.name + +class Spectacle (models.Model): + title = models.CharField ("Titre", max_length = 300) + date = models.DateTimeField ("Date & heure") + location = models.ForeignKey(Salle) + description = models.TextField ("Description", blank = True) + slots_description = models.TextField ("Description des places", blank = True) + price = models.FloatField("Prix d'une place", blank = True) + slots = models.IntegerField ("Places") + priority = models.IntegerField ("Priorité", default = 1000) + + class Meta: + verbose_name = "Spectacle" + ordering = ("priority", "date","title",) + + def __repr__ (self): + return u"[%s]" % self.__unicode__() + + def timestamp(self): + return "%d" % calendar.timegm(self.date.utctimetuple()) + + def date_no_seconds(self): + return self.date.strftime('%d %b %Y %H:%M') + + def __unicode__ (self): + return u"%s - %s, %s, %.02f€" % (self.title, self.date_no_seconds(), self.location, self.price) + +PAYMENT_TYPES = ( +("cash",u"Cash"), +("cb","CB"), +("cheque",u"Chèque"), +("autre",u"Autre"), +) + +class Participant (models.Model): + user = models.ForeignKey(User, unique = True, related_name = "participants2") + choices = models.ManyToManyField(Spectacle, through = "ChoixSpectacle", related_name = "chosen_by") + attributions = models.ManyToManyField(Spectacle, through = "Attribution", related_name = "attributed_to") + paid = models.BooleanField (u"A payé", default = False) + paymenttype = models.CharField(u"Moyen de paiement", max_length = 6, choices = PAYMENT_TYPES, blank = True) + + def __unicode__ (self): + return u"%s" % (self.user) + +class ChoixSpectacle (models.Model): + participant = models.ForeignKey(Participant) + spectacle = models.ForeignKey(Spectacle, related_name = "participants") + priority = models.PositiveIntegerField("Priorité") + double = models.BooleanField("Deux places1",default=False) + autoquit = models.BooleanField("Abandon2",default=False) + class Meta: + ordering = ("priority",) + unique_together = (("participant", "spectacle",),) + verbose_name = "voeu" + verbose_name_plural = "voeux" + +class Attribution (models.Model): + participant = models.ForeignKey(Participant) + spectacle = models.ForeignKey(Spectacle, related_name = "attribues") + given = models.BooleanField(u"Donnée", default = False) + + def __unicode__ (self): + return u"%s -- %s" % (self.participant, self.spectacle) diff --git a/bda2/tests.py b/bda2/tests.py new file mode 100644 index 00000000..501deb77 --- /dev/null +++ b/bda2/tests.py @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase + + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) diff --git a/bda2/views.py b/bda2/views.py new file mode 100644 index 00000000..93d54f62 --- /dev/null +++ b/bda2/views.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +from django.contrib.auth.models import User +from django.shortcuts import render, get_object_or_404 +from django.contrib.auth.decorators import login_required +from django.db import models +from django.http import Http404 +from django import forms +from django.forms.models import inlineformset_factory, BaseInlineFormSet +from django.core import serializers +import hashlib + +from django.core.mail import send_mail + +from datetime import datetime +import time + +from gestioncof.decorators import cof_required, buro_required +from bda2.models import Spectacle, Participant, ChoixSpectacle, Attribution +from bda2.algorithm import Algorithm + +class BaseBdaFormSet(BaseInlineFormSet): + def clean(self): + """Checks that no two articles have the same title.""" + super(BaseBdaFormSet, self).clean() + if any(self.errors): + # Don't bother validating the formset unless each form is valid on its own + return + spectacles = [] + for i in range(0, self.total_form_count()): + form = self.forms[i] + if not form.cleaned_data: + continue + spectacle = form.cleaned_data['spectacle'] + delete = form.cleaned_data['DELETE'] + if not delete and spectacle in spectacles: + raise forms.ValidationError("Vous ne pouvez pas vous inscrire deux fois pour le même spectacle.") + spectacles.append(spectacle) + +@cof_required +def etat_places(request): + spectacles1 = ChoixSpectacle.objects.all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) + spectacles2 = ChoixSpectacle.objects.filter(double = True).all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) + spectacles = Spectacle.objects.all() + spectacles_dict = {} + total = 0 + for spectacle in spectacles: + spectacle.total = 0 + spectacle.ratio = 0.0 + spectacles_dict[spectacle.id] = spectacle + for spectacle in spectacles1: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] + spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + for spectacle in spectacles2: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] + spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + return render(request, "etat-places.html", {"spectacles": spectacles, "total": total}) + +def _hash_queryset(queryset): + data = serializers.serialize("json", queryset) + hasher = hashlib.sha256() + hasher.update(data) + return hasher.hexdigest() + +@cof_required +def places(request): + participant, created = Participant.objects.get_or_create(user = request.user) + places = participant.attribution_set.order_by("spectacle__date", "spectacle").all() + total = sum([place.spectacle.price for place in places]) + filtered_places = [] + places_dict = {} + spectacles = [] + dates = [] + warning = False + for place in places: + if place.spectacle in spectacles: + places_dict[place.spectacle].double = True + else: + place.double = False + places_dict[place.spectacle] = place + spectacles.append(place.spectacle) + filtered_places.append(place) + date = place.spectacle.date.date() + if date in dates: + warning = True + else: + dates.append(date) + return render(request, "resume_places.html", + {"participant": participant, + "places": filtered_places, + "total": total, + "warning": warning}) + +@cof_required +def inscription(request): + if datetime.now() > datetime(2016, 1, 17, 12, 00): + participant, created = Participant.objects.get_or_create(user = request.user) + choices = participant.choixspectacle_set.order_by("priority").all() + return render(request, "resume_inscription.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort le 17 janvier !", "choices": choices}) + BdaFormSet = inlineformset_factory(Participant, ChoixSpectacle, fields = ("spectacle","double","autoquit","priority",), formset = BaseBdaFormSet) + participant, created = Participant.objects.get_or_create(user = request.user) + success = False + stateerror = False + if request.method == "POST": + dbstate = _hash_queryset(participant.choixspectacle_set.all()) + if "dbstate" in request.POST and dbstate != request.POST["dbstate"]: + stateerror = True + formset = BdaFormSet(instance = participant) + else: + formset = BdaFormSet(request.POST, instance = participant) + if formset.is_valid(): + #ChoixSpectacle.objects.filter(participant = participant).delete() + formset.save() + success = True + formset = BdaFormSet(instance = participant) + else: + formset = BdaFormSet(instance = participant) + dbstate = _hash_queryset(participant.choixspectacle_set.all()) + total_price = 0 + for choice in participant.choixspectacle_set.all(): + total_price += choice.spectacle.price + if choice.double: total_price += choice.spectacle.price + return render(request, "inscription-bda2.html", {"formset": formset, "success": success, "total_price": total_price, "dbstate": dbstate, "stateerror": stateerror}) + +def do_tirage(request): + form = TokenForm(request.POST) + if not form.is_valid(): + return tirage(request) + start = time.time() + data = {} + shows = Spectacle.objects.select_related().all() + members = Participant.objects.all() + choices = ChoixSpectacle.objects.order_by('participant', 'priority').select_related().all() + algo = Algorithm(shows, members, choices) + results = algo(form.cleaned_data["token"]) + total_slots = 0 + total_losers = 0 + for (_, members, losers) in results: + total_slots += len(members) + total_losers += len(losers) + data["total_slots"] = total_slots + data["total_losers"] = total_losers + data["shows"] = shows + data["token"] = form.cleaned_data["token"] + data["members"] = members + data["results"] = results + total_sold = 0 + total_deficit = 0 + opera_deficit = 0 + for (show, members, _) in results: + deficit = (show.slots - len(members)) * show.price + total_sold += show.slots * show.price + if deficit >= 0: + if u"Opéra" in show.location.name: + opera_deficit += deficit + total_deficit += deficit + data["total_sold"] = total_sold - total_deficit + data["total_deficit"] = total_deficit + data["opera_deficit"] = opera_deficit + data["duration"] = time.time() - start + if request.user.is_authenticated(): + members2 = {} + members_uniq = {} # Participant objects are not shared accross spectacle results, + # So assign a single object for each Participant id + for (show, members, _) in results: + for (member, _, _, _) in members: + if member.id not in members_uniq: + members_uniq[member.id] = member + members2[member] = [] + member.total = 0 + member = members_uniq[member.id] + members2[member].append(show) + member.total += show.price + members2 = members2.items() + data["members2"] = sorted(members2, key = lambda m: m[0].user.last_name) + if False and request.user.username in ["seguin", "harazi", "fromherz", "mpepin"]: + Attribution.objects.all().delete() + for (show, members, _) in results: + for (member, _, _, _) in members: + attrib = Attribution(spectacle = show, participant = member) + attrib.save() + return render(request, "bda-attrib-extra.html", data) + else: + return render(request, "bda-attrib.html", data) + +class TokenForm(forms.Form): + token = forms.CharField(widget = forms.widgets.Textarea()) + +@login_required +def tirage(request): + if request.POST: + form = TokenForm(request.POST) + if form.is_valid(): + return do_tirage(request) + else: + form = TokenForm() + return render(request, "bda-token.html", {"form": form}) + +class SpectacleModelChoiceField(forms.ModelChoiceField): + def label_from_instance(self, obj): + return u"%s le %s (%s) à %.02f€" % (obj.title, obj.date_no_seconds(), obj.location, obj.price) + +class ResellForm(forms.Form): + count = forms.ChoiceField(choices = (("1","1"),("2","2"),)) + spectacle = SpectacleModelChoiceField(queryset = Spectacle.objects.none()) + + def __init__(self, participant, *args, **kwargs): + super(ResellForm, self).__init__(*args, **kwargs) + self.fields['spectacle'].queryset = participant.attributions.all().distinct() + +def do_resell(request, form): + spectacle = form.cleaned_data["spectacle"] + count = form.cleaned_data["count"] + places = "2 places" if count == "2" else "une place" + mail = u"""Bonjour, + +Je souhaite revendre %s pour %s le %s (%s) à %.02f€. +Contactez moi par email si vous êtes intéressés ! + +%s (%s)""" % (places, spectacle.title, spectacle.date_no_seconds(), spectacle.location, spectacle.price, request.user.get_full_name(), request.user.email) + send_mail("%s" % spectacle, mail, + request.user.email, ["bda-revente@lists.ens.fr"], + fail_silently = True) + return render(request, "bda-success.html", {"show": spectacle, "places": places}) + +@login_required +def revente(request): + participant, created = Participant.objects.get_or_create(user = request.user) + if not participant.paid: + return render(request, "bda-notpaid.html", {}) + if request.POST: + form = ResellForm(participant, request.POST) + if form.is_valid(): + return do_resell(request, form) + else: + form = ResellForm(participant) + return render(request, "bda-revente.html", {"form": form}) + +@buro_required +def spectacle(request, spectacle_id): + spectacle = get_object_or_404(Spectacle, id = spectacle_id) + return render(request, "bda-emails.html", {"spectacle": spectacle}) + +@buro_required +def unpaid(request): + return render(request, "bda-unpaid.html", {"unpaid": Participant.objects.filter(paid = False).all()}) diff --git a/bda3/__init__.py b/bda3/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/bda3/admin.py b/bda3/admin.py new file mode 100644 index 00000000..a4c7b05a --- /dev/null +++ b/bda3/admin.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +from django.core.mail import send_mail +from django.contrib.contenttypes.models import ContentType + +from django.contrib import admin +from django.db.models import Sum, Count +from bda3.models import Spectacle, Salle, Participant, ChoixSpectacle, Attribution + +class ChoixSpectacleInline(admin.TabularInline): + model = ChoixSpectacle + sortable_field_name = "priority" + +class AttributionInline(admin.TabularInline): + model = Attribution + +class ParticipantAdmin(admin.ModelAdmin): + #inlines = [ChoixSpectacleInline] + inlines = [AttributionInline] + def queryset(self, request): + return Participant.objects.annotate(nb_places = Count('attributions'), + total = Sum('attributions__price')) + def nb_places(self, obj): + return obj.nb_places + nb_places.admin_order_field = "nb_places" + nb_places.short_description = "Nombre de places" + def total(self, obj): + tot = obj.total + if tot: return u"%.02f €" % tot + else: return u"0 €" + total.admin_order_field = "total" + total.short_description = "Total à payer" + list_display = ("user", "nb_places", "total", "paid", "paymenttype") + list_filter = ("paid",) + search_fields = ('user__username', 'user__first_name', 'user__last_name') + actions = ['send_attribs',] + actions_on_bottom = True + list_per_page = 400 + + def send_choices(self, request, queryset): + for member in queryset.all(): + choices = member.choixspectacle_set.order_by('priority').all() + if len(choices) == 0: + continue + mail = u"""Cher(e) %s, +Voici tes choix de spectacles tels que notre système les a enregistrés :\n\n""" % member.user.get_full_name() + next_rank = 1 + member_shows = {} + for choice in choices: + if choice.spectacle in member_shows: continue + else: member_shows[choice.spectacle] = True + extra = "" + if choice.double: + extra += u" ; deux places" + if choice.autoquit: + extra += u" ; désistement automatique" + mail += u"- Choix %d : %s%s\n" % (next_rank, choice.spectacle, extra) + next_rank += 1 + mail += u"""\nSi cette liste est incorrecte, merci de nous contacter au plus vite (avant samedi 6 octobre 18h). + +Artistiquement, +Le BdA""" + send_mail ("Choix de spectacles (BdA du COF)", mail, + "bda@ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: + message_bit = u"1 membre a" + plural = "" + else: + message_bit = u"%d membres ont" % count + plural = "s" + self.message_user(request, u"%s été informé%s avec succès." % (message_bit, plural)) + send_choices.short_description = u"Envoyer les choix par mail" + + def send_attribs(self, request, queryset): + for member in queryset.all(): + attribs = member.attributions.all() + if len(attribs) == 0: + mail = u"""Cher-e %s, + +Tu t'es inscrit-e pour le troisième tirage au sort du BdA. Nous avons le regret +de t'annoncer que tu n'as pas obtenu de place. + +Nous sommes bien conscients que le nombre de places mises en jeu était +très restreint, mais les premier et deuxième tirages au sort comprenaient +déjà un nombre exceptionnel de places, et nous dépendons des limites +fixées par les théâtres partenaires pour l'obtention de places à tarif réduit. + +Le système de revente des places via les mails BdA-revente reste disponible, +alors surveille tes mails. + +En vous souhaitant une bonne fin de journée, +-- +Le Bureau des Arts + +""" + name = member.user.get_full_name() + mail = mail % name + else: + mail = u"""Cher-e %s, + +Tu t'es inscrit-e pour le troisième tirage au sort du BdA. Tu as été +sélectionné-e pour les spectacles suivants : + +%s + +Nous sommes bien conscients que le nombre de places mises en jeu était +très restreint, mais les premier et deuxième tirages au sort comprenaient +déjà un nombre exceptionnel de places, et nous dépendons des limites fixées +par les théâtres partenaires pour l'obtention de places à tarif réduit. + +*Paiement* +L'intégralité de ces places de spectacles est à régler à partir du lundi +11 avril et AVANT le 16 avril, au bureau du COF pendant les +heures de permanences (du lundi au vendredi entre 12h et 14h, et entre 18h +et 20h). Si vous n'êtes pas disponible cette semaine, prévenez-nous par mail. +Attention : au-delà de cette date, les places pourront être remises en jeu. + +*Mode de retrait des places* +Au moment du paiement, les places pour les spectacles de la Comédie-Française +et pour la Philarmonie vous seront remises. + +Nous vous rappelons que l'obtention de places du BdA vous engage à +respecter les règles de fonctionnement : +http://www.cof.ens.fr/bda/?page_id=1370 + +Le système de revente des places via les mails BdA-revente reste disponible, +directement sur votre compte GestioCOF. + +En vous souhaitant de très beaux spectacles, +-- +Le Bureau des Arts + +""" + attribs_text = "" + name = member.user.get_full_name() + for attrib in attribs: + attribs_text += u"- 1 place pour %s\n" % attrib + mail = mail % (name, attribs_text) + + send_mail ("[BdA] Résultats du tirage au sort", mail, + "bda@ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: + message_bit = u"1 membre a" + plural = "" + else: + message_bit = u"%d membres ont" % count + plural = "s" + self.message_user(request, u"%s été informé%s avec succès." % (message_bit, plural)) + send_attribs.short_description = u"Envoyer les résultats par mail" + +class AttributionAdmin(admin.ModelAdmin): + def paid(self, obj): + return obj.participant.paid + paid.short_description = 'A payé' + paid.boolean = True + list_display = ("id", "spectacle", "participant", "given", "paid") + search_fields = ('spectacle__title', 'participant__user__username', 'participant__user__first_name', 'participant__user__last_name') + +import autocomplete_light +class ChoixSpectacleAdmin(admin.ModelAdmin): + form = autocomplete_light.modelform_factory(ChoixSpectacle) + list_display = ("participant", "spectacle", "priority", "double", "autoquit") + list_filter = ("double", "autoquit") + search_fields = ('participant__user__username', 'participant__user__first_name', 'participant__user__last_name') + +class SpectacleAdmin(admin.ModelAdmin): + model = Spectacle + list_display = ("title", "date", "location", "slots", "price") + list_filter = ("location",) + search_fields = ("title", "location__name") + +admin.site.register(Spectacle, SpectacleAdmin) +admin.site.register(Salle) +admin.site.register(Participant, ParticipantAdmin) +admin.site.register(Attribution, AttributionAdmin) +admin.site.register(ChoixSpectacle, ChoixSpectacleAdmin) diff --git a/bda3/algorithm.py b/bda3/algorithm.py new file mode 100644 index 00000000..623f9756 --- /dev/null +++ b/bda3/algorithm.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +from django.conf import settings +from django.db.models import Max + +import random + +class Algorithm(object): + + shows = None + ranks = None + origranks = None + double = None + + def __init__(self, shows, members, choices): + """Initialisation : + - on aggrège toutes les demandes pour chaque spectacle dans + show.requests + - on crée des tables de demandes pour chaque personne, afin de + pouvoir modifier les rankings""" + self.max_group = 2 * choices.aggregate(Max('priority'))['priority__max'] + self.shows = [] + showdict = {} + for show in shows: + show.nrequests = 0 + showdict[show] = show + show.requests = [] + self.shows.append(show) + self.ranks = {} + self.origranks = {} + self.choices = {} + next_rank = {} + member_shows = {} + for member in members: + self.ranks[member] = {} + self.choices[member] = {} + next_rank[member] = 1 + member_shows[member] = {} + for choice in choices: + member = choice.participant + if choice.spectacle in member_shows[member]: continue + else: member_shows[member][choice.spectacle] = True + showdict[choice.spectacle].requests.append(member) + showdict[choice.spectacle].nrequests += 2 if choice.double else 1 + self.ranks[member][choice.spectacle] = next_rank[member] + next_rank[member] += 2 if choice.double else 1 + self.choices[member][choice.spectacle] = choice + for member in members: + self.origranks[member] = dict(self.ranks[member]) + + def IncrementRanks(self, member, currank, increment = 1): + for show in self.ranks[member]: + if self.ranks[member][show] > currank: + self.ranks[member][show] -= increment + + def appendResult(self, l, member, show): + l.append((member, + self.ranks[member][show], + self.origranks[member][show], + self.choices[member][show].double)) + + """ + Pour les 2 Walkyries: c'est Sandefer + + Pour les 4 places pour l'Oratorio c'est Maxence Arutkin + """ + + def __call__(self, seed): + random.seed(seed) + results = [] + shows = sorted(self.shows, key = lambda x: float(x.nrequests) / x.slots, reverse = True) + for show in shows: + # On regroupe tous les gens ayant le même rang + groups = dict([(i, []) for i in range(1, self.max_group + 1)]) + for member in show.requests: + if self.ranks[member][show] == 0: + raise RuntimeError, (member, show.title) + groups[self.ranks[member][show]].append(member) + # On passe à l'attribution + winners = [] + losers = [] + for i in range(1, self.max_group + 1): + group = list(groups[i]) + random.shuffle(group) + for member in group: + if self.choices[member][show].double: # double + if len(winners) + 1 < show.slots: + self.appendResult(winners, member, show) + self.appendResult(winners, member, show) + elif not self.choices[member][show].autoquit and len(winners) < show.slots: + self.appendResult(winners, member, show) + self.appendResult(losers, member, show) + else: + self.appendResult(losers, member, show) + self.appendResult(losers, member, show) + self.IncrementRanks(member, i, 2) + else: # simple + if len(winners) < show.slots: + self.appendResult(winners, member, show) + else: + self.appendResult(losers, member, show) + self.IncrementRanks(member, i) + results.append((show,winners,losers)) + return results diff --git a/bda3/autocomplete_light_registry.py b/bda3/autocomplete_light_registry.py new file mode 100644 index 00000000..3254b3c8 --- /dev/null +++ b/bda3/autocomplete_light_registry.py @@ -0,0 +1,9 @@ +import autocomplete_light + +from bda.models import Participant, Spectacle + +autocomplete_light.register(Participant, search_fields=('user__username','user__first_name','user__last_name'), + autocomplete_js_attributes={'placeholder': 'participant...'}) + +autocomplete_light.register(Spectacle, search_fields=('title',), + autocomplete_js_attributes={'placeholder': 'spectacle...'}) diff --git a/bda3/difftobda b/bda3/difftobda new file mode 100644 index 00000000..70c81735 --- /dev/null +++ b/bda3/difftobda @@ -0,0 +1,421 @@ +Only in .: .admin.py.swp +Binary files ../bda/__init__.pyc and ./__init__.pyc differ +diff -p -u -r ../bda/admin.py ./admin.py +--- ../bda/admin.py 2013-12-17 10:19:56.000000000 +0100 ++++ ./admin.py 2012-12-08 22:31:46.000000000 +0100 +@@ -4,8 +4,8 @@ from django.core.mail import send_mail + from django.contrib.contenttypes.models import ContentType + + from django.contrib import admin +-from django.db.models import Sum, Count +-from bda.models import Spectacle, Salle, Participant, ChoixSpectacle, Attribution ++from django.db.models import Sum ++from bda3.models import Spectacle, Salle, Participant, ChoixSpectacle, Attribution + + class ChoixSpectacleInline(admin.TabularInline): + model = ChoixSpectacle +@@ -17,18 +17,13 @@ class AttributionInline(admin.TabularInl + class ParticipantAdmin(admin.ModelAdmin): + #inlines = [ChoixSpectacleInline] + inlines = [AttributionInline] +- def queryset(self, request): +- return Participant.objects.annotate(nb_places = Count('attributions'), +- total = Sum('attributions__price')) + def nb_places(self, obj): +- return obj.nb_places +- nb_places.admin_order_field = "nb_places" ++ return len(obj.attribution_set.all()) + nb_places.short_description = "Nombre de places" + def total(self, obj): +- tot = obj.total ++ tot = obj.attributions.aggregate(total = Sum('price'))['total'] + if tot: return u"%.02f €" % tot + else: return u"0 €" +- total.admin_order_field = "total" + total.short_description = "Total à payer" + list_display = ("user", "nb_places", "total", "paid", "paymenttype") + list_filter = ("paid",) +@@ -61,7 +56,7 @@ Voici tes choix de spectacles tels que n + Artistiquement, + Le BdA""" + send_mail ("Choix de spectacles (BdA du COF)", mail, +- "bda@ens.fr", [member.user.email], ++ "bda@clipper.ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: +@@ -86,48 +81,41 @@ pour les spectacles suivants : + %s + + *Paiement* +-L'intégralité de ces places de spectacles est à régler à partir du jeudi +-10 octobre et AVANT le mercredi 23 octobre, au bureau du COF pendant les +-heures de permanences (du lundi au vendredi entre 12h et 14h, et entre 18h +-et 20h). Des facilités de paiement sont bien évidemment possibles : nous +-pouvons ne pas encaisser le chèque immédiatement, ou bien découper votre +-paiement en deux fois. ++Ces spectacles sont à régler avant le lundi 17 décembre, pendant les ++heures de permanences du COF (tous les jours de la semaine entre 12h et ++14h, et entre 18h et 20h). Des facilités de paiement sont bien évidemment ++possibles (encaissement échelonné des chèques). + + *Mode de retrait des places* +-Au moment du paiement, une enveloppe vous sera remise, contenant les +-places pour l'Opéra de Paris, pour les premiers spectacles de la Comédie +-française, certains spectacles du Châtelet et du Théâtre de la Ville. +- +-Pour les concerts Radio France, le Théâtre des Champs-Élysées, le théâtre +-du Rond-Point, le théâtre de la Colline, le théâtre de l'Athénée, l'IRCAM, +-la Cité de la musique et le 104, le Studio-Théâtre de la Comédie +-française, les places seront nominatives et à retirer au théâtre le soir +-de la représentation au moins une demi-heure avant le début du spectacle. +- +-Pour le théâtre de l'Odéon, la salle Richelieu le théâtre du Vieux +-colombier de la Comédie française, certains spectacles du théâtre de la +-Ville et du théâtre de Châtelet ainsi que pour le théâtre de Chaillot, les +-places seront distribuées environ une semaine avant la représentation (un +-mail vous en avertira). +- +-Nous vous rappelons que l'obtention de places du BdA vous engage à +-respecter les règles de fonctionnement : +-http://www.cof.ens.fr/bda/?page_id=1370 +-Le système de revente des places via les mails BdA-revente sera très +-prochainement disponible, directement sur votre compte GestioCOF. ++Pour l'Opéra de Paris, le théâtre de la Colline et le théâtre du Châtelet, ++les places sont à retirer au COF le jour du paiement. ++ ++Pour les concerts Radio France, le théâtre des Champs-Élysées, l'IRCAM ++et le 104, les places seront nominatives et à retirer à la salle le soir de ++la représentation au moins une demi-heure avant le début du spectacle. ++ ++Pour le théâtre de l'Odéon, la Comédie Française, le théâtre de la Ville, ++le théâtre de Chaillot, les places seront distribuées dans vos ++casiers environ une semaine avant la représentation (un mail vous en ++avertira). ++ ++Dans tous les cas, n'hésitez pas à nous contacter si vous avez un doute ! ++ ++Nous profitons aussi de ce message pour vous annoncer qu'un festival de ++courts métrages aura lieu le 21 décembre dans l'école. ++Plus d'informations : http://www.cof.ens.fr/bda/courts. ++ ++Culturellement vôtre, + +-En vous souhaitant de très beaux spectacles tout au long de l'année, + -- +-Le Bureau des Arts +-(Chloé, Emilie, Jaime, Maxime, Olivier) +-""" ++Le BdA""" + attribs_text = "" + name = member.user.get_full_name() + for attrib in attribs: + attribs_text += u"- 1 place pour %s\n" % attrib + mail = mail % (name, attribs_text) +- send_mail ("Résultats du tirage au sort", mail, +- "bda@ens.fr", [member.user.email], ++ send_mail ("Places de spectacle (BdA du COF)", mail, ++ "bda@clipper.ens.fr", [member.user.email], + fail_silently = True) + count = len(queryset.all()) + if count == 1: +@@ -154,13 +142,7 @@ class ChoixSpectacleAdmin(admin.ModelAdm + list_filter = ("double", "autoquit") + search_fields = ('participant__user__username', 'participant__user__first_name', 'participant__user__last_name') + +-class SpectacleAdmin(admin.ModelAdmin): +- model = Spectacle +- list_display = ("title", "date", "location", "slots", "price") +- list_filter = ("location",) +- search_fields = ("title", "location__name") +- +-admin.site.register(Spectacle, SpectacleAdmin) ++admin.site.register(Spectacle) + admin.site.register(Salle) + admin.site.register(Participant, ParticipantAdmin) + admin.site.register(Attribution, AttributionAdmin) +diff -p -u -r ../bda/algorithm.py ./algorithm.py +--- ../bda/algorithm.py 2013-10-07 14:08:44.000000000 +0200 ++++ ./algorithm.py 2012-10-31 23:01:48.000000000 +0100 +@@ -29,24 +29,25 @@ class Algorithm(object): + self.ranks = {} + self.origranks = {} + self.choices = {} +- next_rank = {} +- member_shows = {} + for member in members: +- self.ranks[member] = {} +- self.choices[member] = {} +- next_rank[member] = 1 +- member_shows[member] = {} +- for choice in choices: +- member = choice.participant +- if choice.spectacle in member_shows[member]: continue +- else: member_shows[member][choice.spectacle] = True +- showdict[choice.spectacle].requests.append(member) +- showdict[choice.spectacle].nrequests += 2 if choice.double else 1 +- self.ranks[member][choice.spectacle] = next_rank[member] +- next_rank[member] += 2 if choice.double else 1 +- self.choices[member][choice.spectacle] = choice +- for member in members: +- self.origranks[member] = dict(self.ranks[member]) ++ ranks = {} ++ member_choices = {} ++ member_shows = {} ++ #next_priority = 1 ++ next_rank = 1 ++ for choice in member.choixspectacle_set.order_by('priority').all(): ++ if choice.spectacle in member_shows: continue ++ else: member_shows[choice.spectacle] = True ++ #assert choice.priority == next_priority ++ #next_priority += 1 ++ showdict[choice.spectacle].requests.append(member) ++ showdict[choice.spectacle].nrequests += 2 if choice.double else 1 ++ ranks[choice.spectacle] = next_rank ++ next_rank += 2 if choice.double else 1 ++ member_choices[choice.spectacle] = choice ++ self.ranks[member] = ranks ++ self.choices[member] = member_choices ++ self.origranks[member] = dict(ranks) + + def IncrementRanks(self, member, currank, increment = 1): + for show in self.ranks[member]: +Only in ../bda: algorithm.pyc +Only in .: difftobda +diff -p -u -r ../bda/models.py ./models.py +--- ../bda/models.py 2013-10-10 10:44:43.000000000 +0200 ++++ ./models.py 2012-10-31 23:12:56.000000000 +0100 +@@ -1,7 +1,5 @@ + # coding: utf-8 + +-import calendar +- + from django.db import models + from django.contrib.auth.models import User + from django.utils.translation import ugettext_lazy as _ +@@ -19,7 +17,7 @@ class Spectacle (models.Model): + date = models.DateTimeField ("Date & heure") + location = models.ForeignKey(Salle) + description = models.TextField ("Description", blank = True) +- slots_description = models.TextField ("Description des places", blank = True) ++ #slots_description = models.TextField ("Description des places", blank = True) + price = models.FloatField("Prix d'une place", blank = True) + slots = models.IntegerField ("Places") + priority = models.IntegerField ("Priorité", default = 1000) +@@ -31,14 +29,11 @@ class Spectacle (models.Model): + def __repr__ (self): + return u"[%s]" % self.__unicode__() + +- def timestamp(self): +- return "%d" % calendar.timegm(self.date.utctimetuple()) +- + def date_no_seconds(self): + return self.date.strftime('%d %b %Y %H:%M') + + def __unicode__ (self): +- return u"%s - %s, %s, %.02f€" % (self.title, self.date_no_seconds(), self.location, self.price) ++ return u"%s - %s @ %s, %.02f€" % (self.title, self.date_no_seconds(), self.location, self.price) + + PAYMENT_TYPES = ( + ("cash",u"Cash"), +@@ -48,7 +43,7 @@ PAYMENT_TYPES = ( + ) + + class Participant (models.Model): +- user = models.ForeignKey(User, unique = True) ++ user = models.ForeignKey(User, unique = True, related_name = "participants2") + choices = models.ManyToManyField(Spectacle, through = "ChoixSpectacle", related_name = "chosen_by") + attributions = models.ManyToManyField(Spectacle, through = "Attribution", related_name = "attributed_to") + paid = models.BooleanField (u"A payé", default = False) +Binary files ../bda/models.pyc and ./models.pyc differ +diff -p -u -r ../bda/views.py ./views.py +--- ../bda/views.py 2014-01-04 21:37:15.000000000 +0100 ++++ ./views.py 2013-02-12 22:03:38.000000000 +0100 +@@ -1,23 +1,19 @@ + # coding: utf-8 + +-from django.contrib.auth.models import User + from django.shortcuts import render, get_object_or_404 + from django.contrib.auth.decorators import login_required + from django.db import models + from django.http import Http404 + from django import forms + from django.forms.models import inlineformset_factory, BaseInlineFormSet +-from django.core import serializers +-import hashlib + + from django.core.mail import send_mail + +-from datetime import datetime + import time + + from gestioncof.decorators import cof_required, buro_required +-from bda.models import Spectacle, Participant, ChoixSpectacle, Attribution +-from bda.algorithm import Algorithm ++from bda3.models import Spectacle, Participant, ChoixSpectacle, Attribution ++from bda3.algorithm import Algorithm + + class BaseBdaFormSet(BaseInlineFormSet): + def clean(self): +@@ -37,7 +33,7 @@ class BaseBdaFormSet(BaseInlineFormSet): + raise forms.ValidationError("Vous ne pouvez pas vous inscrire deux fois pour le même spectacle.") + spectacles.append(spectacle) + +-@cof_required ++@buro_required + def etat_places(request): + spectacles1 = ChoixSpectacle.objects.all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) + spectacles2 = ChoixSpectacle.objects.filter(double = True).all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) +@@ -46,93 +42,47 @@ def etat_places(request): + total = 0 + for spectacle in spectacles: + spectacle.total = 0 +- spectacle.ratio = -1.0 + spectacles_dict[spectacle.id] = spectacle + for spectacle in spectacles1: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] +- spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + for spectacle in spectacles2: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] +- spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + return render(request, "etat-places.html", {"spectacles": spectacles, "total": total}) + +-def _hash_queryset(queryset): +- data = serializers.serialize("json", queryset) +- hasher = hashlib.sha256() +- hasher.update(data) +- return hasher.hexdigest() +- +-@cof_required +-def places(request): +- participant, created = Participant.objects.get_or_create(user = request.user) +- places = participant.attribution_set.order_by("spectacle__date", "spectacle").all() +- total = sum([place.spectacle.price for place in places]) +- filtered_places = [] +- places_dict = {} +- spectacles = [] +- dates = [] +- warning = False +- for place in places: +- if place.spectacle in spectacles: +- places_dict[place.spectacle].double = True +- else: +- place.double = False +- places_dict[place.spectacle] = place +- spectacles.append(place.spectacle) +- filtered_places.append(place) +- date = place.spectacle.date.date() +- if date in dates: +- warning = True +- else: +- dates.append(date) +- return render(request, "resume_places.html", +- {"participant": participant, +- "places": filtered_places, +- "total": total, +- "warning": warning}) +- + @cof_required + def inscription(request): +- if datetime.now() > datetime(2013, 10, 6, 23, 59): +- participant, created = Participant.objects.get_or_create(user = request.user) +- choices = participant.choixspectacle_set.order_by("priority").all() +- return render(request, "resume_inscription.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort le 7 octobre !", "choices": choices}) ++ if time.time() > 1354921200: ++ return render(request, "error.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort le 6 octobre dans la soirée "}) + BdaFormSet = inlineformset_factory(Participant, ChoixSpectacle, fields = ("spectacle","double","autoquit","priority",), formset = BaseBdaFormSet) + participant, created = Participant.objects.get_or_create(user = request.user) + success = False +- stateerror = False + if request.method == "POST": +- dbstate = _hash_queryset(participant.choixspectacle_set.all()) +- if "dbstate" in request.POST and dbstate != request.POST["dbstate"]: +- stateerror = True ++ formset = BdaFormSet(request.POST, instance = participant) ++ if formset.is_valid(): ++ #ChoixSpectacle.objects.filter(participant = participant).delete() ++ formset.save() ++ success = True + formset = BdaFormSet(instance = participant) +- else: +- formset = BdaFormSet(request.POST, instance = participant) +- if formset.is_valid(): +- #ChoixSpectacle.objects.filter(participant = participant).delete() +- formset.save() +- success = True +- formset = BdaFormSet(instance = participant) + else: + formset = BdaFormSet(instance = participant) +- dbstate = _hash_queryset(participant.choixspectacle_set.all()) + total_price = 0 + for choice in participant.choixspectacle_set.all(): + total_price += choice.spectacle.price + if choice.double: total_price += choice.spectacle.price +- return render(request, "inscription-bda.html", {"formset": formset, "success": success, "total_price": total_price, "dbstate": dbstate, "stateerror": stateerror}) ++ return render(request, "inscription-bda.html", {"formset": formset, "success": success, "total_price": total_price}) ++ ++Spectacle.deficit = lambda x: (x.slots-x.nrequests)*x.price + + def do_tirage(request): + form = TokenForm(request.POST) + if not form.is_valid(): + return tirage(request) +- start = time.time() + data = {} +- shows = Spectacle.objects.select_related().all() ++ shows = Spectacle.objects.all() + members = Participant.objects.all() +- choices = ChoixSpectacle.objects.order_by('participant', 'priority').select_related().all() ++ choices = ChoixSpectacle.objects.all() + algo = Algorithm(shows, members, choices) + results = algo(form.cleaned_data["token"]) + total_slots = 0 +@@ -149,8 +99,8 @@ def do_tirage(request): + total_sold = 0 + total_deficit = 0 + opera_deficit = 0 +- for (show, members, _) in results: +- deficit = (show.slots - len(members)) * show.price ++ for show in shows: ++ deficit = show.deficit() + total_sold += show.slots * show.price + if deficit >= 0: + if u"Opéra" in show.location.name: +@@ -159,23 +109,18 @@ def do_tirage(request): + data["total_sold"] = total_sold - total_deficit + data["total_deficit"] = total_deficit + data["opera_deficit"] = opera_deficit +- data["duration"] = time.time() - start + if request.user.is_authenticated(): + members2 = {} +- members_uniq = {} # Participant objects are not shared accross spectacle results, +- # So assign a single object for each Participant id + for (show, members, _) in results: + for (member, _, _, _) in members: +- if member.id not in members_uniq: +- members_uniq[member.id] = member ++ if member not in members2: + members2[member] = [] + member.total = 0 +- member = members_uniq[member.id] + members2[member].append(show) + member.total += show.price + members2 = members2.items() + data["members2"] = sorted(members2, key = lambda m: m[0].user.last_name) +- if False and request.user.username in ["seguin", "harazi"]: ++ if False and request.user.username == "seguin": + Attribution.objects.all().delete() + for (show, members, _) in results: + for (member, _, _, _) in members: +@@ -220,7 +165,7 @@ Je souhaite revendre %s pour %s le %s (% + Contactez moi par email si vous êtes intéressés ! + + %s (%s)""" % (places, spectacle.title, spectacle.date_no_seconds(), spectacle.location, spectacle.price, request.user.get_full_name(), request.user.email) +- send_mail("%s" % spectacle, mail, ++ send_mail("Revente de place: %s" % spectacle, mail, + request.user.email, ["bda-revente@lists.ens.fr"], + fail_silently = True) + return render(request, "bda-success.html", {"show": spectacle, "places": places}) +Only in .: views.py~ diff --git a/bda3/models.py b/bda3/models.py new file mode 100644 index 00000000..80153233 --- /dev/null +++ b/bda3/models.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +import calendar + +from django.db import models +from django.contrib.auth.models import User +from django.utils.translation import ugettext_lazy as _ +from django.db.models.signals import post_save + +class Salle (models.Model): + name = models.CharField ("Nom", max_length = 300) + address = models.TextField ("Adresse") + + def __unicode__ (self): + return self.name + +class Spectacle (models.Model): + title = models.CharField ("Titre", max_length = 300) + date = models.DateTimeField ("Date & heure") + location = models.ForeignKey(Salle) + description = models.TextField ("Description", blank = True) + slots_description = models.TextField ("Description des places", blank = True) + price = models.FloatField("Prix d'une place", blank = True) + slots = models.IntegerField ("Places") + priority = models.IntegerField ("Priorité", default = 1000) + + class Meta: + verbose_name = "Spectacle" + ordering = ("priority", "date","title",) + + def __repr__ (self): + return u"[%s]" % self.__unicode__() + + def timestamp(self): + return "%d" % calendar.timegm(self.date.utctimetuple()) + + def date_no_seconds(self): + return self.date.strftime('%d %b %Y %H:%M') + + def __unicode__ (self): + return u"%s - %s, %s, %.02f€" % (self.title, self.date_no_seconds(), self.location, self.price) + +PAYMENT_TYPES = ( +("cash",u"Cash"), +("cb","CB"), +("cheque",u"Chèque"), +("autre",u"Autre"), +) + +class Participant (models.Model): + user = models.ForeignKey(User, unique = True, related_name = "participants3") + choices = models.ManyToManyField(Spectacle, through = "ChoixSpectacle", related_name = "chosen_by") + attributions = models.ManyToManyField(Spectacle, through = "Attribution", related_name = "attributed_to") + paid = models.BooleanField (u"A payé", default = False) + paymenttype = models.CharField(u"Moyen de paiement", max_length = 6, choices = PAYMENT_TYPES, blank = True) + + def __unicode__ (self): + return u"%s" % (self.user) + +class ChoixSpectacle (models.Model): + participant = models.ForeignKey(Participant) + spectacle = models.ForeignKey(Spectacle, related_name = "participants") + priority = models.PositiveIntegerField("Priorité") + double = models.BooleanField("Deux places1",default=False) + autoquit = models.BooleanField("Abandon2",default=False) + class Meta: + ordering = ("priority",) + unique_together = (("participant", "spectacle",),) + verbose_name = "voeu" + verbose_name_plural = "voeux" + +class Attribution (models.Model): + participant = models.ForeignKey(Participant) + spectacle = models.ForeignKey(Spectacle, related_name = "attribues") + given = models.BooleanField(u"Donnée", default = False) + + def __unicode__ (self): + return u"%s -- %s" % (self.participant, self.spectacle) diff --git a/bda3/tests.py b/bda3/tests.py new file mode 100644 index 00000000..501deb77 --- /dev/null +++ b/bda3/tests.py @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase + + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) diff --git a/bda3/views.py b/bda3/views.py new file mode 100644 index 00000000..620f1824 --- /dev/null +++ b/bda3/views.py @@ -0,0 +1,249 @@ + +# coding: utf-8 + +from django.contrib.auth.models import User +from django.shortcuts import render, get_object_or_404 +from django.contrib.auth.decorators import login_required +from django.db import models +from django.http import Http404 +from django import forms +from django.forms.models import inlineformset_factory, BaseInlineFormSet +from django.core import serializers +import hashlib + +from django.core.mail import send_mail + +from datetime import datetime +import time + +from gestioncof.decorators import cof_required, buro_required +from bda3.models import Spectacle, Participant, ChoixSpectacle, Attribution +from bda3.algorithm import Algorithm + +class BaseBdaFormSet(BaseInlineFormSet): + def clean(self): + """Checks that no two articles have the same title.""" + super(BaseBdaFormSet, self).clean() + if any(self.errors): + # Don't bother validating the formset unless each form is valid on its own + return + spectacles = [] + for i in range(0, self.total_form_count()): + form = self.forms[i] + if not form.cleaned_data: + continue + spectacle = form.cleaned_data['spectacle'] + delete = form.cleaned_data['DELETE'] + if not delete and spectacle in spectacles: + raise forms.ValidationError("Vous ne pouvez pas vous inscrire deux fois pour le même spectacle.") + spectacles.append(spectacle) + +@cof_required +def etat_places(request): + spectacles1 = ChoixSpectacle.objects.all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) + spectacles2 = ChoixSpectacle.objects.filter(double = True).all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle')) + spectacles = Spectacle.objects.all() + spectacles_dict = {} + total = 0 + for spectacle in spectacles: + spectacle.total = 0 + spectacle.ratio = -1.0 + spectacles_dict[spectacle.id] = spectacle + for spectacle in spectacles1: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] + spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + for spectacle in spectacles2: + spectacles_dict[spectacle["spectacle"]].total += spectacle["total"] + spectacles_dict[spectacle["spectacle"]].ratio = spectacles_dict[spectacle["spectacle"]].total/float(spectacles_dict[spectacle["spectacle"]].slots) + total += spectacle["total"] + return render(request, "etat-places.html", {"spectacles": spectacles, "total": total}) + +def _hash_queryset(queryset): + data = serializers.serialize("json", queryset) + hasher = hashlib.sha256() + hasher.update(data) + return hasher.hexdigest() + +@cof_required +def places(request): + participant, created = Participant.objects.get_or_create(user = request.user) + places = participant.attribution_set.order_by("spectacle__date", "spectacle").all() + total = sum([place.spectacle.price for place in places]) + filtered_places = [] + places_dict = {} + spectacles = [] + dates = [] + warning = False + for place in places: + if place.spectacle in spectacles: + places_dict[place.spectacle].double = True + else: + place.double = False + places_dict[place.spectacle] = place + spectacles.append(place.spectacle) + filtered_places.append(place) + date = place.spectacle.date.date() + if date in dates: + warning = True + else: + dates.append(date) + return render(request, "resume_places.html", + {"participant": participant, + "places": filtered_places, + "total": total, + "warning": warning}) + +@cof_required +def inscription(request): + if datetime.now() > datetime(2016, 4, 10, 11, 59): + participant, created = Participant.objects.get_or_create(user = request.user) + choices = participant.choixspectacle_set.order_by("priority").all() + return render(request, "resume_inscription.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort très bientôt !", "choices": choices}) + BdaFormSet = inlineformset_factory(Participant, ChoixSpectacle, fields = ("spectacle","double","autoquit","priority",), formset = BaseBdaFormSet) + participant, created = Participant.objects.get_or_create(user = request.user) + success = False + stateerror = False + if request.method == "POST": + dbstate = _hash_queryset(participant.choixspectacle_set.all()) + if "dbstate" in request.POST and dbstate != request.POST["dbstate"]: + stateerror = True + formset = BdaFormSet(instance = participant) + else: + formset = BdaFormSet(request.POST, instance = participant) + if formset.is_valid(): + #ChoixSpectacle.objects.filter(participant = participant).delete() + formset.save() + success = True + formset = BdaFormSet(instance = participant) + else: + formset = BdaFormSet(instance = participant) + dbstate = _hash_queryset(participant.choixspectacle_set.all()) + total_price = 0 + for choice in participant.choixspectacle_set.all(): + total_price += choice.spectacle.price + if choice.double: total_price += choice.spectacle.price + return render(request, "inscription-bda3.html", {"formset": formset, "success": success, "total_price": total_price, "dbstate": dbstate, "stateerror": stateerror}) + +def do_tirage(request): + form = TokenForm(request.POST) + if not form.is_valid(): + return tirage(request) + start = time.time() + data = {} + shows = Spectacle.objects.select_related().all() + members = Participant.objects.all() + choices = ChoixSpectacle.objects.order_by('participant', 'priority').select_related().all() + algo = Algorithm(shows, members, choices) + results = algo(form.cleaned_data["token"]) + total_slots = 0 + total_losers = 0 + for (_, members, losers) in results: + total_slots += len(members) + total_losers += len(losers) + data["total_slots"] = total_slots + data["total_losers"] = total_losers + data["shows"] = shows + data["token"] = form.cleaned_data["token"] + data["members"] = members + data["results"] = results + total_sold = 0 + total_deficit = 0 + opera_deficit = 0 + for (show, members, _) in results: + deficit = (show.slots - len(members)) * show.price + total_sold += show.slots * show.price + if deficit >= 0: + if u"Opéra" in show.location.name: + opera_deficit += deficit + total_deficit += deficit + data["total_sold"] = total_sold - total_deficit + data["total_deficit"] = total_deficit + data["opera_deficit"] = opera_deficit + data["duration"] = time.time() - start + if request.user.is_authenticated(): + members2 = {} + members_uniq = {} # Participant objects are not shared accross spectacle results, + # So assign a single object for each Participant id + for (show, members, _) in results: + for (member, _, _, _) in members: + if member.id not in members_uniq: + members_uniq[member.id] = member + members2[member] = [] + member.total = 0 + member = members_uniq[member.id] + members2[member].append(show) + member.total += show.price + members2 = members2.items() + data["members2"] = sorted(members2, key = lambda m: m[0].user.last_name) + if False and request.user.username in ["seguin", "harazi", "fromherz", "mpepin"]: + Attribution.objects.all().delete() + for (show, members, _) in results: + for (member, _, _, _) in members: + attrib = Attribution(spectacle = show, participant = member) + attrib.save() + return render(request, "bda-attrib-extra.html", data) + else: + return render(request, "bda-attrib.html", data) + +class TokenForm(forms.Form): + token = forms.CharField(widget = forms.widgets.Textarea()) + +@login_required +def tirage(request): + if request.POST: + form = TokenForm(request.POST) + if form.is_valid(): + return do_tirage(request) + else: + form = TokenForm() + return render(request, "bda-token.html", {"form": form}) + +class SpectacleModelChoiceField(forms.ModelChoiceField): + def label_from_instance(self, obj): + return u"%s le %s (%s) à %.02f€" % (obj.title, obj.date_no_seconds(), obj.location, obj.price) + +class ResellForm(forms.Form): + count = forms.ChoiceField(choices = (("1","1"),("2","2"),)) + spectacle = SpectacleModelChoiceField(queryset = Spectacle.objects.none()) + + def __init__(self, participant, *args, **kwargs): + super(ResellForm, self).__init__(*args, **kwargs) + self.fields['spectacle'].queryset = participant.attributions.all().distinct() + +def do_resell(request, form): + spectacle = form.cleaned_data["spectacle"] + count = form.cleaned_data["count"] + places = "2 places" if count == "2" else "une place" + mail = u"""Bonjour, + +Je souhaite revendre %s pour %s le %s (%s) à %.02f€. +Contactez moi par email si vous êtes intéressés ! + +%s (%s)""" % (places, spectacle.title, spectacle.date_no_seconds(), spectacle.location, spectacle.price, request.user.get_full_name(), request.user.email) + send_mail("%s" % spectacle, mail, + request.user.email, ["bda-revente@lists.ens.fr"], + fail_silently = True) + return render(request, "bda-success.html", {"show": spectacle, "places": places}) + +@login_required +def revente(request): + participant, created = Participant.objects.get_or_create(user = request.user) + if not participant.paid: + return render(request, "bda-notpaid.html", {}) + if request.POST: + form = ResellForm(participant, request.POST) + if form.is_valid(): + return do_resell(request, form) + else: + form = ResellForm(participant) + return render(request, "bda-revente.html", {"form": form}) + +@buro_required +def spectacle(request, spectacle_id): + spectacle = get_object_or_404(Spectacle, id = spectacle_id) + return render(request, "bda-emails.html", {"spectacle": spectacle}) + +@buro_required +def unpaid(request): + return render(request, "bda-unpaid.html", {"unpaid": Participant.objects.filter(paid = False).all()}) diff --git a/cof/__init__.py b/cof/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cof/urls.py b/cof/urls.py new file mode 100644 index 00000000..991fb72f --- /dev/null +++ b/cof/urls.py @@ -0,0 +1,86 @@ +from django.conf.urls import patterns, include, url + +import autocomplete_light +autocomplete_light.autodiscover() + +from django.contrib import admin +admin.autodiscover() + +from django.views.generic.list import ListView +from django.views.generic.base import TemplateView +from bda.models import Spectacle +from bda2.models import Spectacle as Spectacle2 +from bda3.models import Spectacle as Spectacle3 +from gestioncof.petits_cours_views import DemandeListView + +urlpatterns = patterns('', + url(r'^$', 'gestioncof.views.home', name = 'home'), + url(r'^cof/denied$', TemplateView.as_view(template_name = 'cof-denied.html'), name = "cof-denied"), + url(r'^cas/login$', 'django_cas.views.login', name = "cas_login_view"), + url(r'^cas/logout$', 'django_cas.views.logout'), + url(r'^outsider/login$', 'gestioncof.views.login_ext'), + url(r'^outsider/logout$', 'django.contrib.auth.views.logout', {'next_page': '/gestion/'}), + url(r'^outsider/password-change$', 'django.contrib.auth.views.password_change'), + url(r'^outsider/password-change-done$', 'django.contrib.auth.views.password_change_done'), + url(r'^login$', 'gestioncof.views.login'), + url(r'^logout$', 'gestioncof.views.logout'), + url(r'^profile$', 'gestioncof.views.profile'), + url(r'^export/members$', 'gestioncof.views.export_members'), + url(r'^export/mega/avecremarques$', 'gestioncof.views.export_mega_remarksonly'), + url(r'^export/mega/participants$', 'gestioncof.views.export_mega_participants'), + url(r'^export/mega/orgas$', 'gestioncof.views.export_mega_orgas'), + url(r'^export/mega/(?P.+)$', 'gestioncof.views.export_mega_bytype'), + url(r'^export/mega$', 'gestioncof.views.export_mega'), + url(r'^registration$', 'gestioncof.views.registration'), + url(r'^registration/clipper/(?P[\w-]+)$', 'gestioncof.views.registration_form2', name = "clipper-registration"), + url(r'^registration/user/(?P.+)$', 'gestioncof.views.registration_form2', name = "user-registration"), + url(r'^registration/empty$', 'gestioncof.views.registration_form2', name = "empty-registration"), + url(r'^petitcours/inscription$', 'gestioncof.petits_cours_views.inscription', name = 'petits-cours-inscription'), + url(r'^petitcours/demande$', 'gestioncof.petits_cours_views.demande', name = 'petits-cours-demande'), + url(r'^petitcours/demande-raw$', 'gestioncof.petits_cours_views.demande_raw', name = 'petits-cours-demande-raw'), + url(r'^petitcours/demandes$', DemandeListView.as_view(), name = 'petits-cours-demandes-list'), + url(r'^petitcours/demandes/(?P\d+)$', 'gestioncof.petits_cours_views.details', name = 'petits-cours-demande-details'), + url(r'^petitcours/demandes/(?P\d+)/traitement$', 'gestioncof.petits_cours_views.traitement', name = 'petits-cours-demande-traitement'), + url(r'^petitcours/demandes/(?P\d+)/retraitement$', 'gestioncof.petits_cours_views.retraitement', name = 'petits-cours-demande-retraitement'), + url(r'^bda/inscription$', 'bda.views.inscription', name = 'bda-tirage-inscription'), + url(r'^bda2/inscription$', 'bda2.views.inscription', name = 'bda2-tirage-inscription'), + url(r'^bda3/inscription$', 'bda3.views.inscription', name = 'bda3-tirage-inscription'), + url(r'^bda/places$', 'bda.views.places', name = "bda-places-attribuees"), + url(r'^bda/places/places_bda.ics$', 'bda.views.places_ics', name = "bda-places-attribuees-ics"), + url(r'^bda2/places$', 'bda2.views.places', name = "bda2-places-attribuees"), + url(r'^bda3/places$', 'bda3.views.places', name = "bda3-places-attribuees"), + url(r'^bda/revente$', 'bda.views.revente', name = 'bda-revente'), + url(r'^bda2/revente$', 'bda2.views.revente', name = 'bda2-revente'), + url(r'^bda3/revente$', 'bda3.views.revente', name = 'bda3-revente'), + url(r'^bda/etat-places$', 'bda.views.etat_places', name = 'bda-etat-places'), + url(r'^bda2/etat-places$', 'bda2.views.etat_places', name = 'bda2-etat-places'), + url(r'^bda3/etat-places$', 'bda3.views.etat_places', name = 'bda3-etat-places'), + url(r'^bda/tirage$', 'bda.views.tirage'), + url(r'^bda2/tirage$', 'bda2.views.tirage'), + url(r'^bda3/tirage$', 'bda3.views.tirage'), + url(r'^bda/spectacles/$', ListView.as_view(model = Spectacle), name ="bda-liste-spectacles"), + url(r'^bda/spectacles/liste_spectacles.ics$', 'bda.views.liste_spectacles_ics', name ="bda-liste-spectacles-ics"), + url(r'^bda/spectacles/unpaid$', "bda.views.unpaid", name = "bda-unpaid"), + url(r'^bda/spectacles/(?P\d+)$', "bda.views.spectacle", name = "bda-spectacle"), + url(r'^bda/spectacles-2/$', ListView.as_view(model = Spectacle2), name ="bda2-liste-spectacles"), + url(r'^bda/spectacles-2/unpaid$', "bda2.views.unpaid", name = "bda2-unpaid"), + url(r'^bda/spectacles-2/(?P\d+)$', "bda2.views.spectacle", name = "bda2-spectacle"), + url(r'^bda/spectacles-3/$', ListView.as_view(model = Spectacle3), name ="bda3-liste-spectacles"), + url(r'^bda/spectacles-3/unpaid$', "bda3.views.unpaid", name = "bda3-unpaid"), + url(r'^bda/spectacles-3/(?P\d+)$', "bda3.views.spectacle", name = "bda3-spectacle"), + url(r'^survey/(?P\d+)$', 'gestioncof.views.survey'), + url(r'^event/(?P\d+)$', 'gestioncof.views.event'), + url(r'^survey/(?P\d+)/status$', 'gestioncof.views.survey_status'), + url(r'^event/(?P\d+)/status$', 'gestioncof.views.event_status'), + url(r'^autocomplete/registration$', 'gestioncof.autocomplete.autocomplete'), + url(r'^autocomplete/', include('autocomplete_light.urls')), + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^admin/(?P[\d\w]+)/(?P[\d\w]+)/csv/', 'gestioncof.csv_views.admin_list_export', {'fields': ['username',]}), + url(r'^admin/', include(admin.site.urls)), + url(r'^grappelli/', include('grappelli.urls')), + url(r'^utile_cof$', 'gestioncof.views.utile_cof'), + url(r'^utile_bda$', 'gestioncof.views.utile_bda'), + url(r'^utile_bda/bda_diff$', 'gestioncof.views.liste_bdadiff'), + url(r'^utile_cof/diff_cof$', 'gestioncof.views.liste_diffcof'), + url(r'^utile_bda/bda_revente$', 'gestioncof.views.liste_bdarevente'), +) diff --git a/gestioncof/admin.py b/gestioncof/admin.py index 0b8b534d..8540ea44 100644 --- a/gestioncof/admin.py +++ b/gestioncof/admin.py @@ -131,6 +131,7 @@ class UserProfileAdmin(UserAdmin): list_display = ('profile_num',) + UserAdmin.list_display + ('profile_login_clipper','profile_phone','profile_occupation','profile_mailing_cof','profile_mailing_bda','profile_mailing_bda_revente','is_cof','is_buro',) list_display_links = ('username','email','first_name','last_name') list_filter = UserAdmin.list_filter + ('profile__is_cof', 'profile__is_buro', 'profile__mailing_cof', 'profile__mailing_bda') + search_fields = UserAdmin.search_fields + ('profile__phone',) inlines = [ CofProfileInline, ] diff --git a/gestioncof/autocomplete.py b/gestioncof/autocomplete.py new file mode 100644 index 00000000..c431a5cc --- /dev/null +++ b/gestioncof/autocomplete.py @@ -0,0 +1,49 @@ +from django import shortcuts +from django.http import Http404 +from django.db.models import Q + +from django.contrib.auth.models import User +from gestioncof.models import CofProfile, Clipper + +def autocomplete(request): + if "q" not in request.GET: + raise Http404 + q = request.GET['q'] + data = { + 'q': q, + } + + queries = {} + bits = q.split() + + queries['members'] = CofProfile.objects.filter(Q(is_cof=True)) + queries['users'] = User.objects.filter(Q(profile__is_cof=False)) + queries['clippers'] = Clipper.objects + for bit in bits: + queries['members'] = queries['members'].filter( + Q(user__first_name__icontains=bit) + |Q(user__last_name__icontains=bit) + |Q(user__username__icontains=bit) + |Q(login_clipper__icontains=bit)) + queries['users'] = queries['users'].filter( + Q(first_name__icontains=bit) + |Q(last_name__icontains=bit) + |Q(username__icontains=bit)) + queries['clippers'] = queries['clippers'].filter( + Q(fullname__icontains=bit) + |Q(username__icontains=bit)) + queries['members'] = queries['members'].distinct() + queries['users'] = queries['users'].distinct() + usernames = list(queries['members'].values_list('login_clipper', flat = 'True')) \ + + list(queries['users'].values_list('profile__login_clipper', flat = 'True')) + queries['clippers'] = queries['clippers'].exclude(username__in = usernames).distinct() + # add clippers + + data.update(queries) + + options = 0 + for query in queries.values(): + options += len(query) + data['options'] = options + + return shortcuts.render(request, "autocomplete_user.html", data) diff --git a/gestioncof/autocomplete_light_registry.py b/gestioncof/autocomplete_light_registry.py new file mode 100644 index 00000000..f3283f8e --- /dev/null +++ b/gestioncof/autocomplete_light_registry.py @@ -0,0 +1,6 @@ +import autocomplete_light + +from django.contrib.auth.models import User + +autocomplete_light.register(User, search_fields=('username','first_name','last_name'), + autocomplete_js_attributes={'placeholder': 'membre...'}) diff --git a/gestioncof/csv_views.py b/gestioncof/csv_views.py new file mode 100644 index 00000000..15f0b5d0 --- /dev/null +++ b/gestioncof/csv_views.py @@ -0,0 +1,70 @@ +import csv +from django.http import HttpResponse, HttpResponseForbidden +from django.template.defaultfilters import slugify +from django.db.models.loading import get_model +from django.contrib.auth.models import User + +def export(qs, fields=None): + model = qs.model + response = HttpResponse(mimetype='text/csv') + response['Content-Disposition'] = 'attachment; filename=%s.csv' % slugify(model.__name__) + writer = csv.writer(response) + # Write headers to CSV file + if fields: + headers = fields + else: + headers = [] + for field in model._meta.fields: + headers.append(field.name) + writer.writerow(headers) + # Write data to CSV file + for obj in qs: + row = [] + for field in headers: + if field in headers: + val = getattr(obj, field) + if callable(val): + val = val() + row.append(val) + writer.writerow(row) + # Return CSV file to browser as download + return response + +def admin_list_export(request, model_name, app_label, queryset=None, fields=None, list_display=True): + """ + Put the following line in your urls.py BEFORE your admin include + (r'^admin/(?P[\d\w]+)/(?P[\d\w]+)/csv/', 'util.csv_view.admin_list_export'), + """ + if not request.user.is_staff: + return HttpResponseForbidden() + if not queryset: + model = get_model(app_label, model_name) + queryset = model.objects.all() + filters = dict() + """ + for key, value in request.GET.items(): + if key not in ('ot', 'o'): + filters[str(key)] = str(value) + if len(filters): + queryset = queryset.filter(**filters) + """ + #qs2 = User.objects.filter(profile__eav__a_vot = True) + #queryset = queryset.filter(pk__in = qs2.values_list('id', flat = True)) + queryset = queryset.filter(profile__is_cof = True) + if not fields: + if list_display and len(queryset.model._meta.admin.list_display) > 1: + fields = queryset.model._meta.admin.list_display + else: + fields = None + return export(queryset, fields) + """ + Create your own change_list.html for your admin view and put something like this in it: + {% block object-tools %} + + {% endblock %} + """ diff --git a/gestioncof/petits_cours_models.py b/gestioncof/petits_cours_models.py index e9b1b856..e087b3d0 100644 --- a/gestioncof/petits_cours_models.py +++ b/gestioncof/petits_cours_models.py @@ -11,8 +11,9 @@ def choices_length (choices): LEVELS_CHOICES = ( ('college', _(u"Collège")), ('lycee', _(u"Lycée")), - ('prepa1styear', _(u"Prépa 1ère année")), - ('prepa2ndyear', _(u"Prépa 2ème année")), + ('prepa1styear', _(u"Prépa 1ère année / L1")), + ('prepa2ndyear', _(u"Prépa 2ème année / L2")), + ('licence3', _(u"Licence 3")), ('other', _(u"Autre (préciser dans les commentaires)")), ) diff --git a/gestioncof/unicodecsv.py b/gestioncof/unicodecsv.py new file mode 100644 index 00000000..caa51521 --- /dev/null +++ b/gestioncof/unicodecsv.py @@ -0,0 +1,60 @@ +import csv, codecs, cStringIO + +class UTF8Recoder(object): + """ + Iterator that reads an encoded stream and reencodes the input to UTF-8 + """ + def __init__(self, f, encoding): + self.reader = codecs.getreader(encoding)(f) + + def __iter__(self): + return self + + def next(self): + return self.reader.next().encode("utf-8") + +class UnicodeReader(object): + """ + A CSV reader which will iterate over lines in the CSV file "f", + which is encoded in the given encoding. + """ + + def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds): + f = UTF8Recoder(f, encoding) + self.reader = csv.reader(f, dialect=dialect, **kwds) + + def next(self): + row = self.reader.next() + return [unicode(s, "utf-8") for s in row] + + def __iter__(self): + return self + +class UnicodeWriter(object): + """ + A CSV writer which will write rows to CSV file "f", + which is encoded in the given encoding. + """ + + def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds): + # Redirect output to a queue + self.queue = cStringIO.StringIO() + self.writer = csv.writer(self.queue, dialect=dialect, **kwds) + self.stream = f + self.encoder = codecs.getincrementalencoder(encoding)() + + def writerow(self, row): + self.writer.writerow([s.encode("utf-8") for s in row]) + # Fetch UTF-8 output from the queue ... + data = self.queue.getvalue() + data = data.decode("utf-8") + # ... and reencode it into the target encoding + data = self.encoder.encode(data) + # write to the target stream + self.stream.write(data) + # empty queue + self.queue.truncate(0) + + def writerows(self, rows): + for row in rows: + self.writerow(row) diff --git a/gestioncof/views.py b/gestioncof/views.py index 1bd15563..bac9e574 100644 --- a/gestioncof/views.py +++ b/gestioncof/views.py @@ -343,15 +343,13 @@ def event_status(request, event_id): user_choices = registrations_query.prefetch_related("user").all() options = EventOption.objects.filter(event = event).all() choices_count = {} - total = 0 for option in options: for choice in option.choices.all(): choices_count[choice.id] = 0 for user_choice in user_choices: for choice in user_choice.options.all(): choices_count[choice.id] += 1 - total += 1 - return render(request, "event_status.html", {"event": event, "user_choices": user_choices, "options": options, "choices_count": choices_count, "form": form, "total": total}) + return render(request, "event_status.html", {"event": event, "user_choices": user_choices, "options": options, "choices_count": choices_count, "form": form}) @buro_required def survey_status(request, survey_id): @@ -707,6 +705,7 @@ def export_members(request): return response +@buro_required def csv_export_mega(filename, qs): response = HttpResponse(mimetype = 'text/csv') response['Content-Disposition'] = 'attachment; filename=' + filename @@ -764,6 +763,7 @@ def export_mega_orgas(request): qs = EventRegistration.objects.filter(event = event).exclude(options__id__in = (participant_type_a, participant_type_b)) return csv_export_mega('orgas_mega_15.csv', qs) +@buro_required def export_mega_participants(request): event = Event.objects.get(title = "Mega 15") type_option = event.options.get(name = "Type") @@ -785,3 +785,22 @@ def utile_cof(request): @buro_required def utile_bda(request): return render(request, "utile_bda.html", {}) + +@buro_required +def liste_bdadiff(request): + titre = "BdA diffusion" + personnes = CofProfile.objects.filter(mailing_bda = True, is_cof = True).all() + return render(request, "liste_mails.html", {"titre": titre, "personnes": personnes}) + +@buro_required +def liste_bdarevente(request): + titre = "BdA revente" + personnes = CofProfile.objects.filter(mailing_bda_revente = True, is_cof = True).all() + return render(request, "liste_mails.html", {"titre": titre, "personnes": personnes}) + +@buro_required +def liste_diffcof(request): + titre = "Diffusion COF" + personnes = CofProfile.objects.filter(mailing_cof = True, is_cof = True).all() + return render(request, "liste_mails.html", {"titre": titre, "personnes": personnes}) + diff --git a/mails_adherents.sh b/mails_adherents.sh new file mode 100755 index 00000000..064f39e9 --- /dev/null +++ b/mails_adherents.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Lecture de la base +request="SELECT email, username FROM auth_user LEFT JOIN gestioncof_cofprofile ON auth_user.id = gestioncof_cofprofile.user_id WHERE mailing_cof=1 AND is_cof = 1;" +echo $request | python manage.py dbshell | \ + +# Suppression de l'en-tête +tail -n +2 | \ + +# Suppression des adhérents sans adresse mail +grep -v -P "^\t" + diff --git a/media/bda.css b/media/bda.css new file mode 100644 index 00000000..8851eeee --- /dev/null +++ b/media/bda.css @@ -0,0 +1,10 @@ +form#tokenform {text-align: center; font-size: 2em;} +label {margin-right: 10px; vertical-align: top;} +form#tokenform textarea {font-size: 2em; width: 350px; height: 200px; font-family: 'Droif Serif', serif;} +input {width: 400px; font-size: 2em;} +ul.losers {display: inline; margin: 0; padding: 0;} +ul.losers li {display: inline;} +span.details {font-size: 0.7em;} +table {border: 1px solid black; border-collapse: collapse;} +td {border: 1px solid black; padding: 2px;} +.attribresult {margin: 10px 0px;} diff --git a/media/js/joequery-Stupid-Table-Plugin/LICENSE b/media/js/joequery-Stupid-Table-Plugin/LICENSE new file mode 100644 index 00000000..5b0030d8 --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Joseph McCullough + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/media/js/joequery-Stupid-Table-Plugin/README.md b/media/js/joequery-Stupid-Table-Plugin/README.md new file mode 100644 index 00000000..1a829d7b --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/README.md @@ -0,0 +1,166 @@ +Stupid jQuery Table Sort +======================== + +This is a stupid jQuery table sorting plugin. Nothing fancy, nothing really +impressive. Overall, stupidly simple. + +[View the demo here][0] + +See the example.html document to see how to implement it. + + +Example Usage +------------- + +The JS: + + $("table").stupidtable(); + +The HTML: + + + + + + + + + + + + + + + + ... + ... + ... + +The thead and tbody tags must be used. + +Add a `data-sort` attribute of "DATATYPE" to the th elements to make them sortable +by that data type. If you don't want that column to be sortable, just omit the +`data-sort` attribute. + + +Predefined data types +--------------------- + +Our aim is to keep this plugin as lightweight as possible. Consequently, the +only predefined datatypes that you can pass to the th elements are + +* `int` +* `float` +* `string` (case-sensitive) +* `string-ins` (case-insensitive) + +These data types will be sufficient for many simple tables. However, if you need +different data types for sorting, you can easily create your own! + + +Creating your own data types +---------------------------- + +Creating your own data type for sorting purposes is easy as long as you are +comfortable using custom functions for sorting. Consult [Mozilla's Docs][1] +if you're not. + +Let's create an alphanum datatype for a User ID that takes strings in the +form "D10", "A40", and sorts them based on the number. + + + + + + + + + + + + + + + + + + + + ... + ... + ... + +Now we need to specify how the **alphanum** type will be sorted. To do that, +we do the following: + + $("table").stupidtable({ + "alphanum":function(a,b){ + + var pattern = "^[A-Z](\\d+)$"; + var re = new RegExp(pattern); + + var aNum = re.exec(a).slice(1); + var bNum = re.exec(b).slice(1); + + return parseInt(aNum,10) - parseInt(bNum,10); + } + }); + +This extracts the integers from the cell and compares them in the style +that sort functions use. + + +Callbacks +--------- + +To execute a callback function after a table column has been sorted, you can +bind on `aftertablesort`. + + var table = $("table").stupidtable(); + table.bind('aftertablesort', function (event, data) { + // data.column - the index of the column sorted after a click + // data.direction - the sorting direction (either asc or desc) + // $(this) - this table object + + console.log("The sorting direction: " + data.direction); + console.log("The column index: " + data.column); + }); + +Similarly, to execute a callback before a table column has been sorted, you can +bind on `beforetablesort`. + +See the complex_example.html file. + + +Data with multiple representations/predefined order +--------------------------------------------------- + +Often we find two distinct ways of offering data: In a machine friendly way, +and a Human-friendly way. A clear example is a Timestamp. Additionally, +arbitrary data values may already have a predefined sort order. In either case, +it's to our advantage to have a way to store the "sortable data" while letting +the viewer see the Human-friendly representation of that data. While the +purpose of the custom sort methods is to take data and make it sortable +(machine friendly), sometimes this is too hard or too expensive, computationally +speaking. + +To solve this problem, you can specify a `data-sort-value` attribute to +table cells, and the attribute value will be the basis of the sort as opposed +to the text value of the table cell. See the complex_example.html file, where +we sort a column of letters based not on their alphabetical order, but by their +frequency in the English language. You'll still need to specify a sort type +or come up with your own custom sort function, but the presence of the +`data-sort-value` attribute tells the plugin to use the value of the +attribute as the basis of the sort. + + +License +------- + +The Stupid jQuery Plugin is licensed under the MIT license. See the LICENSE +file for full details. + + + +[0]: http://joequery.github.com/Stupid-Table-Plugin/ +[1]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort diff --git a/media/js/joequery-Stupid-Table-Plugin/examples/basic.html b/media/js/joequery-Stupid-Table-Plugin/examples/basic.html new file mode 100644 index 00000000..11e43414 --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/examples/basic.html @@ -0,0 +1,77 @@ + + + + Stupid jQuery table sort + + + + + + + + + +

Stupid jQuery table sort!

+ +

This example shows how a sortable table can be implemented with very little configuration. Simply specify the data type on a <th> element using the data-sort attribute, and the plugin handles the rest.

+ +
intfloatstring
15-.18banana
NameAgeUserID
Joseph McCullough20D10
Justin Edwards29A40
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
intfloatstring
15-.18banana
9536coke
2-152.5apple
-5388.5zebra
195-858orange
+ + + diff --git a/media/js/joequery-Stupid-Table-Plugin/examples/colspan.html b/media/js/joequery-Stupid-Table-Plugin/examples/colspan.html new file mode 100644 index 00000000..ad8142a9 --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/examples/colspan.html @@ -0,0 +1,70 @@ + + + + Stupid jQuery table sort (colspan test) + + + + + + + + + +

Stupid jQuery table sort! (colspan test)

+ +

Tables using colspans are handled just fine.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Letter + colspan=2Number +
defX91
abcZ82
bcdY70
+ + + diff --git a/media/js/joequery-Stupid-Table-Plugin/examples/complex.html b/media/js/joequery-Stupid-Table-Plugin/examples/complex.html new file mode 100644 index 00000000..4c930dc1 --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/examples/complex.html @@ -0,0 +1,183 @@ + + + + Stupid jQuery table sort (complex example) + + + + + + + + +

Stupid jQuery table sort! (complex example)

+ +

This example showcases several of the more advanced features, including specifying sort values, custom data types and callbacks. View the source of this file or see the documentation for more details on how to implement them.

+ +

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
intintfloatstringcaseCan't sort me!dateLetter frequency
1515-.18bananaHomerarbitrarySep 15, 2002E
959536purplepointlessAug 07, 2004T
22-152.5issillyMar 15, 1986A
-53-5388.5helloaeccentricFeb 27, 2086O
195195-858orangefruitgarbageMar 15, 1986I
+ + + diff --git a/media/js/joequery-Stupid-Table-Plugin/examples/large-table.html b/media/js/joequery-Stupid-Table-Plugin/examples/large-table.html new file mode 100644 index 00000000..926100c1 --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/examples/large-table.html @@ -0,0 +1,5524 @@ + + + + Stupid jQuery table sort (large table example) + + + + + + + + +

Stupid jQuery table sort! (large table example)

+ +

This is a large table of over 500 rows to show the plugin can handle large data sets with ease. It includes a mix of styling to mimic a more realistic website scenario. It also provides a better example of the beforetablesort callback by styling the table to appear disabled during sorting.

+ +

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First nameLast nameCityCountryEmailRegisteredID
EmmanuelOwenNeedhamPakistanNov 18, 201117321
StewartDillardSouth PortlandItalyDec 30, 201294003
TanaVillarrealWalthamSolomon IslandsMar 25, 201244041
WendyGreerBellflowerMauritaniaMar 6, 201180251
KennethLivingstonAnaheimHondurasJun 20, 201279773
HollyStrongPlacentiaGreenlandJul 22, 201256903
LynnCooleyTemeculaPapua New GuineaApr 12, 201268541
ShafiraValdezColumbusTaiwan, Province of ChinaAug 15, 201167777
AutumnBarryMaldenSerbia and MontenegroOct 19, 201132595
HadassahBerryKetchikanEgyptMay 29, 201258898
HectorBurnsKokomoMonacoJun 22, 201244279
EaganCarrJeannetteSlovakiaMay 3, 201152817
CharissaBarkerMeadvilleNew ZealandJun 18, 201220900
AbigailHolmanDubuqueKiribatiNov 28, 201136026
CaesarCarverJordan ValleyMexicoFeb 1, 201214537
JadeJuarezBillingsZimbabweMay 12, 201240574
BarbaraShieldsSaint JosephGermanyDec 7, 201148920
RosePaceMoragaEcuadorApr 12, 201192908
NeroWilliamHutchinsonSerbia and MontenegroDec 30, 201110398
LucyMcclainSouth El MonteHoly See (Vatican City State)Jun 17, 201275898
ThorKellyJeffersonvilleLiberiaNov 11, 201159789
EdwardBarronMandanParaguayMar 13, 201174375
AaronHansenFlorenceSvalbard and Jan MayenJun 2, 201270820
MohammadMcfaddenCiceroBoliviaSep 16, 201123056
MiaMarshallColumbiaColombiaAug 21, 201252458
ChesterAlvarezSpringfieldLesothoOct 29, 201244765
KelseyDouglasWinnemuccaPitcairnApr 5, 201190683
ErinSimsLa HabraLiberiaJan 28, 201257282
ColtHarperMayagüezBangladeshJul 13, 201134013
XanthaRossLufkinUnited States Minor Outlying IslandsAug 6, 201226764
AikoGillAsbury ParkKyrgyzstanJan 15, 201245134
StaceyBarronSalemIndiaApr 3, 201216321
AuroraCraigStillwaterMoroccoAug 23, 201255429
GeoffreyKirbySonomaHeard Island and Mcdonald IslandsFeb 11, 201236110
KylynnSweeneyGilbertGreeceMar 27, 201131878
CelesteGilliamKetchikanArmeniaOct 18, 201190753
TravisBucknerHot SpringsSaint Pierre and MiquelonSep 1, 201250696
DeannaBucknerGloversvilleMongoliaMar 6, 201236838
NicholasVangNorth ChicagoCameroonJun 10, 201257392
DominicThompsonNorth Little RockOmanOct 21, 201263825
KenyonGoodPort ArthurThailandSep 16, 201133424
DominiqueGentryClemsonTurkeyNov 16, 201152636
RachelRobinsonHastingsIran, Islamic Republic ofDec 20, 201168943
BeauMurrayAguadillaSloveniaJun 23, 201164758
FayCoffeyWaterlooLiberiaJun 29, 201123261
AnjolieHudsonVilla ParkIsraelSep 12, 201261595
AuroraWilcoxDes MoinesBelgiumAug 1, 201194743
GraidenCantuCaguasFrench GuianaAug 26, 201247270
IfeomaSnyderStocktonGrenadaDec 21, 201264082
FatimaDillardMinotMaltaJun 5, 201222642
ElvisHurstFairfaxIraqJul 31, 201149754
TyroneMedinaFond du LacSerbia and MontenegroSep 18, 201271427
EleanorMoranVenturaSwitzerlandJun 25, 201137410
MarisThomasRoswellUgandaFeb 1, 201213281
HermanWebsterOak RidgePeruJul 6, 201164747
VladimirMccormickDurantTaiwan, Province of ChinaFeb 6, 201174553
WhileminaMcbrideNew CastlePuerto RicoSep 21, 201136301
HarperFitzgeraldDuquesneAntarcticaAug 11, 201294535
SybillCollinsManassasBritish Indian Ocean TerritoryAug 21, 201255119
TallulahMathewsBerkeleyLiechtensteinSep 24, 201239287
ScarlettFreemanNew HavenBelarusJul 16, 201138373
UrsaReidLockportKazakhstanDec 13, 201113237
WhoopiMendezNashvilleAntarcticaSep 2, 201159088
SummerEverettSt. MarysLiberiaNov 14, 201298078
PascaleBucknerRapid CityDominican RepublicJan 26, 201158219
AladdinBallCharlestonNetherlands AntillesJun 11, 201196308
CyrusParkerDixonBelgiumMay 13, 201252863
DrakeRhodesMoultrieAmerican SamoaJun 23, 201274539
GermaineCastroRichlandLiechtensteinDec 28, 201163845
DestinyPickettForest LakeLibyan Arab JamahiriyaOct 25, 201219834
LarsBishopSun ValleyCayman IslandsNov 22, 201251458
IrmaBartonNew MadridChristmas IslandApr 5, 201155391
UriahWilkersonDes MoinesCubaAug 2, 201156456
MeredithPerkinsMorgantownMaliJul 7, 201220346
MeredithShawChicago HeightsFaroe IslandsOct 14, 201145907
KendallWestHartfordSan MarinoNov 5, 201195793
IgnaciaBentonOxfordAlbaniaDec 22, 201116838
BuffyHolderUniontownFranceDec 26, 201114356
RobertKnightAlamedaChileAug 24, 201247454
AlyssaLaneLansingPolandOct 17, 201213091
EatonDominguezLaconiaCocos (Keeling) IslandsMar 6, 201219370
LionelHenryNew BedfordNauruFeb 1, 201291015
AlexaAlvaradoIrvingLithuaniaAug 29, 201172668
AlfonsoHolcombWashingtonLiberiaSep 9, 201235378
SimoneMorinPembroke PinesKuwaitJun 4, 201240163
WinifredValenciaGrand RapidsGuyanaJun 13, 201152119
NigelBradyTorranceNigeriaSep 4, 201225328
KnoxCantuSavannahDominican RepublicOct 23, 201247569
EzekielBowersGeorgetownNorthern Mariana IslandsNov 9, 201281979
DeannaIrwinToledoCambodiaJul 7, 201195674
HoytFuentesBloomingtonCyprusOct 25, 201248163
KamalYatesLos AngelesSurinameApr 9, 201141892
CharlotteAlexanderSeafordBelarusAug 10, 201139729
RanaMcdonaldNorwichTanzania, United Republic ofApr 28, 201234045
KennedySantiagoEl CerritoArubaSep 25, 201280367
LoisKellySan FranciscoIrelandNov 15, 201158415
JennaManningCambridgeBouvet IslandOct 11, 201167687
EdenMckeeKokomoMarshall IslandsAug 7, 201179335
JaelWilliamEl CerritoDominican RepublicJun 9, 201197577
EmmaHughesMarlboroughIsraelNov 3, 201149415
KirstenEstesAstoriaAlgeriaApr 8, 201254645
AnjolieSargentLaguna BeachGambiaFeb 15, 201122452
DaleWallMurraySamoaNov 17, 201274859
ChaimMorinYonkersCosta RicaOct 4, 201233924
DylanCaseyBethlehemSaint LuciaOct 23, 201133073
QuincyMoralesCommerceGuatemalaAug 7, 201266255
SimonJamesElkoSwedenJan 14, 201178769
ShoshanaWootenValdostaUnited KingdomDec 4, 201154634
MaceyRogersCarbondaleSolomon IslandsJan 17, 201269135
EzraLoganCalumet CityMonacoNov 26, 201129331
RyleeDyerCouncil BluffsSaint HelenaDec 23, 201123793
RavenVelazquezWashingtonTuvaluJan 12, 201222906
PlatoBoyerPascoTimor-lesteMar 13, 201119451
HayleyWheelerHamptonMoroccoNov 14, 201186373
ZaneMorganSaint JosephUkraineFeb 19, 201281948
CassandraGuerreroThibodauxSwedenApr 14, 201116254
AprilCabreraArdmoreIrelandNov 28, 201186589
BrandenMaddoxLeominsterTokelauMay 26, 201111319
EugeniaDukeHialeahColombiaMay 12, 201254556
BorisMullenNewburghBurkina FasoDec 9, 201149827
UriellePollardYumaIran, Islamic Republic ofNov 8, 201260607
AltheaFoleyScottsbluffIraqJun 3, 201269002
PaulaBookerFrankfortGuinea-bissauJan 10, 201240317
KessieHarmonBeaumontMaliApr 21, 201211691
ShaineRandolphFullertonNorwayAug 22, 201160811
TamekahSalinasNorwichColombiaOct 11, 201214711
DanteLangKankakeeFrench PolynesiaApr 14, 201273657
BlairHamiltonKonaIrelandJan 2, 201236851
CiaranRayBridgeportSwazilandMar 1, 201272915
LesterHolcombDanburyAntigua and BarbudaJun 7, 201283293
IrisJenkinsConcordTongaJan 15, 201145170
IndiaBlackburnCedar FallsMaliMay 30, 201111844
GemmaDeckerKetchikanMayotteAug 19, 201228846
GrahamGreenPascagoulaMartiniqueSep 7, 201269740
CedricCarlsonRapid CityGambiaFeb 18, 201214817
KellieMullenFairmontWestern SaharaJun 15, 201218378
DominicHumphreyKingstonUruguayDec 5, 201232145
JasonNoelHobokenCongoJun 17, 201225643
JanaBurkeSharonSaint Kitts and NevisJan 14, 201145295
GriffithHahnSpartanburgSouth AfricaOct 6, 201112676
BlaineCallahanPittsfieldLibyan Arab JamahiriyaJan 2, 201223984
HannaMarshallErieCook IslandsMar 7, 201142188
ZoeArmstrongRaleighSwazilandJul 22, 201144114
HildaAveryLowellBhutanOct 11, 201191133
DarylHooverLa PuenteMacedoniaDec 19, 201159209
DennisHammondMidwest CityYemenOct 30, 201197193
FerdinandClineYorba LindaSri LankaMay 12, 201177321
ZacherySkinnerColumbusKazakhstanApr 29, 201164882
RonanYoungWynneHaitiFeb 6, 201160565
AdamJimenezReedsportAfghanistanJul 24, 201120839
PatriciaBridgesWichitaUnited Arab EmiratesJun 4, 201255918
HayfaHicksLong BeachHaitiSep 23, 201277954
CainLottDetroitTogoOct 14, 201112719
ChandlerFernandezCamdenCambodiaMay 10, 201219072
JosiahSmallMaconAlbaniaJul 27, 201213477
LeilaBatesMontpelierSomaliaNov 28, 201290708
SydneyGrimesClevelandAmerican SamoaJan 20, 201224356
BorisStuartAlhambraNew ZealandJan 16, 201187257
InaNewmanTuscaloosaAlgeriaMay 18, 201239232
OttoMcbridePendletonTurks and Caicos IslandsJul 26, 201172726
IvanaGayMonterey ParkKiribatiJul 7, 201280598
RajahFitzpatrickKennesawPanamaJun 15, 201130196
QuincyKleinSanta AnaKiribatiFeb 8, 201189951
InaCabreraDavisAlgeriaJun 13, 201240568
AutumnSummersNiagara FallsMalawiApr 24, 201130348
FleurCarlsonRadfordBritish Indian Ocean TerritoryNov 9, 201128323
CaraFuentesGettysburgHaitiNov 17, 201170564
CaldwellFoleyMiami BeachSaudi ArabiaDec 9, 201117992
KamalMaddenDiamond BarDominicaJul 8, 201135318
HollyElliottMyrtle BeachRwandaFeb 19, 201289319
SydneyStoutClovisJapanSep 11, 201182267
JakeemRussellGuayanillaPapua New GuineaFeb 4, 201166862
OdetteMunozTonawandaGambiaMar 11, 201198220
VirginiaMontgomeryStamfordBouvet IslandApr 27, 201147952
JackGlassDecaturSolomon IslandsJan 8, 201218843
CherokeeHollowayRivertonBelgiumApr 19, 201144159
YuliCarterAliquippaSurinameNov 17, 201132012
RyleeColemanMorgantownArubaNov 25, 201112895
WalterGuzmanLa VernePhilippinesDec 20, 201215512
JaymeCottonCypressLatviaApr 22, 201237823
MaryamPattonLiberalDjiboutiJul 20, 201113823
BoFisherIowa CityMoldovaFeb 20, 201112010
TeeganHolmesDelta JunctionBotswanaMay 10, 201153872
RhonaGentryCorinthFranceOct 6, 201122170
JenniferCarpenterJanesvilleTokelauJan 14, 201176200
KiaraChambersCity of IndustrySao Tome and PrincipeJul 21, 201175843
GrayHansonBayamonMauritiusApr 23, 201159870
LuciusLoweryPittsburghAntigua and BarbudaNov 25, 201173768
VivienKennedySturgisBotswanaFeb 6, 201281110
AmityHardinClaremoreBosnia and HerzegovinaJun 13, 201284046
AladdinWaltonHartfordQatarJan 21, 201218600
BuckminsterWelchMoultrieAlbaniaSep 1, 201125530
ArthurDavidsonMiamiDominicaSep 13, 201248935
TroyWyattHaverhillFaroe IslandsFeb 11, 201219612
WilliamValenzuelaBay St. LouisMaltaJan 17, 201162300
DarrylJoyceSanta CruzSlovakiaNov 9, 201135416
DerekCarverEscondidoNew ZealandJan 17, 201178970
MannixRutledgePasadenaPhilippinesApr 8, 201232548
GalvinVazquezRancho CucamongaBurundiSep 1, 201157637
FerrisLynchParmaMoroccoOct 12, 201148969
HarrietConnerDecaturEgyptMar 3, 201112245
VedaCraftMadisonNorfolk IslandMay 18, 201278049
KasimirMurphyBrookingsEstoniaMar 6, 201166453
HenryCummingsSeal BeachNetherlands AntillesJul 19, 201225952
DaceyAyersHickorySaint LuciaMar 9, 201244174
VirginiaReeseAshlandAustraliaMay 12, 201275418
BerthaWhiteheadWashingtonTuvaluMar 2, 201136257
XandraSimmonsGadsdenGrenadaAug 28, 201188873
GavinByrdNogalesHaitiJan 31, 201277276
RinahDillardPomonaSaint Kitts and NevisJan 20, 201179816
MaryamBeanNew RochelleViet NamJan 6, 201224359
UlyssesLeeFallonMartiniqueJan 2, 201241896
SebastianGrantMurrayMarshall IslandsSep 29, 201294255
AmalRiggsWynneNorwayAug 24, 201115807
StephanieGrahamMuncieCanadaJan 28, 201126309
JescieHollandMason CityBangladeshApr 27, 201195718
QuinnWatkinsPowellSaint Vincent and The GrenadinesOct 29, 201163038
KitraBatesWaukeganCambodiaAug 23, 201232026
AladdinHurleyParamountMauritaniaMay 17, 201119926
FitzgeraldEdwardsBasinArmeniaSep 16, 201171509
QuamarPenningtonRadfordPolandMar 29, 201259219
PrestonRoweAlamedaJamaicaJun 24, 201163620
MerrittDennisStaffordReunionJan 24, 201160241
JenaSawyerEscondidoCongoJul 11, 201193011
MarnyHessPoughkeepsieNiueSep 8, 201119965
KionaFrancisGrand JunctionIndonesiaJan 29, 201141544
ZeldaSykesCity of IndustryEquatorial GuineaJul 8, 201115358
CarlaHorneLake ForestTimor-lesteJul 10, 201163680
HilelSheltonTruth or ConsequencesSaint LuciaAug 1, 201181858
TanishaGrantPeekskillBahamasSep 18, 201161071
AyannaCohenAlexandriaMauritiusOct 1, 201225891
MadisonRutledgeAliquippaMalawiDec 14, 201184684
OrsonOwensColumbiaIrelandJun 10, 201230998
BeatriceVangIsle of PalmsBhutanJun 26, 201165410
KiayadaCamposJacksonMauritiusMay 19, 201166304
WillowMosesGaithersburgBurundiFeb 22, 201280779
KarynPagePlainfieldUnited Arab EmiratesMay 31, 201194335
MannixBriggsBelpreAustriaMar 16, 201195369
BlytheSchultzMuskogeeIsraelMay 6, 201120566
NitaJenkinsScottsbluffIndonesiaApr 15, 201223854
QuinnFarleyEatontownSvalbard and Jan MayenMar 27, 201150873
FayKramerEvansvilleTurkmenistanMar 17, 201158959
LaneStrongAltoonaHoly See (Vatican City State)Oct 10, 201168918
AmirBaileyVisaliaFrench GuianaOct 3, 201266206
TrevorWattsCarolinaCocos (Keeling) IslandsMar 28, 201265347
ZiaBrowningLiberalAmerican SamoaJan 30, 201273063
CarlyPotterPullmanBeninJul 25, 201199675
TaShyaWilliamWaycrossAngolaFeb 1, 201167461
CruzEatonRensselaerQatarOct 17, 201227912
IdonaValentineWahooCambodiaMar 2, 201183045
HadassahBurksSan BernardinoGabonMar 25, 201245601
SylvesterRogersOlympiaNew CaledoniaJan 22, 201166135
ConstanceBlackburnMayagüezCameroonSep 30, 201242426
RaphaelFlowersLanderMexicoJun 23, 201217684
BurkeRamseySunburySingaporeApr 25, 201244729
StephenMeyerLa Cañada FlintridgeIndonesiaJan 19, 201190023
DevinHoltCollege ParkSaint HelenaJun 22, 201130701
LynnObrienWinnemuccaLesothoFeb 7, 201234481
LesterJonesToledoAustraliaDec 31, 201244838
PaulShepherdSelmaUkraineNov 7, 201134189
ChaimWilliamsonWaycrossCameroonMar 26, 201220787
LoganDavidNacogdochesLiechtensteinSep 20, 201277349
HelenBradyMorrisonCubaFeb 11, 201147325
AleaFloydHollisterVirgin Islands, BritishMar 13, 201212323
BakerRosalesEast HartfordPanamaJul 31, 201157605
ColleenWallaceNewburghSlovakiaDec 20, 201118444
MaggieHolcombHollisterAndorraJan 19, 201115451
RyderTerrySpringfieldBangladeshMay 31, 201122406
ElizabethSerranoBellflowerTurks and Caicos IslandsJun 15, 201297667
NevilleBestHuntington ParkBelizeNov 7, 201277231
AkeemHobbsNorth PoleTanzania, United Republic ofOct 24, 201167426
DaneFarrellLafayetteFrench Southern TerritoriesNov 14, 201298631
OttoHernandezBandonBurkina FasoSep 10, 201159586
ChelseaBurksWilmingtonSri LankaDec 2, 201214442
MaxineSampsonGastoniaBouvet IslandJul 16, 201194283
MarthaAustinGreat FallsPhilippinesAug 20, 201194790
MelodieKelleyBaton RougeNigerNov 6, 201272120
IolaPhelpsLittle RockSamoaFeb 27, 201161857
AdaraVinsonNacogdochesGuamJun 10, 201256513
HyacinthLopezAlamedaKyrgyzstanNov 13, 201264215
ZeldaCastilloGardnerLesothoOct 10, 201245521
RaymondDrakeGardenaHoly See (Vatican City State)Sep 9, 201212840
GavinSimpsonModestoGuadeloupeMay 15, 201146777
JamaliaBarryMilwaukeeSerbia and MontenegroMay 14, 201228311
AlyssaKeithKnoxvilleGuineaNov 30, 201177779
ArethaDicksonNacogdochesNicaraguaOct 17, 201250273
NadineDillardLaytonEgyptFeb 10, 201250001
ChastityPaulWacoNigeriaJul 17, 201264750
CalvinTranSouth GateSaint LuciaApr 4, 201251272
HannaHendricksPierreTajikistanJun 26, 201161236
ShayThorntonEverettSenegalDec 26, 201249295
SoniaTrujilloGold BeachPortugalDec 18, 201188606
RemediosConnerEverettLiberiaSep 27, 201293858
KellyCookSheridanSomaliaAug 11, 201293466
AdrienneKimSignal HillGuadeloupeFeb 18, 201114452
DaquanMillerDuluthMadagascarDec 2, 201183174
DorothySalasAlbuquerqueBoliviaJul 24, 201220452
OctaviaMcclainNew HavenMauritaniaSep 13, 201289452
CooperHoltLos AngelesKoreaDec 4, 201214399
DaneDoyleSpringfieldDominican RepublicNov 2, 201282940
WillowWootenHomerMicronesiaMar 7, 201163843
JeromePettyAshevilleYemenFeb 23, 201163889
AdrienneMullenSpartanburgTajikistanMay 10, 201265453
WhileminaAlbertNashvilleGreenlandDec 12, 201226021
LawrenceDavidTruth or ConsequencesNepalJul 27, 201112423
InezBerryParkersburgFaroe IslandsApr 11, 201258958
TatyanaNunezMercedLithuaniaApr 30, 201146279
StuartOsborneNewportSaudi ArabiaJun 20, 201293292
WallaceBryanYorba LindaNetherlands AntillesJan 22, 201193991
IndigoBurgessNevada CityWestern SaharaSep 5, 201230552
MosesCraigVancouverFrench Southern TerritoriesSep 18, 201184475
RandallBrayWalthamSaudi ArabiaJul 28, 201193371
SoniaMossAuburnKyrgyzstanMay 29, 201249758
YeoMonroeOcean CityTrinidad and TobagoApr 2, 201135465
UriahFarmerHelenaSyrian Arab RepublicJul 18, 201246976
NatalieTorresBattle CreekRussian FederationMay 14, 201241665
VaughanHinesWoodruffMonacoAug 14, 201274388
PakiWashingtonYorkBouvet IslandJun 9, 201133377
HolmesKnightChickashaKuwaitFeb 16, 201165302
acquelineWhitakerAstoriaWestern SaharaApr 22, 201294179
JermaineMaldonadoTaylorsvilleKuwaitDec 18, 201240460
CaraBranchSouth El MonteGambiaJan 14, 201290422
GermainePrattSpringfieldHoly See (Vatican City State)Jan 28, 201161328
LaithMoonCalabasasKazakhstanApr 25, 201184477
XavierSotoVermillionSomaliaJul 21, 201268063
VincentMccartyHermosa BeachSierra LeoneFeb 20, 201141500
ElmoFrankWoonsocketIraqJan 31, 201193377
OliverOsborneSan DiegoNiueAug 4, 201143556
AquilaWeeksWest HavenJapanAug 5, 201135863
ElijahWaltersMurfreesboroEthiopiaFeb 23, 201118593
KamekoWilliamsonSan FernandoFranceAug 24, 201135638
CaesarRiveraDowneyBeninMay 29, 201170156
AngelicaDaleNeedhamNiueNov 28, 201132735
WyattBergDerbySaint LuciaFeb 1, 201178528
UlricRichmondMarshallCanadaOct 11, 201116814
KirkMayerFernleyCape VerdeMar 8, 201171848
JermaineMendezRiversidePitcairnDec 7, 201226973
CedricNielsenWest LafayettePolandMay 23, 201298637
AmosEatonMiami BeachGreenlandFeb 5, 201180953
DarylJuarezHuntington ParkZimbabweFeb 15, 201187980
WadeGreenMarshallTrinidad and TobagoSep 21, 201148791
KatellHardingPerth AmboyBarbadosMar 23, 201188383
MasonVegaGuánicaAustriaMay 13, 201211121
TheodoreDorseyHastingsJapanJan 10, 201122586
EricKinneyManassas ParkZimbabweApr 6, 201181470
FayRivasPortlandPakistanApr 29, 201157277
MiaMccormickSaint AlbansArmeniaJun 28, 201152182
XavieraBradyWhittierLibyan Arab JamahiriyaApr 22, 201288677
AbbotFrostNorwalkPuerto RicoApr 11, 201213782
OrlandoRyanNewport BeachLithuaniaApr 14, 201129880
RinahHuffFullertonSaudi ArabiaSep 26, 201139492
LauraMendezNorth Little RockCyprusFeb 8, 201285620
PalomaMathewsNorwalkGuineaMar 22, 201255662
OlgaMorganWest Valley CityArgentinaDec 29, 201215762
AugustConnerParkersburgPuerto RicoNov 25, 201126509
XanderHuffRivertonNauruSep 1, 201194997
GermaneBeckerMorgan CityGabonAug 8, 201185931
LuneaShafferAstoriaFinlandSep 6, 201212134
AvaLynchLakewoodSri LankaJun 6, 201199707
ColinKerrBandonSlovakiaMar 27, 201260649
SydneeFrenchHooverTuvaluMay 29, 201296750
VincentVelasquezLowellIran, Islamic Republic ofApr 27, 201287557
IfeomaChambersGuayanillaKyrgyzstanDec 21, 201239714
FritzBowmanNorth PoleReunionFeb 12, 201156527
GiacomoBrittKearneyTaiwan, Province of ChinaAug 7, 201153705
BenjaminBartonNorthamptonKenyaApr 10, 201285073
JessaminePatrickVenturaBrazilAug 26, 201158440
MadonnaNolanNorth Little RockBahrainApr 30, 201190700
LaceyKerrWatertownCook IslandsOct 6, 201127521
HunterBrayTucsonGibraltarOct 30, 201263157
BrunoBlackEl MonteSao Tome and PrincipeApr 7, 201140092
EugeniaHoustonSheridanEcuadorJan 31, 201139917
MiaRobertsonJenksMicronesiaDec 9, 201142336
YokoHammondJohnson CityDominicaSep 14, 201193520
IllanaFisherHawaiian GardensEgyptNov 9, 201146651
LenoreClemonsColumbiaAndorraJul 20, 201192360
AlecNorrisFitchburgKenyaMay 18, 201210905
TanishaWhitleyFontanaEritreaMay 25, 201282800
MerrittOlsenWorlandSwitzerlandMay 7, 201187447
EdwardHolcombMarshallMonacoAug 6, 201261315
UrsaFrazierMarshallCubaJul 26, 201124337
MyraOneillSomervillePalauMay 27, 201284087
LaneCopelandEasthamptonBoliviaApr 16, 201198227
HarrietWittFarmingtonTurks and Caicos IslandsApr 10, 201272511
ImogeneHolmanHermosa BeachEstoniaJun 21, 201276124
GermaneCrossWalthamMyanmarOct 30, 201282327
SkylerVargasSan BernardinoCameroonSep 15, 201179466
ClintonOrtegaCrown PointMontserratMay 11, 201224649
KarleighCookeHawaiian GardensKenyaFeb 10, 201273887
GiselaHooverNewport NewsBurkina FasoJan 13, 201245465
HayesColonBeverlyMoroccoNov 5, 201178814
JasmineGloverWestlake VillageSurinameAug 1, 201120519
MorganObrienMethuenFrench Southern TerritoriesNov 1, 201278567
GenevieveCastroWest CovinaIsraelJul 15, 201237708
IonaKnappOgdenHungaryMay 17, 201254340
AbrahamBrowningCitrus HeightsMauritiusMar 29, 201153530
WylieFisherNorth PlatteTurkmenistanMar 13, 201172092
KadenKnappCorinthCanadaNov 18, 201113259
LaneHopperCedar FallsSaint HelenaAug 9, 201270839
ClarkPickettWestminsterSvalbard and Jan MayenJan 28, 201138246
ImaBrewerDoverDominicaApr 12, 201287923
IvanaBentleyAnchorageMontserratJul 9, 201251544
AlexaBowenEl MonteBelarusOct 11, 201084775
ChaimChavezVinelandIran, Islamic Republic ofAug 6, 201017277
ForrestHickmanCedar FallsGrenadaNov 17, 201157833
TeaganBoyleNew KensingtonCayman IslandsJun 19, 201116784
RobertPrinceDuluthRwandaAug 4, 201126445
ElmoHouseNapervilleJamaicaMay 15, 201236274
SusanWebsterHialeahLibyan Arab JamahiriyaAug 5, 201039872
KeelieGomezBellflowerSao Tome and PrincipeMay 25, 201259393
JessicaPottsYorkBelgiumMar 16, 201277425
NaidaAnthonyPittstonBangladeshApr 23, 201125448
LysandraRyanMacombPapua New GuineaMar 7, 201142613
KylaHarringtonBoulderMartiniqueNov 24, 201153564
UriahGrahamLittletonNetherlands AntillesJul 24, 201275568
DamianValentineMarshallSaint Pierre and MiquelonSep 5, 201234683
TallulahOlsonOrlandoWestern SaharaFeb 10, 201293023
AshelyDillardEvanstonMexicoJun 25, 201189936
AmeryAguirreSanta ClaraMonacoFeb 24, 201084137
HermioneSavageLongviewBahamasJun 21, 201157413
YuliHeathRoswellEl SalvadorJan 21, 201276836
JacksonYoungRichlandEgyptAug 20, 201063793
BernardBarkerIrwindaleNamibiaMay 8, 201072461
SebastianElliottBoulderNamibiaAug 13, 201027289
DanielleBowmanColumbusYemenMar 19, 201122118
LoisCarpenterCitrus HeightsAngolaFeb 22, 201157546
RoaryHodgeSan JoseTurkeyMay 8, 201265655
JarrodBeanPlantationNorfolk IslandApr 22, 201252368
MikaylaNewtonNew IberiaSvalbard and Jan MayenAug 30, 201073613
JaneFoleyCape CoralEgyptApr 18, 201244932
RinaTrevinoKansas CityMacaoSep 6, 201066005
JamalOwensFallonBangladeshMay 15, 201294380
GriffithHahnDothanLiechtensteinJun 9, 201019795
LesleyHolmanAllentownAntarcticaJan 24, 201258357
BryarAustinDickinsonIraqJan 20, 201037722
JoanRussellPasadenaQatarApr 21, 201081376
AvaBrowningDenverBeninAug 8, 201231651
ChesterSchneiderEl PasoIrelandJun 15, 201067225
WarrenHarveyKalamazooNew ZealandFeb 2, 201151295
AubreyRossMilfordFrench GuianaMar 10, 201125247
RoaryMackYonkersBangladeshJan 24, 201141355
RothSearsRenoEgyptApr 19, 201174318
SkylerDaleLoudonIrelandAug 13, 201254593
CastorRochaAzusaCape VerdeJun 27, 201135174
MarisBaileyBremertonHoly See (Vatican City State)Jul 26, 201145543
ZoeShafferNew BrunswickLuxembourgNov 27, 201089966
TamekahFrazierOxfordUnited KingdomMay 6, 201126346
CamillaHydeCudahyEquatorial GuineaOct 24, 201182129
JosiahRiversNomeBosnia and HerzegovinaFeb 16, 201244720
BarbaraClementsPhiladelphiaSaint Vincent and The GrenadinesJul 2, 201019925
DominiqueCopelandMonongahelaLatviaMay 3, 201077608
BenjaminAyersManassas ParkRomaniaSep 22, 201092397
QuynBrayBlytheKorea, Republic ofJun 20, 201271773
DeirdreMathewsThibodauxSpainJul 4, 201280830
RachelRasmussenScarboroughFrench GuianaMay 11, 201120930
AlexandraBuckDanvilleBouvet IslandDec 1, 201266928
ThomasJenningsCorvallisSierra LeoneNov 2, 201182381
GeoffreyBattleMesquiteCape VerdeJan 11, 201151073
LeeClementsMinnetonkaSlovakiaMay 3, 201018778
DevinEwingMissoulaKorea, Republic ofMar 5, 201299433
AlexandraRodgersAuburnMonacoNov 6, 201079762
KasimirHooverWest HavenBelgiumFeb 29, 201264648
ConanCarrollTemeculaSeychellesSep 4, 201119256
FrancesCottonTexarkanaGuinea-bissauApr 5, 201066057
CharlesHessBay St. LouisBurkina FasoJul 19, 201135043
GeorgiaMorseJeffersontownCzech RepublicJan 5, 201142891
CleoParsonsMission ViejoBeninMar 8, 201284366
JarrodWelchDubuqueMalaysiaOct 3, 201233928
QuinnShepherdUrbanaColombiaDec 17, 201165585
MadonnaNguyenGalvestonColombiaMay 6, 201239223
KarlyPattersonFairbanksSaint Vincent and The GrenadinesJun 4, 201199687
GarrisonMoralesSignal HillEgyptFeb 5, 201215949
NathanielRosaRadfordAndorraMar 11, 201269517
SophiaPageHartfordCambodiaSep 27, 201245944
WylieAyersAthensSingaporeMay 15, 201188601
WilmaMorseOrlandoPapua New GuineaSep 18, 201042911
PatienceBentonBayamonBotswanaJan 28, 201046908
CadmanHubbardKahuluiChileMar 27, 201110924
SamanthaMatthewsOlympiaLiberiaJan 9, 201241131
RoaryCarrilloIndependenceTanzania, United Republic ofDec 13, 201089903
HeidiKnowlesGlens FallsSudanMay 13, 201125299
PortiaGuthrieRedlandsIran, Islamic Republic ofJul 14, 201122884
GraceDuncanFarmingtonSan MarinoSep 27, 201078597
IanWalterEnidSaint Pierre and MiquelonMar 28, 201189844
JulianJarvisEden PrairieDominicaNov 20, 201172256
QuinnKentWebster GrovesAzerbaijanJan 14, 201224170
IgnatiusAyalaBossier CityParaguayDec 26, 201243263
AidanParkerSitkaEstoniaMay 4, 201057859
SydneeBurtonApple ValleySpainOct 19, 201056678
WingHahnMedfordAustriaNov 18, 201121517
BellJeffersonSheridanUnited KingdomFeb 11, 201111836
MikaylaSimpsonCedar RapidsPhilippinesNov 19, 201295092
BiancaBoyerGainesvilleNiueJan 23, 201049385
CiaraCrawfordTylerAntarcticaJul 13, 201279513
SashaJarvisNew MadridVirgin Islands, U.S.Feb 14, 201149687
BlytheWoodwardMankatoIsraelNov 19, 201194109
AnneWeaverCedar RapidsViet NamMay 31, 201248021
KyleeWalshTokChileNov 15, 201142566
MercedesGilmoreGreen BayColombiaMay 15, 201066483
KeatonNielsenMontereyPakistanJan 2, 201116342
MorganTysonAlamogordoMoldovaMay 31, 201188703
VenusSargentDana PointFalkland Islands (Malvinas)Oct 15, 201289640
KatelynBruceMeridenBermudaMar 30, 201011089
RossCaldwellVergennesSouth Georgia and The South Sandwich IslandsOct 15, 201191296
CynthiaLarsenPowellJapanDec 18, 201011310
WyomingCashBurlingtonMacedoniaSep 10, 201124041
VannaIngramFalls ChurchSwedenApr 24, 201251287
WallaceMaysWinooskiOmanMar 26, 201213627
JasperSearsCoos BayMontserratFeb 22, 201023076
ClintonFoleyNew AlbanyLibyan Arab JamahiriyaFeb 25, 201086135
JesseSweetJamestownKoreaApr 3, 201220037
AbigailGuerraWarwickComorosMar 12, 201011847
LindaLucasGainesvilleCosta RicaApr 8, 201015278
HasadWillisWebster GrovesSolomon IslandsOct 21, 201123930
RheaJenkinsMaldenRwandaMay 15, 201242759
GayLottUnion CityNorwayJun 25, 201066935
VannaStuartNevada CityThailandAug 15, 201186717
BertLewisGardnerNetherlands AntillesMar 27, 201014565
MelindaNievesMurfreesboroMicronesiaFeb 17, 201212357
BevisCarsonTwin FallsPortugalMay 4, 201155060
DestinyMorseAshevilleMontserratMay 15, 201292200
IndiraEnglishMooreAnguillaMay 24, 201163852
HenryKellyRialtoFrench PolynesiaFeb 13, 201050835
JemimaHubbardBowling GreenLithuaniaJan 15, 201148072
KevinColonPendletonBrazilOct 12, 201148952
ChesterFrankVernonUnited StatesFeb 20, 201091649
YardleyMayoGuayanillaBarbadosJul 15, 201228804
FletcherMayerHot SpringsAmerican SamoaMay 25, 201051273
ChaimHebertRosemeadBhutanJan 26, 201040706
YaelStewartValdostaGhanaJul 5, 201078757
LynnDavisGlens FallsAmerican SamoaDec 16, 201085887
DeannaWhitakerDurantAndorraApr 18, 201236856
MarkMooreClaremoreMauritiusNov 26, 201051924
JasperCarrilloPendletonSloveniaFeb 26, 201266731
MaraWilsonMount VernonTimor-lesteMay 23, 201123185
NashMckenzieSan AntonioTaiwan, Province of ChinaNov 22, 201157595
ChelseaWadePalos Verdes EstatesTimor-lesteDec 14, 201058960
ColleenEnglishMadisonSloveniaJul 6, 201248007
RaphaelMckeeAndersonMexicoMay 15, 201180875
ZeldaBridgesPortlandOmanDec 27, 201222586
GavinDunlapIdaho SpringsTaiwan, Province of ChinaJul 16, 201036437
WendyWoodTokVirgin Islands, BritishMay 7, 201116187
MercedesSampsonCiceroHoly See (Vatican City State)Feb 10, 201089633
BriannaFlowersCatskillMaldivesJun 5, 201236980
SelmaOlsonFajardoRussian FederationNov 28, 201192402
TalonHardinPuebloAustriaSep 16, 201024422
JoyFrostKnoxvilleNigerApr 30, 201262456
DavidAdamsElkoMalaysiaOct 2, 201118044
PaulaMoodyLake CharlesKuwaitFeb 27, 201088109
AprilGrayCodyMacaoOct 12, 201136822
IndigoDavidForrest CityPhilippinesMay 24, 201143871
ColoradoMendezAlexandriaParaguayAug 12, 201081867
MarahNewmanChesterSouth AfricaApr 5, 201084464
LydiaHooverBaldwin ParkTurkmenistanAug 13, 201284024
CaldwellCarrollKalispellCanadaJan 6, 201051769
LatifahWallaceCalumet CityRussian FederationJul 21, 201091338
IndigoDelgadoGramblingLebanonSep 12, 201130225
UrielleHayesHaverhillGuatemalaOct 2, 201127377
SydneyMatthewsCalumet CityAlgeriaMay 25, 201294769
BlaineVargasClearwaterKazakhstanMay 21, 201027036
UlricGordonMoscowFinlandMay 7, 201155246
RinaHowardBellinghamUnited Arab EmiratesOct 29, 201137461
OctaviaOrrDecaturTongaJul 5, 201268834
DevinDickersonAlamedaSwedenApr 20, 201161040
KessieCarlsonAllentownNepalJan 3, 201162411
CiaranWilkersonEnidIrelandDec 9, 201043612
PaulaRasmussenNew BedfordSaint Pierre and MiquelonFeb 27, 201283735
CeciliaPierceWestfieldChristmas IslandOct 28, 201292440
UrsaCamposTexas CityColombiaApr 16, 201118777
ZeleniaMcguireSouth PortlandMyanmarOct 10, 201293813
MaryDiazOmahaNauruAug 23, 201263436
AdamEricksonRaleighTongaDec 22, 201255020
CelesteTranBossier CityAnguillaAug 20, 201258914
CharityVincentSalinasSvalbard and Jan MayenApr 12, 201227311
ReeseFrancisLa MiradaMalawiMar 9, 201276277
GermaineColeNorth Las VegasJordanNov 5, 201025574
DanaMccrayBozemanAmerican SamoaDec 27, 201256998
JeanetteMoralesSharonUnited Arab EmiratesNov 10, 201288808
OlegDayBattle CreekGuineaFeb 16, 201192338
PascaleCooperLivoniaSvalbard and Jan MayenMar 31, 201240378
WyomingOdonnellWilmingtonSeychellesDec 4, 201172703
GiselleSmallVermillionIran, Islamic Republic ofAug 11, 201269244
MartenaValdezStamfordCambodiaOct 31, 201136493
LeoJuarezWilmingtonMayotteJul 26, 201085336
ReeseHoldenPembroke PinesPuerto RicoSep 9, 201254075
CiaranFinleyHuntington BeachAzerbaijanFeb 20, 201069408
RonanAdamsCedar RapidsSeychellesMar 3, 201251064
BradleyFrederickTexas CitySlovakiaDec 1, 201041919
SeanJonesNorth Little RockDominicaAug 2, 201083748
GarrettHenrySeattleLebanonJul 30, 201148446
AltheaRobertsonReadingUgandaFeb 10, 201294806
MatthewWebsterJacksonvilleFinlandOct 21, 201297297
IgnaciaWoodHealdsburgDominicaDec 28, 201237242
RisaConwayBethlehemMaltaApr 23, 201148783
OlympiaMerrillHidden HillsCambodiaJan 21, 201278313
DennisMclaughlinRenoNicaraguaAug 28, 201243970
RayHeadMonongahelaTajikistanMay 30, 201055532
NaydaCrawfordCairoBarbadosJun 9, 201286208
DaltonMcdowellKetteringVirgin Islands, U.S.Jun 1, 201281139
SachaMathisConcordHungaryMar 14, 201062233
+ + + diff --git a/media/js/joequery-Stupid-Table-Plugin/stupidtable.js b/media/js/joequery-Stupid-Table-Plugin/stupidtable.js new file mode 100644 index 00000000..705346dc --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/stupidtable.js @@ -0,0 +1,158 @@ +// Stupid jQuery table plugin. + +// Call on a table +// sortFns: Sort functions for your datatypes. +(function($) { + + $.fn.stupidtable = function(sortFns) { + return this.each(function() { + var $table = $(this); + sortFns = sortFns || {}; + + // ==================================================== // + // Utility functions // + // ==================================================== // + + // Merge sort functions with some default sort functions. + sortFns = $.extend({}, $.fn.stupidtable.default_sort_fns, sortFns); + + // Return the resulting indexes of a sort so we can apply + // this result elsewhere. This returns an array of index numbers. + // return[0] = x means "arr's 0th element is now at x" + var sort_map = function(arr, sort_function, reverse_column) { + var map = []; + var index = 0; + if (reverse_column) { + for (var i = arr.length-1; i >= 0; i--) { + map.push(i); + } + } + else { + var sorted = arr.slice(0).sort(sort_function); + for (var i=0; i b) return +1; + return 0; + }, + "string-ins": function(a, b) { + a = a.toLowerCase(); + b = b.toLowerCase(); + if (a < b) return -1; + if (a > b) return +1; + return 0; + } + }; + +})(jQuery); diff --git a/media/js/joequery-Stupid-Table-Plugin/stupidtable.min.js b/media/js/joequery-Stupid-Table-Plugin/stupidtable.min.js new file mode 100644 index 00000000..f80299f1 --- /dev/null +++ b/media/js/joequery-Stupid-Table-Plugin/stupidtable.min.js @@ -0,0 +1,3 @@ +(function(d){d.fn.stupidtable=function(b){return this.each(function(){var a=d(this);b=b||{};b=d.extend({},d.fn.stupidtable.default_sort_fns,b);a.on("click","th",function(){var n=a.children("tbody").children("tr"),e=d(this),j=0,m=d.fn.stupidtable.dir;a.find("th").slice(0,e.index()).each(function(){var a=d(this).attr("colspan")||1;j+=parseInt(a,10)});var l=e.data("sort-dir")===m.ASC?m.DESC:m.ASC,p=l==m.DESC?e.data("sort-desc")||e.data("sort")||null:e.data("sort")||null;null!==p&&(a.trigger("beforetablesort", +{column:j,direction:l}),a.css("display"),setTimeout(function(){var k=[],c=b[p];n.each(function(a,b){var c=d(b).children().eq(j),e=c.data("sort-value"),c="undefined"!==typeof e?e:c.text();k.push(c)});var f=[],g=0;if(e.data("sort-dir")&&!e.data("sort-desc"))for(c=k.length-1;0<=c;c--)f.push(c);else for(var h=k.slice(0).sort(c),c=0;ca?1:0},"string-ins":function(b,a){b=b.toLowerCase();a=a.toLowerCase();return ba?1:0}}})(jQuery); diff --git a/media/js/jquery.min.js b/media/js/jquery.min.js new file mode 100644 index 00000000..16ad06c5 --- /dev/null +++ b/media/js/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 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 cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(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(;e=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)?+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.2",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!=null&&a==a.window},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){if(typeof c!="string"||!c)return null;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=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.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:p.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,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});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;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-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.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];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,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\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,g=p.selector),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&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?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));o.match.globalPOS=p;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|bdi|canvas|data|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:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],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){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},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){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.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(;d1&&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||f.isXMLDoc(a)||!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,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$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))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=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)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.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(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),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)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.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(bM,"")).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||bN.test(this.nodeName)||bH.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(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\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:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},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:bY(bS),ajaxTransport:bY(bT),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?ca(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=cb(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=bG.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(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.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]!=="*"?", "+bW+"; 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=bZ(bT,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)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.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(cd,l),b.url===j&&(e&&(k=k.replace(cd,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 ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,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,ce&&delete cg[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);try{m.text=h.responseText}catch(a){}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=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("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({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),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/pads/__init__.py b/pads/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pads/models.py b/pads/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/pads/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/pads/tests.py b/pads/tests.py new file mode 100644 index 00000000..501deb77 --- /dev/null +++ b/pads/tests.py @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase + + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) diff --git a/pads/views.py b/pads/views.py new file mode 100644 index 00000000..60f00ef0 --- /dev/null +++ b/pads/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/rezo/__init__.py b/rezo/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/rezo/models.py b/rezo/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/rezo/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/rezo/tests.py b/rezo/tests.py new file mode 100644 index 00000000..501deb77 --- /dev/null +++ b/rezo/tests.py @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase + + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) diff --git a/rezo/views.py b/rezo/views.py new file mode 100644 index 00000000..60f00ef0 --- /dev/null +++ b/rezo/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/static/admin/css/base.css b/static/admin/css/base.css new file mode 100644 index 00000000..1439b5d6 --- /dev/null +++ b/static/admin/css/base.css @@ -0,0 +1,840 @@ +/* + DJANGO Admin styles +*/ + +body { + margin: 0; + padding: 0; + font-size: 12px; + font-family: "Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; + color: #333; + background: #fff; +} + +/* LINKS */ + +a:link, a:visited { + color: #5b80b2; + text-decoration: none; +} + +a:hover { + color: #036; +} + +a img { + border: none; +} + +a.section:link, a.section:visited { + color: white; + text-decoration: none; +} + +/* GLOBAL DEFAULTS */ + +p, ol, ul, dl { + margin: .2em 0 .8em 0; +} + +p { + padding: 0; + line-height: 140%; +} + +h1,h2,h3,h4,h5 { + font-weight: bold; +} + +h1 { + font-size: 18px; + color: #666; + padding: 0 6px 0 0; + margin: 0 0 .2em 0; +} + +h2 { + font-size: 16px; + margin: 1em 0 .5em 0; +} + +h2.subhead { + font-weight: normal; + margin-top: 0; +} + +h3 { + font-size: 14px; + margin: .8em 0 .3em 0; + color: #666; + font-weight: bold; +} + +h4 { + font-size: 12px; + margin: 1em 0 .8em 0; + padding-bottom: 3px; +} + +h5 { + font-size: 10px; + margin: 1.5em 0 .5em 0; + color: #666; + text-transform: uppercase; + letter-spacing: 1px; +} + +ul li { + list-style-type: square; + padding: 1px 0; +} + +ul.plainlist { + margin-left: 0 !important; +} + +ul.plainlist li { + list-style-type: none; +} + +li ul { + margin-bottom: 0; +} + +li, dt, dd { + font-size: 11px; + line-height: 14px; +} + +dt { + font-weight: bold; + margin-top: 4px; +} + +dd { + margin-left: 0; +} + +form { + margin: 0; + padding: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +blockquote { + font-size: 11px; + color: #777; + margin-left: 2px; + padding-left: 10px; + border-left: 5px solid #ddd; +} + +code, pre { + font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; + background: inherit; + color: #666; + font-size: 11px; +} + +pre.literal-block { + margin: 10px; + background: #eee; + padding: 6px 8px; +} + +code strong { + color: #930; +} + +hr { + clear: both; + color: #eee; + background-color: #eee; + height: 1px; + border: none; + margin: 0; + padding: 0; + font-size: 1px; + line-height: 1px; +} + +/* TEXT STYLES & MODIFIERS */ + +.small { + font-size: 11px; +} + +.tiny { + font-size: 10px; +} + +p.tiny { + margin-top: -2px; +} + +.mini { + font-size: 9px; +} + +p.mini { + margin-top: -3px; +} + +.help, p.help { + font-size: 10px !important; + color: #999; +} + +img.help-tooltip { + cursor: help; +} + +p img, h1 img, h2 img, h3 img, h4 img, td img { + vertical-align: middle; +} + +.quiet, a.quiet:link, a.quiet:visited { + color: #999 !important; + font-weight: normal !important; +} + +.quiet strong { + font-weight: bold !important; +} + +.float-right { + float: right; +} + +.float-left { + float: left; +} + +.clear { + clear: both; +} + +.align-left { + text-align: left; +} + +.align-right { + text-align: right; +} + +.example { + margin: 10px 0; + padding: 5px 10px; + background: #efefef; +} + +.nowrap { + white-space: nowrap; +} + +/* TABLES */ + +table { + border-collapse: collapse; + border-color: #ccc; +} + +td, th { + font-size: 11px; + line-height: 13px; + border-bottom: 1px solid #eee; + vertical-align: top; + padding: 5px; + font-family: "Lucida Grande", Verdana, Arial, sans-serif; +} + +th { + text-align: left; + font-size: 12px; + font-weight: bold; +} + +thead th, +tfoot td { + color: #666; + padding: 2px 5px; + font-size: 11px; + background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; + border-left: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +tfoot td { + border-bottom: none; + border-top: 1px solid #ddd; +} + +thead th:first-child, +tfoot td:first-child { + border-left: none !important; +} + +thead th.optional { + font-weight: normal !important; +} + +fieldset table { + border-right: 1px solid #eee; +} + +tr.row-label td { + font-size: 9px; + padding-top: 2px; + padding-bottom: 0; + border-bottom: none; + color: #666; + margin-top: -1px; +} + +tr.alt { + background: #f6f6f6; +} + +.row1 { + background: #EDF3FE; +} + +.row2 { + background: white; +} + +/* SORTABLE TABLES */ + +thead th { + padding: 2px 5px; + line-height: normal; +} + +thead th a:link, thead th a:visited { + color: #666; +} + +thead th.sorted { + background: #c5c5c5 url(../img/nav-bg-selected.gif) top left repeat-x; +} + +thead th.sorted .text { + padding-right: 42px; +} + +table thead th .text span { + padding: 2px 5px; + display:block; +} + +table thead th .text a { + display: block; + cursor: pointer; + padding: 2px 5px; +} + +table thead th.sortable:hover { + background: white url(../img/nav-bg-reverse.gif) 0 -5px repeat-x; +} + +thead th.sorted a.sortremove { + visibility: hidden; +} + +table thead th.sorted:hover a.sortremove { + visibility: visible; +} + +table thead th.sorted .sortoptions { + display: block; + padding: 4px 5px 0 5px; + float: right; + text-align: right; +} + +table thead th.sorted .sortpriority { + font-size: .8em; + min-width: 12px; + text-align: center; + vertical-align: top; +} + +table thead th.sorted .sortoptions a { + width: 14px; + height: 12px; + display: inline-block; +} + +table thead th.sorted .sortoptions a.sortremove { + background: url(../img/sorting-icons.gif) -4px -5px no-repeat; +} + +table thead th.sorted .sortoptions a.sortremove:hover { + background: url(../img/sorting-icons.gif) -4px -27px no-repeat; +} + +table thead th.sorted .sortoptions a.ascending { + background: url(../img/sorting-icons.gif) -5px -50px no-repeat; +} + +table thead th.sorted .sortoptions a.ascending:hover { + background: url(../img/sorting-icons.gif) -5px -72px no-repeat; +} + +table thead th.sorted .sortoptions a.descending { + background: url(../img/sorting-icons.gif) -5px -94px no-repeat; +} + +table thead th.sorted .sortoptions a.descending:hover { + background: url(../img/sorting-icons.gif) -5px -115px no-repeat; +} + +/* ORDERABLE TABLES */ + +table.orderable tbody tr td:hover { + cursor: move; +} + +table.orderable tbody tr td:first-child { + padding-left: 14px; + background-image: url(../img/nav-bg-grabber.gif); + background-repeat: repeat-y; +} + +table.orderable-initalized .order-cell, body>tr>td.order-cell { + display: none; +} + +/* FORM DEFAULTS */ + +input, textarea, select, .form-row p { + margin: 2px 0; + padding: 2px 3px; + vertical-align: middle; + font-family: "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + font-size: 11px; +} + +textarea { + vertical-align: top !important; +} + +input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], +textarea, select, .vTextField { + border: 1px solid #ccc; +} + +/* FORM BUTTONS */ + +.button, input[type=submit], input[type=button], .submit-row input { + background: white url(../img/nav-bg.gif) bottom repeat-x; + padding: 3px 5px; + color: black; + border: 1px solid #bbb; + border-color: #ddd #aaa #aaa #ddd; +} + +.button:active, input[type=submit]:active, input[type=button]:active { + background-image: url(../img/nav-bg-reverse.gif); + background-position: top; +} + +.button[disabled], input[type=submit][disabled], input[type=button][disabled] { + background-image: url(../img/nav-bg.gif); + background-position: bottom; + opacity: 0.4; +} + +.button.default, input[type=submit].default, .submit-row input.default { + border: 2px solid #5b80b2; + background: #7CA0C7 url(../img/default-bg.gif) bottom repeat-x; + font-weight: bold; + color: white; + float: right; +} + +.button.default:active, input[type=submit].default:active { + background-image: url(../img/default-bg-reverse.gif); + background-position: top; +} + +.button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default { + background-image: url(../img/default-bg.gif); + background-position: bottom; + opacity: 0.4; +} + + +/* MODULES */ + +.module { + border: 1px solid #ccc; + margin-bottom: 5px; + background: white; +} + +.module p, .module ul, .module h3, .module h4, .module dl, .module pre { + padding-left: 10px; + padding-right: 10px; +} + +.module blockquote { + margin-left: 12px; +} + +.module ul, .module ol { + margin-left: 1.5em; +} + +.module h3 { + margin-top: .6em; +} + +.module h2, .module caption, .inline-group h2 { + margin: 0; + padding: 2px 5px 3px 5px; + font-size: 11px; + text-align: left; + font-weight: bold; + background: #7CA0C7 url(../img/default-bg.gif) top left repeat-x; + color: white; +} + +.module table { + border-collapse: collapse; +} + +/* MESSAGES & ERRORS */ + +ul.messagelist { + padding: 0 0 5px 0; + margin: 0; +} + +ul.messagelist li { + font-size: 12px; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border-bottom: 1px solid #ddd; + color: #666; + background: #ffc url(../img/icon_success.gif) 5px .3em no-repeat; +} + +ul.messagelist li.warning{ + background-image: url(../img/icon_alert.gif); +} + +ul.messagelist li.error{ + background-image: url(../img/icon_error.gif); +} + +.errornote { + font-size: 12px !important; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border: 1px solid red; + color: red; + background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat; +} + +ul.errorlist { + margin: 0 !important; + padding: 0 !important; +} + +.errorlist li { + font-size: 12px !important; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border: 1px solid red; + color: white; + background: red url(../img/icon_alert.gif) 5px .3em no-repeat; +} + +.errorlist li a { + color: white; + text-decoration: underline; +} + +td ul.errorlist { + margin: 0 !important; + padding: 0 !important; +} + +td ul.errorlist li { + margin: 0 !important; +} + +.errors { + background: #ffc; +} + +.errors input, .errors select, .errors textarea { + border: 1px solid red; +} + +div.system-message { + background: #ffc; + margin: 10px; + padding: 6px 8px; + font-size: .8em; +} + +div.system-message p.system-message-title { + padding: 4px 5px 4px 25px; + margin: 0; + color: red; + background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat; +} + +.description { + font-size: 12px; + padding: 5px 0 0 12px; +} + +/* BREADCRUMBS */ + +div.breadcrumbs { + background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; + padding: 2px 8px 3px 8px; + font-size: 11px; + color: #999; + border-top: 1px solid white; + border-bottom: 1px solid #ccc; + text-align: left; +} + +/* ACTION ICONS */ + +.addlink { + padding-left: 12px; + background: url(../img/icon_addlink.gif) 0 .2em no-repeat; +} + +.changelink { + padding-left: 12px; + background: url(../img/icon_changelink.gif) 0 .2em no-repeat; +} + +.deletelink { + padding-left: 12px; + background: url(../img/icon_deletelink.gif) 0 .25em no-repeat; +} + +a.deletelink:link, a.deletelink:visited { + color: #CC3434; +} + +a.deletelink:hover { + color: #993333; +} + +/* OBJECT TOOLS */ + +.object-tools { + font-size: 10px; + font-weight: bold; + font-family: Arial,Helvetica,sans-serif; + padding-left: 0; + float: right; + position: relative; + margin-top: -2.4em; + margin-bottom: -2em; +} + +.form-row .object-tools { + margin-top: 5px; + margin-bottom: 5px; + float: none; + height: 2em; + padding-left: 3.5em; +} + +.object-tools li { + display: block; + float: left; + background: url(../img/tool-left.gif) 0 0 no-repeat; + padding: 0 0 0 8px; + margin-left: 2px; + height: 16px; +} + +.object-tools li:hover { + background: url(../img/tool-left_over.gif) 0 0 no-repeat; +} + +.object-tools a:link, .object-tools a:visited { + display: block; + float: left; + color: white; + padding: .1em 14px .1em 8px; + height: 14px; + background: #999 url(../img/tool-right.gif) 100% 0 no-repeat; +} + +.object-tools a:hover, .object-tools li:hover a { + background: #5b80b2 url(../img/tool-right_over.gif) 100% 0 no-repeat; +} + +.object-tools a.viewsitelink, .object-tools a.golink { + background: #999 url(../img/tooltag-arrowright.gif) top right no-repeat; + padding-right: 28px; +} + +.object-tools a.viewsitelink:hover, .object-tools a.golink:hover { + background: #5b80b2 url(../img/tooltag-arrowright_over.gif) top right no-repeat; +} + +.object-tools a.addlink { + background: #999 url(../img/tooltag-add.gif) top right no-repeat; + padding-right: 28px; +} + +.object-tools a.addlink:hover { + background: #5b80b2 url(../img/tooltag-add_over.gif) top right no-repeat; +} + +/* OBJECT HISTORY */ + +table#change-history { + width: 100%; +} + +table#change-history tbody th { + width: 16em; +} + +/* PAGE STRUCTURE */ + +#container { + position: relative; + width: 100%; + min-width: 760px; + padding: 0; +} + +#content { + margin: 10px 15px; +} + +#header { + width: 100%; +} + +#content-main { + float: left; + width: 100%; +} + +#content-related { + float: right; + width: 18em; + position: relative; + margin-right: -19em; +} + +#footer { + clear: both; + padding: 10px; +} + +/* COLUMN TYPES */ + +.colMS { + margin-right: 20em !important; +} + +.colSM { + margin-left: 20em !important; +} + +.colSM #content-related { + float: left; + margin-right: 0; + margin-left: -19em; +} + +.colSM #content-main { + float: right; +} + +.popup .colM { + width: 95%; +} + +.subcol { + float: left; + width: 46%; + margin-right: 15px; +} + +.dashboard #content { + width: 500px; +} + +/* HEADER */ + +#header { + background: #417690; + color: #ffc; + overflow: hidden; +} + +#header a:link, #header a:visited { + color: white; +} + +#header a:hover { + text-decoration: underline; +} + +#branding h1 { + padding: 0 10px; + font-size: 18px; + margin: 8px 0; + font-weight: normal; + color: #f4f379; +} + +#branding h2 { + padding: 0 10px; + font-size: 14px; + margin: -8px 0 8px 0; + font-weight: normal; + color: #ffc; +} + +#user-tools { + position: absolute; + top: 0; + right: 0; + padding: 1.2em 10px; + font-size: 11px; + text-align: right; +} + +/* SIDEBAR */ + +#content-related h3 { + font-size: 12px; + color: #666; + margin-bottom: 3px; +} + +#content-related h4 { + font-size: 11px; +} + +#content-related .module h2 { + background: #eee url(../img/nav-bg.gif) bottom left repeat-x; + color: #666; +} + diff --git a/static/admin/css/changelists.css b/static/admin/css/changelists.css new file mode 100644 index 00000000..28021d02 --- /dev/null +++ b/static/admin/css/changelists.css @@ -0,0 +1,293 @@ +/* CHANGELISTS */ + +#changelist { + position: relative; + width: 100%; +} + +#changelist table { + width: 100%; +} + +.change-list .hiddenfields { display:none; } + +.change-list .filtered table { + border-right: 1px solid #ddd; +} + +.change-list .filtered { + min-height: 400px; +} + +.change-list .filtered { + background: white url(../img/changelist-bg.gif) top right repeat-y !important; +} + +.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 160px !important; + width: auto !important; +} + +.change-list .filtered table tbody th { + padding-right: 1em; +} + +#changelist-form .results { + overflow-x: auto; +} + +#changelist .toplinks { + border-bottom: 1px solid #ccc !important; +} + +#changelist .paginator { + color: #666; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + background: white url(../img/nav-bg.gif) 0 180% repeat-x; + overflow: hidden; +} + +.change-list .filtered .paginator { + border-right: 1px solid #ddd; +} + +/* CHANGELIST TABLES */ + +#changelist table thead th { + padding: 0; + white-space: nowrap; + vertical-align: middle; +} + +#changelist table thead th.action-checkbox-column { + width: 1.5em; + text-align: center; +} + +#changelist table tbody td, #changelist table tbody th { + border-left: 1px solid #ddd; +} + +#changelist table tbody td:first-child, #changelist table tbody th:first-child { + border-left: 0; + border-right: 1px solid #ddd; +} + +#changelist table tbody td.action-checkbox { + text-align:center; +} + +#changelist table tfoot { + color: #666; +} + +/* TOOLBAR */ + +#changelist #toolbar { + padding: 3px; + border-bottom: 1px solid #ddd; + background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; + color: #666; +} + +#changelist #toolbar form input { + font-size: 11px; + padding: 1px 2px; +} + +#changelist #toolbar form #searchbar { + padding: 2px; +} + +#changelist #changelist-search img { + vertical-align: middle; +} + +/* FILTER COLUMN */ + +#changelist-filter { + position: absolute; + top: 0; + right: 0; + z-index: 1000; + width: 160px; + border-left: 1px solid #ddd; + background: #efefef; + margin: 0; +} + +#changelist-filter h2 { + font-size: 11px; + padding: 2px 5px; + border-bottom: 1px solid #ddd; +} + +#changelist-filter h3 { + font-size: 12px; + margin-bottom: 0; +} + +#changelist-filter ul { + padding-left: 0; + margin-left: 10px; +} + +#changelist-filter li { + list-style-type: none; + margin-left: 0; + padding-left: 0; +} + +#changelist-filter a { + color: #999; +} + +#changelist-filter a:hover { + color: #036; +} + +#changelist-filter li.selected { + border-left: 5px solid #ccc; + padding-left: 5px; + margin-left: -10px; +} + +#changelist-filter li.selected a { + color: #5b80b2 !important; +} + +/* DATE DRILLDOWN */ + +.change-list ul.toplinks { + display: block; + background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; + border-top: 1px solid white; + float: left; + padding: 0 !important; + margin: 0 !important; + width: 100%; +} + +.change-list ul.toplinks li { + padding: 3px 6px; + font-weight: bold; + list-style-type: none; + display: inline-block; +} + +.change-list ul.toplinks .date-back a { + color: #999; +} + +.change-list ul.toplinks .date-back a:hover { + color: #036; +} + +/* PAGINATOR */ + +.paginator { + font-size: 11px; + padding-top: 10px; + padding-bottom: 10px; + line-height: 22px; + margin: 0; + border-top: 1px solid #ddd; +} + +.paginator a:link, .paginator a:visited { + padding: 2px 6px; + border: solid 1px #ccc; + background: white; + text-decoration: none; +} + +.paginator a.showall { + padding: 0 !important; + border: none !important; +} + +.paginator a.showall:hover { + color: #036 !important; + background: transparent !important; +} + +.paginator .end { + border-width: 2px !important; + margin-right: 6px; +} + +.paginator .this-page { + padding: 2px 6px; + font-weight: bold; + font-size: 13px; + vertical-align: top; +} + +.paginator a:hover { + color: white; + background: #5b80b2; + border-color: #036; +} + +/* ACTIONS */ + +.filtered .actions { + margin-right: 160px !important; + border-right: 1px solid #ddd; +} + +#changelist table input { + margin: 0; +} + +#changelist table tbody tr.selected { + background-color: #FFFFCC; +} + +#changelist .actions { + color: #999; + padding: 3px; + border-top: 1px solid #fff; + border-bottom: 1px solid #ddd; + background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; +} + +#changelist .actions.selected { + background: #fffccf; + border-top: 1px solid #fffee8; + border-bottom: 1px solid #edecd6; +} + +#changelist .actions span.all, +#changelist .actions span.action-counter, +#changelist .actions span.clear, +#changelist .actions span.question { + font-size: 11px; + margin: 0 0.5em; + display: none; +} + +#changelist .actions:last-child { + border-bottom: none; +} + +#changelist .actions select { + border: 1px solid #aaa; + margin-left: 0.5em; + padding: 1px 2px; +} + +#changelist .actions label { + font-size: 11px; + margin-left: 0.5em; +} + +#changelist #action-toggle { + display: none; +} + +#changelist .actions .button { + font-size: 11px; + padding: 1px 2px; +} diff --git a/static/admin/css/dashboard.css b/static/admin/css/dashboard.css new file mode 100644 index 00000000..05808bcb --- /dev/null +++ b/static/admin/css/dashboard.css @@ -0,0 +1,30 @@ +/* DASHBOARD */ + +.dashboard .module table th { + width: 100%; +} + +.dashboard .module table td { + white-space: nowrap; +} + +.dashboard .module table td a { + display: block; + padding-right: .6em; +} + +/* RECENT ACTIONS MODULE */ + +.module ul.actionlist { + margin-left: 0; +} + +ul.actionlist li { + list-style-type: none; +} + +ul.actionlist li { + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; +} diff --git a/static/admin/css/forms.css b/static/admin/css/forms.css new file mode 100644 index 00000000..4885f625 --- /dev/null +++ b/static/admin/css/forms.css @@ -0,0 +1,364 @@ +@import url('widgets.css'); + +/* FORM ROWS */ + +.form-row { + overflow: hidden; + padding: 8px 12px; + font-size: 11px; + border-bottom: 1px solid #eee; +} + +.form-row img, .form-row input { + vertical-align: middle; +} + +form .form-row p { + padding-left: 0; + font-size: 11px; +} + +/* FORM LABELS */ + +form h4 { + margin: 0 !important; + padding: 0 !important; + border: none !important; +} + +label { + font-weight: normal !important; + color: #666; + font-size: 12px; +} + +.required label, label.required { + font-weight: bold !important; + color: #333 !important; +} + +/* RADIO BUTTONS */ + +form ul.radiolist li { + list-style-type: none; +} + +form ul.radiolist label { + float: none; + display: inline; +} + +form ul.inline { + margin-left: 0; + padding: 0; +} + +form ul.inline li { + float: left; + padding-right: 7px; +} + +/* ALIGNED FIELDSETS */ + +.aligned label { + display: block; + padding: 3px 10px 0 0; + float: left; + width: 8em; + word-wrap: break-word; +} + +.aligned ul label { + display: inline; + float: none; + width: auto; +} + +.colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { + width: 350px; +} + +form .aligned p, form .aligned ul { + margin-left: 7em; + padding-left: 30px; +} + +form .aligned table p { + margin-left: 0; + padding-left: 0; +} + +form .aligned p.help { + padding-left: 38px; +} + +.aligned .vCheckboxLabel { + float: none !important; + display: inline; + padding-left: 4px; +} + +.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField { + width: 610px; +} + +.checkbox-row p.help { + margin-left: 0; + padding-left: 0 !important; +} + +fieldset .field-box { + float: left; + margin-right: 20px; +} + +/* WIDE FIELDSETS */ + +.wide label { + width: 15em !important; +} + +form .wide p { + margin-left: 15em; +} + +form .wide p.help { + padding-left: 38px; +} + +.colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField { + width: 450px; +} + +/* COLLAPSED FIELDSETS */ + +fieldset.collapsed * { + display: none; +} + +fieldset.collapsed h2, fieldset.collapsed { + display: block !important; +} + +fieldset.collapsed h2 { + background-image: url(../img/nav-bg.gif); + background-position: bottom left; + color: #999; +} + +fieldset.collapsed .collapse-toggle { + background: transparent; + display: inline !important; +} + +/* MONOSPACE TEXTAREAS */ + +fieldset.monospace textarea { + font-family: "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace; +} + +/* SUBMIT ROW */ + +.submit-row { + padding: 5px 7px; + text-align: right; + background: white url(../img/nav-bg.gif) 0 100% repeat-x; + border: 1px solid #ccc; + margin: 5px 0; + overflow: hidden; +} + +body.popup .submit-row { + overflow: auto; +} + +.submit-row input { + margin: 0 0 0 5px; +} + +.submit-row p { + margin: 0.3em; +} + +.submit-row p.deletelink-box { + float: left; +} + +.submit-row .deletelink { + background: url(../img/icon_deletelink.gif) 0 50% no-repeat; + padding-left: 14px; +} + +/* CUSTOM FORM FIELDS */ + +.vSelectMultipleField { + vertical-align: top !important; +} + +.vCheckboxField { + border: none; +} + +.vDateField, .vTimeField { + margin-right: 2px; +} + +.vURLField { + width: 30em; +} + +.vLargeTextField, .vXMLLargeTextField { + width: 48em; +} + +.flatpages-flatpage #id_content { + height: 40.2em; +} + +.module table .vPositiveSmallIntegerField { + width: 2.2em; +} + +.vTextField { + width: 20em; +} + +.vIntegerField { + width: 5em; +} + +.vBigIntegerField { + width: 10em; +} + +.vForeignKeyRawIdAdminField { + width: 5em; +} + +/* INLINES */ + +.inline-group { + padding: 0; + border: 1px solid #ccc; + margin: 10px 0; +} + +.inline-group .aligned label { + width: 8em; +} + +.inline-related { + position: relative; +} + +.inline-related h3 { + margin: 0; + color: #666; + padding: 3px 5px; + font-size: 11px; + background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; + border-bottom: 1px solid #ddd; +} + +.inline-related h3 span.delete { + float: right; +} + +.inline-related h3 span.delete label { + margin-left: 2px; + font-size: 11px; +} + +.inline-related fieldset { + margin: 0; + background: #fff; + border: none; + width: 100%; +} + +.inline-related fieldset.module h3 { + margin: 0; + padding: 2px 5px 3px 5px; + font-size: 11px; + text-align: left; + font-weight: bold; + background: #bcd; + color: #fff; +} + +.inline-group .tabular fieldset.module { + border: none; + border-bottom: 1px solid #ddd; +} + +.inline-related.tabular fieldset.module table { + width: 100%; +} + +.last-related fieldset { + border: none; +} + +.inline-group .tabular tr.has_original td { + padding-top: 2em; +} + +.inline-group .tabular tr td.original { + padding: 2px 0 0 0; + width: 0; + _position: relative; +} + +.inline-group .tabular th.original { + width: 0px; + padding: 0; +} + +.inline-group .tabular td.original p { + position: absolute; + left: 0; + height: 1.1em; + padding: 2px 7px; + overflow: hidden; + font-size: 9px; + font-weight: bold; + color: #666; + _width: 700px; +} + +.inline-group ul.tools { + padding: 0; + margin: 0; + list-style: none; +} + +.inline-group ul.tools li { + display: inline; + padding: 0 5px; +} + +.inline-group div.add-row, +.inline-group .tabular tr.add-row td { + color: #666; + padding: 3px 5px; + border-bottom: 1px solid #ddd; + background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; +} + +.inline-group .tabular tr.add-row td { + padding: 4px 5px 3px; + border-bottom: none; +} + +.inline-group ul.tools a.add, +.inline-group div.add-row a, +.inline-group .tabular tr.add-row td a { + background: url(../img/icon_addlink.gif) 0 50% no-repeat; + padding-left: 14px; + font-size: 11px; + outline: 0; /* Remove dotted border around link */ +} + +.empty-form { + display: none; +} diff --git a/static/admin/css/ie.css b/static/admin/css/ie.css new file mode 100644 index 00000000..fd00f7f2 --- /dev/null +++ b/static/admin/css/ie.css @@ -0,0 +1,63 @@ +/* IE 6 & 7 */ + +/* Proper fixed width for dashboard in IE6 */ + +.dashboard #content { + *width: 768px; +} + +.dashboard #content-main { + *width: 535px; +} + +/* IE 6 ONLY */ + +/* Keep header from flowing off the page */ + +#container { + _position: static; +} + +/* Put the right sidebars back on the page */ + +.colMS #content-related { + _margin-right: 0; + _margin-left: 10px; + _position: static; +} + +/* Put the left sidebars back on the page */ + +.colSM #content-related { + _margin-right: 10px; + _margin-left: -115px; + _position: static; +} + +.form-row { + _height: 1%; +} + +/* Fix right margin for changelist filters in IE6 */ + +#changelist-filter ul { + _margin-right: -10px; +} + +/* IE ignores min-height, but treats height as if it were min-height */ + +.change-list .filtered { + _height: 400px; +} + +/* IE doesn't know alpha transparency in PNGs */ + +.inline-deletelink { + background: transparent url(../img/inline-delete-8bit.png) no-repeat; +} + +/* IE7 doesn't support inline-block */ +.change-list ul.toplinks li { + zoom: 1; + *display: inline; +} \ No newline at end of file diff --git a/static/admin/css/login.css b/static/admin/css/login.css new file mode 100644 index 00000000..a91de117 --- /dev/null +++ b/static/admin/css/login.css @@ -0,0 +1,60 @@ +/* LOGIN FORM */ + +body.login { + background: #eee; +} + +.login #container { + background: white; + border: 1px solid #ccc; + width: 28em; + min-width: 300px; + margin-left: auto; + margin-right: auto; + margin-top: 100px; +} + +.login #content-main { + width: 100%; +} + +.login form { + margin-top: 1em; +} + +.login .form-row { + padding: 4px 0; + float: left; + width: 100%; +} + +.login .form-row label { + padding-right: 0.5em; + line-height: 2em; + font-size: 1em; + clear: both; + color: #333; +} + +.login .form-row #id_username, .login .form-row #id_password { + clear: both; + padding: 6px; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.login span.help { + font-size: 10px; + display: block; +} + +.login .submit-row { + clear: both; + padding: 1em 0 0 9.4em; +} + +.login .password-reset-link { + text-align: center; +} diff --git a/static/admin/css/rtl.css b/static/admin/css/rtl.css new file mode 100644 index 00000000..ba9f1b5a --- /dev/null +++ b/static/admin/css/rtl.css @@ -0,0 +1,250 @@ +body { + direction: rtl; +} + +/* LOGIN */ + +.login .form-row { + float: right; +} + +.login .form-row label { + float: right; + padding-left: 0.5em; + padding-right: 0; + text-align: left; +} + +.login .submit-row { + clear: both; + padding: 1em 9.4em 0 0; +} + +/* GLOBAL */ + +th { + text-align: right; +} + +.module h2, .module caption { + text-align: right; +} + +.addlink, .changelink { + padding-left: 0px; + padding-right: 12px; + background-position: 100% 0.2em; +} + +.deletelink { + padding-left: 0px; + padding-right: 12px; + background-position: 100% 0.25em; +} + +.object-tools { + float: left; +} + +thead th:first-child, +tfoot td:first-child { + border-left: 1px solid #ddd !important; +} + +/* LAYOUT */ + +#user-tools { + right: auto; + left: 0; + text-align: left; +} + +div.breadcrumbs { + text-align: right; +} + +#content-main { + float: right; +} + +#content-related { + float: left; + margin-left: -19em; + margin-right: auto; +} + +.colMS { + margin-left: 20em !important; + margin-right: 10px !important; +} + +/* SORTABLE TABLES */ + +table thead th.sorted .sortoptions { + float: left; +} + +thead th.sorted .text { + padding-right: 0; + padding-left: 42px; +} + +/* dashboard styles */ + +.dashboard .module table td a { + padding-left: .6em; + padding-right: 12px; +} + +/* changelists styles */ + +.change-list .filtered { + background: white url(../img/changelist-bg_rtl.gif) top left repeat-y !important; +} + +.change-list .filtered table { + border-left: 1px solid #ddd; + border-right: 0px none; +} + +#changelist-filter { + right: auto; + left: 0; + border-left: 0px none; + border-right: 1px solid #ddd; +} + +.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 0px !important; + margin-left: 160px !important; +} + +#changelist-filter li.selected { + border-left: 0px none; + padding-left: 0px; + margin-left: 0; + border-right: 5px solid #ccc; + padding-right: 5px; + margin-right: -10px; +} + +.filtered .actions { + border-left:1px solid #DDDDDD; + margin-left:160px !important; + border-right: 0 none; + margin-right:0 !important; +} + +#changelist table tbody td:first-child, #changelist table tbody th:first-child { + border-right: 0; + border-left: 1px solid #ddd; +} + +/* FORMS */ + +.aligned label { + padding: 0 0 3px 1em; + float: right; +} + +.submit-row { + text-align: left +} + +.submit-row p.deletelink-box { + float: right; +} + +.submit-row .deletelink { + background: url(../img/icon_deletelink.gif) 0 50% no-repeat; + padding-right: 14px; +} + +.vDateField, .vTimeField { + margin-left: 2px; +} + +form ul.inline li { + float: right; + padding-right: 0; + padding-left: 7px; +} + +input[type=submit].default, .submit-row input.default { + float: left; +} + +fieldset .field-box { + float: right; + margin-left: 20px; + margin-right: 0; +} + +.errorlist li { + background-position: 100% .3em; + padding: 4px 25px 4px 5px; +} + +.errornote { + background-position: 100% .3em; + padding: 4px 25px 4px 5px; +} + +/* WIDGETS */ + +.calendarnav-previous { + top: 0; + left: auto; + right: 0; +} + +.calendarnav-next { + top: 0; + right: auto; + left: 0; +} + +.calendar caption, .calendarbox h2 { + text-align: center; +} + +.selector { + float: right; +} + +.selector .selector-filter { + text-align: right; +} + +.inline-deletelink { + float: left; +} + +/* MISC */ + +.inline-related h2, .inline-group h2 { + text-align: right +} + +.inline-related h3 span.delete { + padding-right: 20px; + padding-left: inherit; + left: 10px; + right: inherit; + float:left; +} + +.inline-related h3 span.delete label { + margin-left: inherit; + margin-right: 2px; +} + +/* IE7 specific bug fixes */ + +div.colM { + position: relative; +} + +.submit-row input { + float: left; +} \ No newline at end of file diff --git a/static/admin/css/widgets.css b/static/admin/css/widgets.css new file mode 100644 index 00000000..d61cd3a2 --- /dev/null +++ b/static/admin/css/widgets.css @@ -0,0 +1,578 @@ +/* SELECTOR (FILTER INTERFACE) */ + +.selector { + width: 840px; + float: left; +} + +.selector select { + width: 400px; + height: 17.2em; +} + +.selector-available, .selector-chosen { + float: left; + width: 400px; + text-align: center; + margin-bottom: 5px; +} + +.selector-chosen select { + border-top: none; +} + +.selector-available h2, .selector-chosen h2 { + border: 1px solid #ccc; +} + +.selector .selector-available h2 { + background: white url(../img/nav-bg.gif) bottom left repeat-x; + color: #666; +} + +.selector .selector-filter { + background: white; + border: 1px solid #ccc; + border-width: 0 1px; + padding: 3px; + color: #999; + font-size: 10px; + margin: 0; + text-align: left; +} + +.selector .selector-filter label, +.inline-group .aligned .selector .selector-filter label { + width: 16px; + padding: 2px; +} + +.selector .selector-available input { + width: 360px; +} + +.selector ul.selector-chooser { + float: left; + width: 22px; + height: 50px; + background: url(../img/chooser-bg.gif) top center no-repeat; + margin: 10em 5px 0 5px; + padding: 0; +} + +.selector-chooser li { + margin: 0; + padding: 3px; + list-style-type: none; +} + +.selector select { + margin-bottom: 10px; + margin-top: 0; +} + +.selector-add, .selector-remove { + width: 16px; + height: 16px; + display: block; + text-indent: -3000px; + overflow: hidden; +} + +.selector-add { + background: url(../img/selector-icons.gif) 0 -161px no-repeat; + cursor: default; + margin-bottom: 2px; +} + +.active.selector-add { + background: url(../img/selector-icons.gif) 0 -187px no-repeat; + cursor: pointer; +} + +.selector-remove { + background: url(../img/selector-icons.gif) 0 -109px no-repeat; + cursor: default; +} + +.active.selector-remove { + background: url(../img/selector-icons.gif) 0 -135px no-repeat; + cursor: pointer; +} + +a.selector-chooseall, a.selector-clearall { + display: inline-block; + text-align: left; + margin-left: auto; + margin-right: auto; + font-weight: bold; + color: #666; +} + +a.selector-chooseall { + padding: 3px 18px 3px 0; +} + +a.selector-clearall { + padding: 3px 0 3px 18px; +} + +a.active.selector-chooseall:hover, a.active.selector-clearall:hover { + color: #036; +} + +a.selector-chooseall { + background: url(../img/selector-icons.gif) right -263px no-repeat; + cursor: default; +} + +a.active.selector-chooseall { + background: url(../img/selector-icons.gif) right -289px no-repeat; + cursor: pointer; +} + +a.selector-clearall { + background: url(../img/selector-icons.gif) left -211px no-repeat; + cursor: default; +} + +a.active.selector-clearall { + background: url(../img/selector-icons.gif) left -237px no-repeat; + cursor: pointer; +} + +/* STACKED SELECTORS */ + +.stacked { + float: left; + width: 500px; +} + +.stacked select { + width: 480px; + height: 10.1em; +} + +.stacked .selector-available, .stacked .selector-chosen { + width: 480px; +} + +.stacked .selector-available { + margin-bottom: 0; +} + +.stacked .selector-available input { + width: 442px; +} + +.stacked ul.selector-chooser { + height: 22px; + width: 50px; + margin: 0 0 3px 40%; + background: url(../img/chooser_stacked-bg.gif) top center no-repeat; +} + +.stacked .selector-chooser li { + float: left; + padding: 3px 3px 3px 5px; +} + +.stacked .selector-chooseall, .stacked .selector-clearall { + display: none; +} + +.stacked .selector-add { + background: url(../img/selector-icons.gif) 0 -57px no-repeat; + cursor: default; +} + +.stacked .active.selector-add { + background: url(../img/selector-icons.gif) 0 -83px no-repeat; + cursor: pointer; +} + +.stacked .selector-remove { + background: url(../img/selector-icons.gif) 0 -5px no-repeat; + cursor: default; +} + +.stacked .active.selector-remove { + background: url(../img/selector-icons.gif) 0 -31px no-repeat; + cursor: pointer; +} + +/* DATE AND TIME */ + +p.datetime { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.datetime span { + font-size: 11px; + color: #ccc; + font-weight: normal; + white-space: nowrap; +} + +table p.datetime { + font-size: 10px; + margin-left: 0; + padding-left: 0; +} + +/* URL */ + +p.url { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.url a { + font-weight: normal; +} + +/* FILE UPLOADS */ + +p.file-upload { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.file-upload a { + font-weight: normal; +} + +.file-upload .deletelink { + margin-left: 5px; +} + +span.clearable-file-input label { + color: #333; + font-size: 11px; + display: inline; + float: none; +} + +/* CALENDARS & CLOCKS */ + +.calendarbox, .clockbox { + margin: 5px auto; + font-size: 11px; + width: 16em; + text-align: center; + background: white; + position: relative; +} + +.clockbox { + width: auto; +} + +.calendar { + margin: 0; + padding: 0; +} + +.calendar table { + margin: 0; + padding: 0; + border-collapse: collapse; + background: white; + width: 100%; +} + +.calendar caption, .calendarbox h2 { + margin: 0; + font-size: 11px; + text-align: center; + border-top: none; +} + +.calendar th { + font-size: 10px; + color: #666; + padding: 2px 3px; + text-align: center; + background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x; + border-bottom: 1px solid #ddd; +} + +.calendar td { + font-size: 11px; + text-align: center; + padding: 0; + border-top: 1px solid #eee; + border-bottom: none; +} + +.calendar td.selected a { + background: #C9DBED; +} + +.calendar td.nonday { + background: #efefef; +} + +.calendar td.today a { + background: #ffc; +} + +.calendar td a, .timelist a { + display: block; + font-weight: bold; + padding: 4px; + text-decoration: none; + color: #444; +} + +.calendar td a:hover, .timelist a:hover { + background: #5b80b2; + color: white; +} + +.calendar td a:active, .timelist a:active { + background: #036; + color: white; +} + +.calendarnav { + font-size: 10px; + text-align: center; + color: #ccc; + margin: 0; + padding: 1px 3px; +} + +.calendarnav a:link, #calendarnav a:visited, #calendarnav a:hover { + color: #999; +} + +.calendar-shortcuts { + background: white; + font-size: 10px; + line-height: 11px; + border-top: 1px solid #eee; + padding: 3px 0 4px; + color: #ccc; +} + +.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { + display: block; + position: absolute; + font-weight: bold; + font-size: 12px; + background: #C9DBED url(../img/default-bg.gif) bottom left repeat-x; + padding: 1px 4px 2px 4px; + color: white; +} + +.calendarnav-previous:hover, .calendarnav-next:hover { + background: #036; +} + +.calendarnav-previous { + top: 0; + left: 0; +} + +.calendarnav-next { + top: 0; + right: 0; +} + +.calendar-cancel { + margin: 0 !important; + padding: 0 !important; + font-size: 10px; + background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x; + border-top: 1px solid #ddd; +} + +.calendar-cancel:hover { + background: #e1e1e1 url(../img/nav-bg-reverse.gif) 0 50% repeat-x; +} + +.calendar-cancel a { + color: black; + display: block; +} + +ul.timelist, .timelist li { + list-style-type: none; + margin: 0; + padding: 0; +} + +.timelist a { + padding: 2px; +} + +/* INLINE ORDERER */ + +ul.orderer { + position: relative; + padding: 0 !important; + margin: 0 !important; + list-style-type: none; +} + +ul.orderer li { + list-style-type: none; + display: block; + padding: 0; + margin: 0; + border: 1px solid #bbb; + border-width: 0 1px 1px 0; + white-space: nowrap; + overflow: hidden; + background: #e2e2e2 url(../img/nav-bg-grabber.gif) repeat-y; +} + +ul.orderer li:hover { + cursor: move; + background-color: #ddd; +} + +ul.orderer li a.selector { + margin-left: 12px; + overflow: hidden; + width: 83%; + font-size: 10px !important; + padding: 0.6em 0; +} + +ul.orderer li a:link, ul.orderer li a:visited { + color: #333; +} + +ul.orderer li .inline-deletelink { + position: absolute; + right: 4px; + margin-top: 0.6em; +} + +ul.orderer li.selected { + background-color: #f8f8f8; + border-right-color: #f8f8f8; +} + +ul.orderer li.deleted { + background: #bbb url(../img/deleted-overlay.gif); +} + +ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited { + color: #888; +} + +ul.orderer li.deleted .inline-deletelink { + background-image: url(../img/inline-restore.png); +} + +ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { + cursor: default; +} + +/* EDIT INLINE */ + +.inline-deletelink { + float: right; + text-indent: -9999px; + background: transparent url(../img/inline-delete.png) no-repeat; + width: 15px; + height: 15px; + border: 0px none; + outline: 0; /* Remove dotted border around link */ +} + +.inline-deletelink:hover { + background-position: -15px 0; + cursor: pointer; +} + +.editinline button.addlink { + border: 0px none; + color: #5b80b2; + font-size: 100%; + cursor: pointer; +} + +.editinline button.addlink:hover { + color: #036; + cursor: pointer; +} + +.editinline table .help { + text-align: right; + float: right; + padding-left: 2em; +} + +.editinline tfoot .addlink { + white-space: nowrap; +} + +.editinline table thead th:last-child { + border-left: none; +} + +.editinline tr.deleted { + background: #ddd url(../img/deleted-overlay.gif); +} + +.editinline tr.deleted .inline-deletelink { + background-image: url(../img/inline-restore.png); +} + +.editinline tr.deleted td:hover { + cursor: default; +} + +.editinline tr.deleted td:first-child { + background-image: none !important; +} + +/* EDIT INLINE - STACKED */ + +.editinline-stacked { + min-width: 758px; +} + +.editinline-stacked .inline-object { + margin-left: 210px; + background: white; +} + +.editinline-stacked .inline-source { + float: left; + width: 200px; + background: #f8f8f8; +} + +.editinline-stacked .inline-splitter { + float: left; + width: 9px; + background: #f8f8f8 url(../img/inline-splitter-bg.gif) 50% 50% no-repeat; + border-right: 1px solid #ccc; +} + +.editinline-stacked .controls { + clear: both; + background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; + padding: 3px 4px; + font-size: 11px; + border-top: 1px solid #ddd; +} + diff --git a/static/admin/img/admin/arrow-down.gif b/static/admin/img/admin/arrow-down.gif new file mode 100644 index 00000000..a967b9fd Binary files /dev/null and b/static/admin/img/admin/arrow-down.gif differ diff --git a/static/admin/img/admin/arrow-up.gif b/static/admin/img/admin/arrow-up.gif new file mode 100644 index 00000000..3fe48513 Binary files /dev/null and b/static/admin/img/admin/arrow-up.gif differ diff --git a/static/admin/img/admin/changelist-bg.gif b/static/admin/img/admin/changelist-bg.gif new file mode 100644 index 00000000..7f469947 Binary files /dev/null and b/static/admin/img/admin/changelist-bg.gif differ diff --git a/static/admin/img/admin/changelist-bg_rtl.gif b/static/admin/img/admin/changelist-bg_rtl.gif new file mode 100644 index 00000000..23797125 Binary files /dev/null and b/static/admin/img/admin/changelist-bg_rtl.gif differ diff --git a/static/admin/img/admin/chooser-bg.gif b/static/admin/img/admin/chooser-bg.gif new file mode 100644 index 00000000..30e83c25 Binary files /dev/null and b/static/admin/img/admin/chooser-bg.gif differ diff --git a/static/admin/img/admin/chooser_stacked-bg.gif b/static/admin/img/admin/chooser_stacked-bg.gif new file mode 100644 index 00000000..5d104b6d Binary files /dev/null and b/static/admin/img/admin/chooser_stacked-bg.gif differ diff --git a/static/admin/img/admin/default-bg-reverse.gif b/static/admin/img/admin/default-bg-reverse.gif new file mode 100644 index 00000000..0873281e Binary files /dev/null and b/static/admin/img/admin/default-bg-reverse.gif differ diff --git a/static/admin/img/admin/default-bg.gif b/static/admin/img/admin/default-bg.gif new file mode 100644 index 00000000..003aeca5 Binary files /dev/null and b/static/admin/img/admin/default-bg.gif differ diff --git a/static/admin/img/admin/deleted-overlay.gif b/static/admin/img/admin/deleted-overlay.gif new file mode 100644 index 00000000..dc3828fe Binary files /dev/null and b/static/admin/img/admin/deleted-overlay.gif differ diff --git a/static/admin/img/admin/icon-no.gif b/static/admin/img/admin/icon-no.gif new file mode 100644 index 00000000..1b4ee581 Binary files /dev/null and b/static/admin/img/admin/icon-no.gif differ diff --git a/static/admin/img/admin/icon-unknown.gif b/static/admin/img/admin/icon-unknown.gif new file mode 100644 index 00000000..cfd2b02a Binary files /dev/null and b/static/admin/img/admin/icon-unknown.gif differ diff --git a/static/admin/img/admin/icon-yes.gif b/static/admin/img/admin/icon-yes.gif new file mode 100644 index 00000000..73992827 Binary files /dev/null and b/static/admin/img/admin/icon-yes.gif differ diff --git a/static/admin/img/admin/icon_addlink.gif b/static/admin/img/admin/icon_addlink.gif new file mode 100644 index 00000000..ee70e1ad Binary files /dev/null and b/static/admin/img/admin/icon_addlink.gif differ diff --git a/static/admin/img/admin/icon_alert.gif b/static/admin/img/admin/icon_alert.gif new file mode 100644 index 00000000..a1dde262 Binary files /dev/null and b/static/admin/img/admin/icon_alert.gif differ diff --git a/static/admin/img/admin/icon_calendar.gif b/static/admin/img/admin/icon_calendar.gif new file mode 100644 index 00000000..7587b305 Binary files /dev/null and b/static/admin/img/admin/icon_calendar.gif differ diff --git a/static/admin/img/admin/icon_changelink.gif b/static/admin/img/admin/icon_changelink.gif new file mode 100644 index 00000000..e1b9afde Binary files /dev/null and b/static/admin/img/admin/icon_changelink.gif differ diff --git a/static/admin/img/admin/icon_clock.gif b/static/admin/img/admin/icon_clock.gif new file mode 100644 index 00000000..ff2d57e0 Binary files /dev/null and b/static/admin/img/admin/icon_clock.gif differ diff --git a/static/admin/img/admin/icon_deletelink.gif b/static/admin/img/admin/icon_deletelink.gif new file mode 100644 index 00000000..72523e3a Binary files /dev/null and b/static/admin/img/admin/icon_deletelink.gif differ diff --git a/static/admin/img/admin/icon_error.gif b/static/admin/img/admin/icon_error.gif new file mode 100644 index 00000000..3730a00b Binary files /dev/null and b/static/admin/img/admin/icon_error.gif differ diff --git a/static/admin/img/admin/icon_searchbox.png b/static/admin/img/admin/icon_searchbox.png new file mode 100644 index 00000000..f87f308f Binary files /dev/null and b/static/admin/img/admin/icon_searchbox.png differ diff --git a/static/admin/img/admin/icon_success.gif b/static/admin/img/admin/icon_success.gif new file mode 100644 index 00000000..5cf90a15 Binary files /dev/null and b/static/admin/img/admin/icon_success.gif differ diff --git a/static/admin/img/admin/inline-delete-8bit.png b/static/admin/img/admin/inline-delete-8bit.png new file mode 100644 index 00000000..01ade88c Binary files /dev/null and b/static/admin/img/admin/inline-delete-8bit.png differ diff --git a/static/admin/img/admin/inline-delete.png b/static/admin/img/admin/inline-delete.png new file mode 100644 index 00000000..c5fe53c4 Binary files /dev/null and b/static/admin/img/admin/inline-delete.png differ diff --git a/static/admin/img/admin/inline-restore-8bit.png b/static/admin/img/admin/inline-restore-8bit.png new file mode 100644 index 00000000..d29fe1da Binary files /dev/null and b/static/admin/img/admin/inline-restore-8bit.png differ diff --git a/static/admin/img/admin/inline-restore.png b/static/admin/img/admin/inline-restore.png new file mode 100644 index 00000000..2a677888 Binary files /dev/null and b/static/admin/img/admin/inline-restore.png differ diff --git a/static/admin/img/admin/inline-splitter-bg.gif b/static/admin/img/admin/inline-splitter-bg.gif new file mode 100644 index 00000000..32ac5b34 Binary files /dev/null and b/static/admin/img/admin/inline-splitter-bg.gif differ diff --git a/static/admin/img/admin/nav-bg-grabber.gif b/static/admin/img/admin/nav-bg-grabber.gif new file mode 100644 index 00000000..0a784fa7 Binary files /dev/null and b/static/admin/img/admin/nav-bg-grabber.gif differ diff --git a/static/admin/img/admin/nav-bg-reverse.gif b/static/admin/img/admin/nav-bg-reverse.gif new file mode 100644 index 00000000..f11029f9 Binary files /dev/null and b/static/admin/img/admin/nav-bg-reverse.gif differ diff --git a/static/admin/img/admin/nav-bg.gif b/static/admin/img/admin/nav-bg.gif new file mode 100644 index 00000000..f8402b80 Binary files /dev/null and b/static/admin/img/admin/nav-bg.gif differ diff --git a/static/admin/img/admin/selector-add.gif b/static/admin/img/admin/selector-add.gif new file mode 100644 index 00000000..50132d1c Binary files /dev/null and b/static/admin/img/admin/selector-add.gif differ diff --git a/static/admin/img/admin/selector-addall.gif b/static/admin/img/admin/selector-addall.gif new file mode 100644 index 00000000..d6e7c639 Binary files /dev/null and b/static/admin/img/admin/selector-addall.gif differ diff --git a/static/admin/img/admin/selector-remove.gif b/static/admin/img/admin/selector-remove.gif new file mode 100644 index 00000000..2b9b0a2a Binary files /dev/null and b/static/admin/img/admin/selector-remove.gif differ diff --git a/static/admin/img/admin/selector-removeall.gif b/static/admin/img/admin/selector-removeall.gif new file mode 100644 index 00000000..5a442192 Binary files /dev/null and b/static/admin/img/admin/selector-removeall.gif differ diff --git a/static/admin/img/admin/selector-search.gif b/static/admin/img/admin/selector-search.gif new file mode 100644 index 00000000..6d5f4c74 Binary files /dev/null and b/static/admin/img/admin/selector-search.gif differ diff --git a/static/admin/img/admin/selector_stacked-add.gif b/static/admin/img/admin/selector_stacked-add.gif new file mode 100644 index 00000000..74261696 Binary files /dev/null and b/static/admin/img/admin/selector_stacked-add.gif differ diff --git a/static/admin/img/admin/selector_stacked-remove.gif b/static/admin/img/admin/selector_stacked-remove.gif new file mode 100644 index 00000000..60412cee Binary files /dev/null and b/static/admin/img/admin/selector_stacked-remove.gif differ diff --git a/static/admin/img/admin/tool-left.gif b/static/admin/img/admin/tool-left.gif new file mode 100644 index 00000000..011490ff Binary files /dev/null and b/static/admin/img/admin/tool-left.gif differ diff --git a/static/admin/img/admin/tool-left_over.gif b/static/admin/img/admin/tool-left_over.gif new file mode 100644 index 00000000..937e07bb Binary files /dev/null and b/static/admin/img/admin/tool-left_over.gif differ diff --git a/static/admin/img/admin/tool-right.gif b/static/admin/img/admin/tool-right.gif new file mode 100644 index 00000000..cdc140cc Binary files /dev/null and b/static/admin/img/admin/tool-right.gif differ diff --git a/static/admin/img/admin/tool-right_over.gif b/static/admin/img/admin/tool-right_over.gif new file mode 100644 index 00000000..4db977e8 Binary files /dev/null and b/static/admin/img/admin/tool-right_over.gif differ diff --git a/static/admin/img/admin/tooltag-add.gif b/static/admin/img/admin/tooltag-add.gif new file mode 100644 index 00000000..8b53d49a Binary files /dev/null and b/static/admin/img/admin/tooltag-add.gif differ diff --git a/static/admin/img/admin/tooltag-add_over.gif b/static/admin/img/admin/tooltag-add_over.gif new file mode 100644 index 00000000..bfc52f10 Binary files /dev/null and b/static/admin/img/admin/tooltag-add_over.gif differ diff --git a/static/admin/img/admin/tooltag-arrowright.gif b/static/admin/img/admin/tooltag-arrowright.gif new file mode 100644 index 00000000..cdaaae77 Binary files /dev/null and b/static/admin/img/admin/tooltag-arrowright.gif differ diff --git a/static/admin/img/admin/tooltag-arrowright_over.gif b/static/admin/img/admin/tooltag-arrowright_over.gif new file mode 100644 index 00000000..71631896 Binary files /dev/null and b/static/admin/img/admin/tooltag-arrowright_over.gif differ diff --git a/static/admin/img/changelist-bg.gif b/static/admin/img/changelist-bg.gif new file mode 100644 index 00000000..7f469947 Binary files /dev/null and b/static/admin/img/changelist-bg.gif differ diff --git a/static/admin/img/changelist-bg_rtl.gif b/static/admin/img/changelist-bg_rtl.gif new file mode 100644 index 00000000..23797125 Binary files /dev/null and b/static/admin/img/changelist-bg_rtl.gif differ diff --git a/static/admin/img/chooser-bg.gif b/static/admin/img/chooser-bg.gif new file mode 100644 index 00000000..30e83c25 Binary files /dev/null and b/static/admin/img/chooser-bg.gif differ diff --git a/static/admin/img/chooser_stacked-bg.gif b/static/admin/img/chooser_stacked-bg.gif new file mode 100644 index 00000000..5d104b6d Binary files /dev/null and b/static/admin/img/chooser_stacked-bg.gif differ diff --git a/static/admin/img/default-bg-reverse.gif b/static/admin/img/default-bg-reverse.gif new file mode 100644 index 00000000..0873281e Binary files /dev/null and b/static/admin/img/default-bg-reverse.gif differ diff --git a/static/admin/img/default-bg.gif b/static/admin/img/default-bg.gif new file mode 100644 index 00000000..003aeca5 Binary files /dev/null and b/static/admin/img/default-bg.gif differ diff --git a/static/admin/img/deleted-overlay.gif b/static/admin/img/deleted-overlay.gif new file mode 100644 index 00000000..dc3828fe Binary files /dev/null and b/static/admin/img/deleted-overlay.gif differ diff --git a/static/admin/img/gis/move_vertex_off.png b/static/admin/img/gis/move_vertex_off.png new file mode 100644 index 00000000..296b2e29 Binary files /dev/null and b/static/admin/img/gis/move_vertex_off.png differ diff --git a/static/admin/img/gis/move_vertex_on.png b/static/admin/img/gis/move_vertex_on.png new file mode 100644 index 00000000..21f4758d Binary files /dev/null and b/static/admin/img/gis/move_vertex_on.png differ diff --git a/static/admin/img/icon-no.gif b/static/admin/img/icon-no.gif new file mode 100644 index 00000000..1b4ee581 Binary files /dev/null and b/static/admin/img/icon-no.gif differ diff --git a/static/admin/img/icon-unknown.gif b/static/admin/img/icon-unknown.gif new file mode 100644 index 00000000..cfd2b02a Binary files /dev/null and b/static/admin/img/icon-unknown.gif differ diff --git a/static/admin/img/icon-yes.gif b/static/admin/img/icon-yes.gif new file mode 100644 index 00000000..73992827 Binary files /dev/null and b/static/admin/img/icon-yes.gif differ diff --git a/static/admin/img/icon_addlink.gif b/static/admin/img/icon_addlink.gif new file mode 100644 index 00000000..ee70e1ad Binary files /dev/null and b/static/admin/img/icon_addlink.gif differ diff --git a/static/admin/img/icon_alert.gif b/static/admin/img/icon_alert.gif new file mode 100644 index 00000000..a1dde262 Binary files /dev/null and b/static/admin/img/icon_alert.gif differ diff --git a/static/admin/img/icon_calendar.gif b/static/admin/img/icon_calendar.gif new file mode 100644 index 00000000..7587b305 Binary files /dev/null and b/static/admin/img/icon_calendar.gif differ diff --git a/static/admin/img/icon_changelink.gif b/static/admin/img/icon_changelink.gif new file mode 100644 index 00000000..e1b9afde Binary files /dev/null and b/static/admin/img/icon_changelink.gif differ diff --git a/static/admin/img/icon_clock.gif b/static/admin/img/icon_clock.gif new file mode 100644 index 00000000..ff2d57e0 Binary files /dev/null and b/static/admin/img/icon_clock.gif differ diff --git a/static/admin/img/icon_deletelink.gif b/static/admin/img/icon_deletelink.gif new file mode 100644 index 00000000..72523e3a Binary files /dev/null and b/static/admin/img/icon_deletelink.gif differ diff --git a/static/admin/img/icon_error.gif b/static/admin/img/icon_error.gif new file mode 100644 index 00000000..3730a00b Binary files /dev/null and b/static/admin/img/icon_error.gif differ diff --git a/static/admin/img/icon_searchbox.png b/static/admin/img/icon_searchbox.png new file mode 100644 index 00000000..8ab579e5 Binary files /dev/null and b/static/admin/img/icon_searchbox.png differ diff --git a/static/admin/img/icon_success.gif b/static/admin/img/icon_success.gif new file mode 100644 index 00000000..5cf90a15 Binary files /dev/null and b/static/admin/img/icon_success.gif differ diff --git a/static/admin/img/inline-delete-8bit.png b/static/admin/img/inline-delete-8bit.png new file mode 100644 index 00000000..95caf59a Binary files /dev/null and b/static/admin/img/inline-delete-8bit.png differ diff --git a/static/admin/img/inline-delete.png b/static/admin/img/inline-delete.png new file mode 100644 index 00000000..d59bcd24 Binary files /dev/null and b/static/admin/img/inline-delete.png differ diff --git a/static/admin/img/inline-restore-8bit.png b/static/admin/img/inline-restore-8bit.png new file mode 100644 index 00000000..e087c8ea Binary files /dev/null and b/static/admin/img/inline-restore-8bit.png differ diff --git a/static/admin/img/inline-restore.png b/static/admin/img/inline-restore.png new file mode 100644 index 00000000..efdd92ac Binary files /dev/null and b/static/admin/img/inline-restore.png differ diff --git a/static/admin/img/inline-splitter-bg.gif b/static/admin/img/inline-splitter-bg.gif new file mode 100644 index 00000000..32ac5b34 Binary files /dev/null and b/static/admin/img/inline-splitter-bg.gif differ diff --git a/static/admin/img/nav-bg-grabber.gif b/static/admin/img/nav-bg-grabber.gif new file mode 100644 index 00000000..0a784fa7 Binary files /dev/null and b/static/admin/img/nav-bg-grabber.gif differ diff --git a/static/admin/img/nav-bg-reverse.gif b/static/admin/img/nav-bg-reverse.gif new file mode 100644 index 00000000..f11029f9 Binary files /dev/null and b/static/admin/img/nav-bg-reverse.gif differ diff --git a/static/admin/img/nav-bg-selected.gif b/static/admin/img/nav-bg-selected.gif new file mode 100644 index 00000000..98c5672a Binary files /dev/null and b/static/admin/img/nav-bg-selected.gif differ diff --git a/static/admin/img/nav-bg.gif b/static/admin/img/nav-bg.gif new file mode 100644 index 00000000..f8402b80 Binary files /dev/null and b/static/admin/img/nav-bg.gif differ diff --git a/static/admin/img/selector-icons.gif b/static/admin/img/selector-icons.gif new file mode 100644 index 00000000..8809c4fb Binary files /dev/null and b/static/admin/img/selector-icons.gif differ diff --git a/static/admin/img/selector-search.gif b/static/admin/img/selector-search.gif new file mode 100644 index 00000000..6d5f4c74 Binary files /dev/null and b/static/admin/img/selector-search.gif differ diff --git a/static/admin/img/sorting-icons.gif b/static/admin/img/sorting-icons.gif new file mode 100644 index 00000000..451aae59 Binary files /dev/null and b/static/admin/img/sorting-icons.gif differ diff --git a/static/admin/img/tool-left.gif b/static/admin/img/tool-left.gif new file mode 100644 index 00000000..011490ff Binary files /dev/null and b/static/admin/img/tool-left.gif differ diff --git a/static/admin/img/tool-left_over.gif b/static/admin/img/tool-left_over.gif new file mode 100644 index 00000000..937e07bb Binary files /dev/null and b/static/admin/img/tool-left_over.gif differ diff --git a/static/admin/img/tool-right.gif b/static/admin/img/tool-right.gif new file mode 100644 index 00000000..cdc140cc Binary files /dev/null and b/static/admin/img/tool-right.gif differ diff --git a/static/admin/img/tool-right_over.gif b/static/admin/img/tool-right_over.gif new file mode 100644 index 00000000..4db977e8 Binary files /dev/null and b/static/admin/img/tool-right_over.gif differ diff --git a/static/admin/img/tooltag-add.gif b/static/admin/img/tooltag-add.gif new file mode 100644 index 00000000..8b53d49a Binary files /dev/null and b/static/admin/img/tooltag-add.gif differ diff --git a/static/admin/img/tooltag-add_over.gif b/static/admin/img/tooltag-add_over.gif new file mode 100644 index 00000000..bfc52f10 Binary files /dev/null and b/static/admin/img/tooltag-add_over.gif differ diff --git a/static/admin/img/tooltag-arrowright.gif b/static/admin/img/tooltag-arrowright.gif new file mode 100644 index 00000000..cdaaae77 Binary files /dev/null and b/static/admin/img/tooltag-arrowright.gif differ diff --git a/static/admin/img/tooltag-arrowright_over.gif b/static/admin/img/tooltag-arrowright_over.gif new file mode 100644 index 00000000..71631896 Binary files /dev/null and b/static/admin/img/tooltag-arrowright_over.gif differ diff --git a/static/admin/js/LICENSE-JQUERY.txt b/static/admin/js/LICENSE-JQUERY.txt new file mode 100644 index 00000000..a4c5bd76 --- /dev/null +++ b/static/admin/js/LICENSE-JQUERY.txt @@ -0,0 +1,20 @@ +Copyright (c) 2010 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/static/admin/js/SelectBox.js b/static/admin/js/SelectBox.js new file mode 100644 index 00000000..f28c8615 --- /dev/null +++ b/static/admin/js/SelectBox.js @@ -0,0 +1,111 @@ +var SelectBox = { + cache: new Object(), + init: function(id) { + var box = document.getElementById(id); + var node; + SelectBox.cache[id] = new Array(); + var cache = SelectBox.cache[id]; + for (var i = 0; (node = box.options[i]); i++) { + cache.push({value: node.value, text: node.text, displayed: 1}); + } + }, + redisplay: function(id) { + // Repopulate HTML select box from cache + var box = document.getElementById(id); + box.options.length = 0; // clear all options + for (var i = 0, j = SelectBox.cache[id].length; i < j; i++) { + var node = SelectBox.cache[id][i]; + if (node.displayed) { + box.options[box.options.length] = new Option(node.text, node.value, false, false); + } + } + }, + filter: function(id, text) { + // Redisplay the HTML select box, displaying only the choices containing ALL + // the words in text. (It's an AND search.) + var tokens = text.toLowerCase().split(/\s+/); + var node, token; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + node.displayed = 1; + for (var j = 0; (token = tokens[j]); j++) { + if (node.text.toLowerCase().indexOf(token) == -1) { + node.displayed = 0; + } + } + } + SelectBox.redisplay(id); + }, + delete_from_cache: function(id, value) { + var node, delete_index = null; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + delete_index = i; + break; + } + } + var j = SelectBox.cache[id].length - 1; + for (var i = delete_index; i < j; i++) { + SelectBox.cache[id][i] = SelectBox.cache[id][i+1]; + } + SelectBox.cache[id].length--; + }, + add_to_cache: function(id, option) { + SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); + }, + cache_contains: function(id, value) { + // Check if an item is contained in the cache + var node; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + return true; + } + } + return false; + }, + move: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (option.selected && SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + move_all: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + sort: function(id) { + SelectBox.cache[id].sort( function(a, b) { + a = a.text.toLowerCase(); + b = b.text.toLowerCase(); + try { + if (a > b) return 1; + if (a < b) return -1; + } + catch (e) { + // silently fail on IE 'unknown' exception + } + return 0; + } ); + }, + select_all: function(id) { + var box = document.getElementById(id); + for (var i = 0; i < box.options.length; i++) { + box.options[i].selected = 'selected'; + } + } +} diff --git a/static/admin/js/SelectFilter2.js b/static/admin/js/SelectFilter2.js new file mode 100644 index 00000000..e18feee4 --- /dev/null +++ b/static/admin/js/SelectFilter2.js @@ -0,0 +1,166 @@ +/* +SelectFilter2 - Turns a multiple-select box into a filter interface. + +Requires core.js, SelectBox.js and addevent.js. +*/ +(function($) { +function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() != 'form') { + return findForm(node.parentNode); + } + return node; +} + +window.SelectFilter = { + init: function(field_id, field_name, is_stacked, admin_media_prefix) { + if (field_id.match(/__prefix__/)){ + // Don't intialize on empty forms. + return; + } + var from_box = document.getElementById(field_id); + from_box.id += '_from'; // change its ID + from_box.className = 'filtered'; + + var ps = from_box.parentNode.getElementsByTagName('p'); + for (var i=0; i, because it just gets in the way. + from_box.parentNode.removeChild(ps[i]); + } else if (ps[i].className.indexOf("help") != -1) { + // Move help text up to the top so it isn't below the select + // boxes or wrapped off on the side to the right of the add + // button: + // from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild); + // GRAPPELLI CUSTOM: remove help-text, because trusted editors should know what to do + from_box.parentNode.removeChild(ps[i]); + } + } + + //
or
+ var selector_div = quickElement('div', from_box.parentNode); + selector_div.className = is_stacked ? 'selector stacked' : 'selector'; + + //
+ var selector_available = quickElement('div', selector_div, ''); + selector_available.className = 'selector-available'; + var title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name])); + // GRAPPELLI CUSTOM: removed help-icon (trusted editors should know what to do) + // quickElement('img', title_available, '', 'src', admin_media_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', 'title', interpolate(gettext('This is the list of available %s. You may choose some by selecting them in the box below and then clicking the "Choose" arrow between the two boxes.'), [field_name])); + + var filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter'); + filter_p.className = 'selector-filter'; + + var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input"); + // GRAPPELLI CUSTOM: removed search-icon as it is provided via css + // var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/selector-search.gif', 'class', 'help-tooltip', 'alt', '', 'title', interpolate(gettext("Type into this box to filter down the list of available %s."), [field_name])); + + filter_p.appendChild(document.createTextNode(' ')); + + var filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter")); + filter_input.id = field_id + '_input'; + + selector_available.appendChild(from_box); + var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'title', interpolate(gettext('Click to choose all %s at once.'), [field_name]), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_all_link'); + choose_all.className = 'selector-chooseall'; + + //
    + var selector_chooser = quickElement('ul', selector_div, ''); + selector_chooser.className = 'selector-chooser'; + var add_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Choose'), 'title', gettext('Choose'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_link'); + add_link.className = 'selector-add'; + var remove_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Remove'), 'title', gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_link'); + remove_link.className = 'selector-remove'; + + //
    + var selector_chosen = quickElement('div', selector_div, ''); + selector_chosen.className = 'selector-chosen'; + var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name])); + // GRAPPELLI CUSTOM: removed help-icon (trusted editors should know what to do) + // quickElement('img', title_chosen, '', 'src', admin_media_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', 'title', interpolate(gettext('This is the list of chosen %s. You may remove some by selecting them in the box below and then clicking the "Remove" arrow between the two boxes.'), [field_name])); + + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); + to_box.className = 'filtered'; + var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_all_link'); + clear_all.className = 'selector-clearall'; + + from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); + + // Set up the JavaScript event handlers for the select box filter interface + addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); + addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); + addEvent(from_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) }); + addEvent(to_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) }); + addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); SelectFilter.refresh_icons(field_id); }); + addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); SelectFilter.refresh_icons(field_id); }); + addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); + SelectBox.init(field_id + '_from'); + SelectBox.init(field_id + '_to'); + // Move selected from_box options to to_box + SelectBox.move(field_id + '_from', field_id + '_to'); + + // GRAPPELLI: We don't need this as we assigned a fixed height to the elements + // if (!is_stacked) { + // // In horizontal mode, give the same height to the two boxes. + // var j_from_box = $(from_box); + // var j_to_box = $(to_box); + // var resize_filters = function() { j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight()); } + // if (j_from_box.outerHeight() > 0) { + // resize_filters(); // This fieldset is already open. Resize now. + // } else { + // // This fieldset is probably collapsed. Wait for its 'show' event. + // j_to_box.closest('fieldset').one('show.fieldset', resize_filters); + // } + // } + + // Initial icon refresh + SelectFilter.refresh_icons(field_id); + }, + refresh_icons: function(field_id) { + var from = $('#' + field_id + '_from'); + var to = $('#' + field_id + '_to'); + var is_from_selected = from.find('option:selected').length > 0; + var is_to_selected = to.find('option:selected').length > 0; + // Active if at least one item is selected + $('#' + field_id + '_add_link').toggleClass('active', is_from_selected); + $('#' + field_id + '_remove_link').toggleClass('active', is_to_selected); + // Active if the corresponding box isn't empty + $('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0); + $('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0); + }, + filter_key_up: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // don't submit form if user pressed Enter + if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { + from.selectedIndex = 0; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = 0; + return false; + } + var temp = from.selectedIndex; + SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); + from.selectedIndex = temp; + return true; + }, + filter_key_down: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // right arrow -- move across + if ((event.which && event.which == 39) || (event.keyCode && event.keyCode == 39)) { + var old_index = from.selectedIndex; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = (old_index == from.length) ? from.length - 1 : old_index; + return false; + } + // down arrow -- wrap around + if ((event.which && event.which == 40) || (event.keyCode && event.keyCode == 40)) { + from.selectedIndex = (from.length == from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; + } + // up arrow -- wrap around + if ((event.which && event.which == 38) || (event.keyCode && event.keyCode == 38)) { + from.selectedIndex = (from.selectedIndex == 0) ? from.length - 1 : from.selectedIndex - 1; + } + return true; + } +} + +})(grp.jQuery); diff --git a/static/admin/js/actions.js b/static/admin/js/actions.js new file mode 100644 index 00000000..3031a3bc --- /dev/null +++ b/static/admin/js/actions.js @@ -0,0 +1,137 @@ +/** + * GRAPPELLI ACTIONS.JS + * minor modifications compared with the original js + * + */ + +(function($) { + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + checker = function(checked) { + if (checked) { + showQuestion(); + $(actionCheckboxes).attr("checked", true) + .parent().parent().addClass(options.selectedClass); + } else { + reset(); + $(actionCheckboxes).attr("checked", false) + .parent().parent().removeClass(options.selectedClass); + } + }; + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: _actions_icnt + }, true)); + $(options.allToggle).attr("checked", function() { + if (sel == actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + }; + showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + }; + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + $(options.counterContainer).parent('li').hide(); + }; + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + $(options.counterContainer).parent('li').show(); + }; + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + }; + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() == 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).attr("checked")); + updateCounter(); + }); + $("div.grp-changelist-actions li.grp-question a").click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("div.grp-changelist-actions li.grp-clear-selection a").click(function(event) { + event.preventDefault(); + $(options.allToggle).attr("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { var event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { + var inrange = false; + $(lastChecked).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + + // GRAPPELLI CUSTOM: REMOVED ALL JS-CONFIRMS + // TRUSTED EDITORS SHOULD KNOW WHAT TO DO + + // GRAPPELLI CUSTOM: submit on select + $(options.actionSelect).attr("autocomplete", "off").change(function(evt){ + $(this).parents("form").submit(); + }); + + }; + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.grp-changelist-actions", + counterContainer: "li.grp-action-counter span.grp-action-counter", + allContainer: "div.grp-changelist-actions li.grp-all", + acrossInput: "div.grp-changelist-actions input.select-across", + acrossQuestions: "div.grp-changelist-actions li.grp-question", + acrossClears: "div.grp-changelist-actions li.grp-clear-selection", + allToggle: "#action-toggle", + selectedClass: "grp-selected", + actionSelect: "div.grp-changelist-actions select" + }; +})(grp.jQuery); + diff --git a/static/admin/js/actions.min.js b/static/admin/js/actions.min.js new file mode 100644 index 00000000..45931062 --- /dev/null +++ b/static/admin/js/actions.min.js @@ -0,0 +1,135 @@ +/** + * GRAPPELLI ACTIONS.JS + * minor modifications compared with the original js + * + */ + +(function($) { + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + checker = function(checked) { + if (checked) { + showQuestion(); + $(actionCheckboxes).prop("checked", true) + .parent().parent().addClass(options.selectedClass); + } else { + reset(); + $(actionCheckboxes).prop("checked", false) + .parent().parent().removeClass(options.selectedClass); + } + }; + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: _actions_icnt + }, true)); + $(options.allToggle).attr("checked", function() { + if (sel == actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + }; + showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + }; + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + }; + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + }; + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + }; + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() == 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).prop("checked")); + updateCounter(); + }); + $("div.grp-changelist-actions li.grp-question a").click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("div.grp-changelist-actions li.grp-clear-selection a").click(function(event) { + event.preventDefault(); + $(options.allToggle).prop("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { var event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { + var inrange = false; + $(lastChecked).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + + // GRAPPELLI CUSTOM: REMOVED ALL JS-CONFIRMS + // TRUSTED EDITORS SHOULD KNOW WHAT TO DO + + // GRAPPELLI CUSTOM: submit on select + $(options.actionSelect).attr("autocomplete", "off").change(function(evt){ + $(this).parents("form").submit(); + }); + + }; + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.grp-changelist-actions", + counterContainer: "li.grp-action-counter span.grp-action-counter", + allContainer: "div.grp-changelist-actions li.grp-all", + acrossInput: "div.grp-changelist-actions input.select-across", + acrossQuestions: "div.grp-changelist-actions li.grp-question", + acrossClears: "div.grp-changelist-actions li.grp-clear-selection", + allToggle: "#action-toggle", + selectedClass: "grp-selected", + actionSelect: "div.grp-changelist-actions select" + }; +})(grp.jQuery); + diff --git a/static/admin/js/admin/DateTimeShortcuts.js b/static/admin/js/admin/DateTimeShortcuts.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/admin/DateTimeShortcuts.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/admin/RelatedObjectLookups.js b/static/admin/js/admin/RelatedObjectLookups.js new file mode 100644 index 00000000..bee3edd8 --- /dev/null +++ b/static/admin/js/admin/RelatedObjectLookups.js @@ -0,0 +1,179 @@ +// Handles related-objects functionality: lookup link for raw_id_fields +// and Add Another links. + +function html_unescape(text) { + // Unescape a string that was escaped using django.utils.html.escape. + text = text.replace(/</g, '<'); + text = text.replace(/>/g, '>'); + text = text.replace(/"/g, '"'); + text = text.replace(/'/g, "'"); + text = text.replace(/&/g, '&'); + return text; +} + +// IE doesn't accept periods or dashes in the window name, but the element IDs +// we use to generate popup window names may contain them, therefore we map them +// to allowed characters in a reversible way so that we can locate the correct +// element when the popup window is dismissed. +function id_to_windowname(text) { + text = text.replace(/\./g, '__dot__'); + text = text.replace(/\-/g, '__dash__'); + return text; +} + +function windowname_to_id(text) { + text = text.replace(/__dot__/g, '.'); + text = text.replace(/__dash__/g, '-'); + return text; +} + +function showRelatedObjectLookupPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^lookup_/, ''); + name = id_to_windowname(name); + var href; + if (triggeringLink.href.search(/\?/) >= 0) { + href = triggeringLink.href + '&pop=1'; + } else { + href = triggeringLink.href + '?pop=1'; + } + // GRAPPELLI CUSTOM: changed width + var win = window.open(href, name, 'height=500,width=1000,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissRelatedLookupPopup(win, chosenId) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + chosenId; + } else { + document.getElementById(name).value = chosenId; + } + // GRAPPELLI CUSTOM: element focus + elem.focus(); + win.close(); +} + +// GRAPPELLI CUSTOM +function removeRelatedObject(triggeringLink) { + var id = triggeringLink.id.replace(/^remove_/, ''); + var elem = document.getElementById(id); + elem.value = ""; + elem.focus(); +} + +function showAddAnotherPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^add_/, ''); + name = id_to_windowname(name); + href = triggeringLink.href; + if (href.indexOf('?') == -1) { + href += '?_popup=1'; + } else { + href += '&_popup=1'; + } + // GRAPPELLI CUSTOM: changed width + var win = window.open(href, name, 'height=500,width=1000,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissAddAnotherPopup(win, newId, newRepr) { + // newId and newRepr are expected to have previously been escaped by + // django.utils.html.escape. + newId = html_unescape(newId); + newRepr = html_unescape(newRepr); + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem) { + if (elem.nodeName == 'SELECT') { + var o = new Option(newRepr, newId); + elem.options[elem.options.length] = o; + o.selected = true; + } else if (elem.nodeName == 'INPUT') { + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + newId; + elem.focus(); + } else { + elem.value = newId; + elem.focus(); + } + // GRAPPELLI CUSTOM + // NOTE: via http://code.djangoproject.com/ticket/10191 + // check if the className contains radiolist - if it's HORIZONTAL, then it won't match if we compare explicitly + } else if (elem.className.indexOf('radiolist') > -1) { + var cnt = elem.getElementsByTagName('li').length; + var idName = elem.id+'_'+cnt; + var newLi = document.createElement('li'); + var newLabel = document.createElement('label'); + var newText = document.createTextNode(' '+newRepr); + try { + // IE doesn't support settings name, type, or class by setAttribute + var newInput = document.createElement(''); + } catch(err) { + var newInput = document.createElement('input'); + newInput.setAttribute('class', elem.className); + newInput.setAttribute('type', 'radio'); + newInput.setAttribute('name', name.slice(3)); + } + newLabel.setAttribute('for', idName); + newInput.setAttribute('id', idName); + newInput.setAttribute('value', newId); + newInput.setAttribute('checked', 'checked'); + newLabel.appendChild(newInput); + // check if the content being added is a tag - useful for image lists + if (newRepr.charAt(0) == '<' && newRepr.charAt(newRepr.length-1) == '>') { + newLabel.innerHTML += newRepr; + } else { + newLabel.appendChild(newText); + } + newLi.appendChild(newLabel); + elem.appendChild(newLi); + } + } else { + // might be a SelectBox + var toId = name + "_to"; + elem = document.getElementById(toId); + + // GRAPPELLI CUSTOM + // SelectBox code isn't customized, but CheckboxSelectMultiple doesn't exist in the original + if (elem) { + // It is a select box + var o = new Option(newRepr, newId); + SelectBox.add_to_cache(toId, o); + SelectBox.redisplay(toId); + } else { + // last chance. might be a CheckboxSelectMultiple + // get the list of checkboxes + var list = document.getElementById(name + "_0").parentNode.parentNode.parentNode; + var inputId = name + '_' + list.childNodes.length; + var newText = document.createTextNode(' '+newRepr); + + // create a new list item with a checkbox and label in it + var newInput = document.createElement('input'); + newInput.setAttribute('type', 'checkbox'); + newInput.setAttribute('name', name); + newInput.setAttribute('value', newId); + newInput.setAttribute('id', inputId); + newInput.setAttribute('checked', 'checked'); + + var newLabel = document.createElement('label'); + newLabel.setAttribute('for', inputId); + + newLabel.appendChild(newInput); + + if (newRepr.charAt(0) == '<' && newRepr.charAt(newRepr.length-1) == '>') { + newLabel.innerHTML += newRepr; + } else { + newLabel.appendChild(newText); + } + + var newLi = document.createElement('li'); + newLi.appendChild(newLabel); + + // append the new list item to the list + list.appendChild(newLi); + } + } + win.close(); +} diff --git a/static/admin/js/admin/ordering.js b/static/admin/js/admin/ordering.js new file mode 100644 index 00000000..fa995880 --- /dev/null +++ b/static/admin/js/admin/ordering.js @@ -0,0 +1,4 @@ +// dropped +// not used in grappelli +// not used in django either +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/calendar.js b/static/admin/js/calendar.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/calendar.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/collapse.js b/static/admin/js/collapse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/collapse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/collapse.min.js b/static/admin/js/collapse.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/collapse.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/compress.py b/static/admin/js/compress.py new file mode 100644 index 00000000..8d2caa28 --- /dev/null +++ b/static/admin/js/compress.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +import os +import optparse +import subprocess +import sys + +here = os.path.dirname(__file__) + +def main(): + usage = "usage: %prog [file1..fileN]" + description = """With no file paths given this script will automatically +compress all jQuery-based files of the admin app. Requires the Google Closure +Compiler library and Java version 6 or later.""" + parser = optparse.OptionParser(usage, description=description) + parser.add_option("-c", dest="compiler", default="~/bin/compiler.jar", + help="path to Closure Compiler jar file") + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose") + parser.add_option("-q", "--quiet", + action="store_false", dest="verbose") + (options, args) = parser.parse_args() + + compiler = os.path.expanduser(options.compiler) + if not os.path.exists(compiler): + sys.exit("Google Closure compiler jar file %s not found. Please use the -c option to specify the path." % compiler) + + if not args: + if options.verbose: + sys.stdout.write("No filenames given; defaulting to admin scripts\n") + args = [os.path.join(here, f) for f in [ + "actions.js", "collapse.js", "inlines.js", "prepopulate.js"]] + + for arg in args: + if not arg.endswith(".js"): + arg = arg + ".js" + to_compress = os.path.expanduser(arg) + if os.path.exists(to_compress): + to_compress_min = "%s.min.js" % "".join(arg.rsplit(".js")) + cmd = "java -jar %s --js %s --js_output_file %s" % (compiler, to_compress, to_compress_min) + if options.verbose: + sys.stdout.write("Running: %s\n" % cmd) + subprocess.call(cmd.split()) + else: + sys.stdout.write("File %s not found. Sure it exists?\n" % to_compress) + +if __name__ == '__main__': + main() diff --git a/static/admin/js/core.js b/static/admin/js/core.js new file mode 100644 index 00000000..ab776509 --- /dev/null +++ b/static/admin/js/core.js @@ -0,0 +1,211 @@ +// Core javascript helper functions + +// basic browser identification & version +var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); +var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); + +// Cross-browser event handlers. +function addEvent(obj, evType, fn) { + if (obj.addEventListener) { + obj.addEventListener(evType, fn, false); + return true; + } else if (obj.attachEvent) { + var r = obj.attachEvent("on" + evType, fn); + return r; + } else { + return false; + } +} + +function removeEvent(obj, evType, fn) { + if (obj.removeEventListener) { + obj.removeEventListener(evType, fn, false); + return true; + } else if (obj.detachEvent) { + obj.detachEvent("on" + evType, fn); + return true; + } else { + return false; + } +} + +// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]); +function quickElement() { + var obj = document.createElement(arguments[0]); + if (arguments[2] != '' && arguments[2] != null) { + var textNode = document.createTextNode(arguments[2]); + obj.appendChild(textNode); + } + var len = arguments.length; + for (var i = 3; i < len; i += 2) { + obj.setAttribute(arguments[i], arguments[i+1]); + } + arguments[1].appendChild(obj); + return obj; +} + +// ---------------------------------------------------------------------------- +// Cross-browser xmlhttp object +// from http://jibbering.com/2002/4/httprequest.html +// ---------------------------------------------------------------------------- +var xmlhttp; +/*@cc_on @*/ +/*@if (@_jscript_version >= 5) + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } +@else + xmlhttp = false; +@end @*/ +if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { + xmlhttp = new XMLHttpRequest(); +} + +// ---------------------------------------------------------------------------- +// Find-position functions by PPK +// See http://www.quirksmode.org/js/findpos.html +// ---------------------------------------------------------------------------- +function findPosX(obj) { + var curleft = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curleft += obj.offsetLeft - obj.scrollLeft; + } + } else if (obj.x) { + curleft += obj.x; + } + return curleft; +} + +function findPosY(obj) { + var curtop = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curtop += obj.offsetTop - obj.scrollTop; + } + } else if (obj.y) { + curtop += obj.y; + } + return curtop; +} + +//----------------------------------------------------------------------------- +// Date object extensions +// ---------------------------------------------------------------------------- + +Date.prototype.getTwelveHours = function() { + hours = this.getHours(); + if (hours == 0) { + return 12; + } + else { + return hours <= 12 ? hours : hours-12 + } +} + +Date.prototype.getTwoDigitMonth = function() { + return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1); +} + +Date.prototype.getTwoDigitDate = function() { + return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); +} + +Date.prototype.getTwoDigitTwelveHour = function() { + return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); +} + +Date.prototype.getTwoDigitHour = function() { + return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); +} + +Date.prototype.getTwoDigitMinute = function() { + return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); +} + +Date.prototype.getTwoDigitSecond = function() { + return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); +} + +Date.prototype.getHourMinute = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); +} + +Date.prototype.getHourMinuteSecond = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); +} + +Date.prototype.strftime = function(format) { + var fields = { + c: this.toString(), + d: this.getTwoDigitDate(), + H: this.getTwoDigitHour(), + I: this.getTwoDigitTwelveHour(), + m: this.getTwoDigitMonth(), + M: this.getTwoDigitMinute(), + p: (this.getHours() >= 12) ? 'PM' : 'AM', + S: this.getTwoDigitSecond(), + w: '0' + this.getDay(), + x: this.toLocaleDateString(), + X: this.toLocaleTimeString(), + y: ('' + this.getFullYear()).substr(2, 4), + Y: '' + this.getFullYear(), + '%' : '%' + }; + var result = '', i = 0; + while (i < format.length) { + if (format.charAt(i) === '%') { + result = result + fields[format.charAt(i + 1)]; + ++i; + } + else { + result = result + format.charAt(i); + } + ++i; + } + return result; +} + +// ---------------------------------------------------------------------------- +// String object extensions +// ---------------------------------------------------------------------------- +String.prototype.pad_left = function(pad_length, pad_string) { + var new_string = this; + for (var i = 0; new_string.length < pad_length; i++) { + new_string = pad_string + new_string; + } + return new_string; +} + +// ---------------------------------------------------------------------------- +// Get the computed style for and element +// ---------------------------------------------------------------------------- +function getStyle(oElm, strCssRule){ + var strValue = ""; + if(document.defaultView && document.defaultView.getComputedStyle){ + strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); + } + else if(oElm.currentStyle){ + strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ + return p1.toUpperCase(); + }); + strValue = oElm.currentStyle[strCssRule]; + } + return strValue; +} diff --git a/static/admin/js/dateparse.js b/static/admin/js/dateparse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/dateparse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/getElementsBySelector.js b/static/admin/js/getElementsBySelector.js new file mode 100644 index 00000000..15b57a19 --- /dev/null +++ b/static/admin/js/getElementsBySelector.js @@ -0,0 +1,167 @@ +/* document.getElementsBySelector(selector) + - returns an array of element objects from the current document + matching the CSS selector. Selectors can contain element names, + class names and ids and can be nested. For example: + + elements = document.getElementsBySelect('div#main p a.external') + + Will return an array of all 'a' elements with 'external' in their + class attribute that are contained inside 'p' elements that are + contained inside the 'div' element which has id="main" + + New in version 0.4: Support for CSS2 and CSS3 attribute selectors: + See http://www.w3.org/TR/css3-selectors/#attribute-selectors + + Version 0.4 - Simon Willison, March 25th 2003 + -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows + -- Opera 7 fails +*/ + +function getAllChildren(e) { + // Returns all children of element. Workaround required for IE5/Windows. Ugh. + return e.all ? e.all : e.getElementsByTagName('*'); +} + +document.getElementsBySelector = function(selector) { + // Attempt to fail gracefully in lesser browsers + if (!document.getElementsByTagName) { + return new Array(); + } + // Split selector in to tokens + var tokens = selector.split(' '); + var currentContext = new Array(document); + for (var i = 0; i < tokens.length; i++) { + token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');; + if (token.indexOf('#') > -1) { + // Token is an ID selector + var bits = token.split('#'); + var tagName = bits[0]; + var id = bits[1]; + var element = document.getElementById(id); + if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) { + // ID not found or tag with that ID not found, return false. + return new Array(); + } + // Set currentContext to contain just this element + currentContext = new Array(element); + continue; // Skip to next token + } + if (token.indexOf('.') > -1) { + // Token contains a class selector + var bits = token.split('.'); + var tagName = bits[0]; + var className = bits[1]; + if (!tagName) { + tagName = '*'; + } + // Get elements matching tag, filter them for class selector + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + try { + elements = currentContext[h].getElementsByTagName(tagName); + } + catch(e) { + elements = []; + } + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) { + currentContext[currentContextIndex++] = found[k]; + } + } + continue; // Skip to next token + } + // Code to deal with attribute selectors + if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) { + var tagName = RegExp.$1; + var attrName = RegExp.$2; + var attrOperator = RegExp.$3; + var attrValue = RegExp.$4; + if (!tagName) { + tagName = '*'; + } + // Grab all of the tagName elements within current context + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + elements = currentContext[h].getElementsByTagName(tagName); + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + var checkFunction; // This function will be used to filter the elements + switch (attrOperator) { + case '=': // Equality + checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); }; + break; + case '~': // Match one of space seperated words + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); }; + break; + case '|': // Match start with value followed by optional hyphen + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); }; + break; + case '^': // Match starts with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); }; + break; + case '$': // Match ends with value - fails with "Warning" in Opera 7 + checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); }; + break; + case '*': // Match ends with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); }; + break; + default : + // Just test for existence of attribute + checkFunction = function(e) { return e.getAttribute(attrName); }; + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (checkFunction(found[k])) { + currentContext[currentContextIndex++] = found[k]; + } + } + // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue); + continue; // Skip to next token + } + // If we get here, token is JUST an element (not a class or ID selector) + tagName = token; + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements = currentContext[h].getElementsByTagName(tagName); + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = found; + } + return currentContext; +} + +/* That revolting regular expression explained +/^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/ + \---/ \---/\-------------/ \-------/ + | | | | + | | | The value + | | ~,|,^,$,* or = + | Attribute + Tag +*/ diff --git a/static/admin/js/inlines.js b/static/admin/js/inlines.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/inlines.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/inlines.min.js b/static/admin/js/inlines.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/inlines.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/jquery.init.js b/static/admin/js/jquery.init.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/jquery.init.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/jquery.js b/static/admin/js/jquery.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/jquery.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/jquery.min.js b/static/admin/js/jquery.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/jquery.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/json.min.js b/static/admin/js/json.min.js new file mode 100644 index 00000000..f708ed51 --- /dev/null +++ b/static/admin/js/json.min.js @@ -0,0 +1,29 @@ + +if(!this.JSON){this.JSON={};} +(function(){function f(n){return n<10?'0'+n:n;} +if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ +f(this.getUTCMonth()+1)+'-'+ +f(this.getUTCDate())+'T'+ +f(this.getUTCHours())+':'+ +f(this.getUTCMinutes())+':'+ +f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} +var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} +function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} +if(typeof rep==='function'){value=rep.call(holder,key,value);} +switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} +gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i 0) { + values.push($(field).val()); + } + }) + field.val(URLify(values.join(' '), maxLength)); + }; + + $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); + }); + }; +})(grp.jQuery); \ No newline at end of file diff --git a/static/admin/js/prepopulate.min.js b/static/admin/js/prepopulate.min.js new file mode 100644 index 00000000..ced39504 --- /dev/null +++ b/static/admin/js/prepopulate.min.js @@ -0,0 +1,34 @@ +(function($) { + $.fn.prepopulate = function(dependencies, maxLength) { + /* + Depends on urlify.js + Populates a selected field with the values of the dependent fields, + URLifies and shortens the string. + dependencies - array of dependent fields id's + maxLength - maximum length of the URLify'd string + */ + return this.each(function() { + var field = $(this); + + field.data('_changed', false); + field.change(function() { + field.data('_changed', true); + }); + + var populate = function () { + // Bail if the fields value has changed + if (field.data('_changed') == true) return; + + var values = []; + $.each(dependencies, function(i, field) { + if ($(field).val().length > 0) { + values.push($(field).val()); + } + }) + field.val(URLify(values.join(' '), maxLength)); + }; + + $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); + }); + }; +})(grp.jQuery); \ No newline at end of file diff --git a/static/admin/js/timeparse.js b/static/admin/js/timeparse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js/timeparse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js/urlify.js b/static/admin/js/urlify.js new file mode 100644 index 00000000..d8f2549e --- /dev/null +++ b/static/admin/js/urlify.js @@ -0,0 +1,140 @@ +var LATIN_MAP = { + 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç': + 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I', + 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': + 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ű': 'U', + 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a', 'â': 'a', 'ã': 'a', 'ä': + 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', + 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': + 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', + 'û': 'u', 'ü': 'u', 'ű': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y' +} +var LATIN_SYMBOLS_MAP = { + '©':'(c)' +} +var GREEK_MAP = { + 'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8', + 'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p', + 'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w', + 'ά':'a', 'έ':'e', 'ί':'i', 'ό':'o', 'ύ':'y', 'ή':'h', 'ώ':'w', 'ς':'s', + 'ϊ':'i', 'ΰ':'y', 'ϋ':'y', 'ΐ':'i', + 'Α':'A', 'Β':'B', 'Γ':'G', 'Δ':'D', 'Ε':'E', 'Ζ':'Z', 'Η':'H', 'Θ':'8', + 'Ι':'I', 'Κ':'K', 'Λ':'L', 'Μ':'M', 'Ν':'N', 'Ξ':'3', 'Ο':'O', 'Π':'P', + 'Ρ':'R', 'Σ':'S', 'Τ':'T', 'Υ':'Y', 'Φ':'F', 'Χ':'X', 'Ψ':'PS', 'Ω':'W', + 'Ά':'A', 'Έ':'E', 'Ί':'I', 'Ό':'O', 'Ύ':'Y', 'Ή':'H', 'Ώ':'W', 'Ϊ':'I', + 'Ϋ':'Y' +} +var TURKISH_MAP = { + 'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U', + 'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G' +} +var RUSSIAN_MAP = { + 'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh', + 'з':'z', 'и':'i', 'й':'j', 'к':'k', 'л':'l', 'м':'m', 'н':'n', 'о':'o', + 'п':'p', 'р':'r', 'с':'s', 'т':'t', 'у':'u', 'ф':'f', 'х':'h', 'ц':'c', + 'ч':'ch', 'ш':'sh', 'щ':'sh', 'ъ':'', 'ы':'y', 'ь':'', 'э':'e', 'ю':'yu', + 'я':'ya', + 'А':'A', 'Б':'B', 'В':'V', 'Г':'G', 'Д':'D', 'Е':'E', 'Ё':'Yo', 'Ж':'Zh', + 'З':'Z', 'И':'I', 'Й':'J', 'К':'K', 'Л':'L', 'М':'M', 'Н':'N', 'О':'O', + 'П':'P', 'Р':'R', 'С':'S', 'Т':'T', 'У':'U', 'Ф':'F', 'Х':'H', 'Ц':'C', + 'Ч':'Ch', 'Ш':'Sh', 'Щ':'Sh', 'Ъ':'', 'Ы':'Y', 'Ь':'', 'Э':'E', 'Ю':'Yu', + 'Я':'Ya' +} +var UKRAINIAN_MAP = { + 'Є':'Ye', 'І':'I', 'Ї':'Yi', 'Ґ':'G', 'є':'ye', 'і':'i', 'ї':'yi', 'ґ':'g' +} +var CZECH_MAP = { + 'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u', + 'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T', + 'Ů':'U', 'Ž':'Z' +} + +var POLISH_MAP = { + 'ą':'a', 'ć':'c', 'ę':'e', 'ł':'l', 'ń':'n', 'ó':'o', 'ś':'s', 'ź':'z', + 'ż':'z', 'Ą':'A', 'Ć':'C', 'Ę':'e', 'Ł':'L', 'Ń':'N', 'Ó':'o', 'Ś':'S', + 'Ź':'Z', 'Ż':'Z' +} + +var LATVIAN_MAP = { + 'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n', + 'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i', + 'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z' +} + +var ALL_DOWNCODE_MAPS=new Array() +ALL_DOWNCODE_MAPS[0]=LATIN_MAP +ALL_DOWNCODE_MAPS[1]=LATIN_SYMBOLS_MAP +ALL_DOWNCODE_MAPS[2]=GREEK_MAP +ALL_DOWNCODE_MAPS[3]=TURKISH_MAP +ALL_DOWNCODE_MAPS[4]=RUSSIAN_MAP +ALL_DOWNCODE_MAPS[5]=UKRAINIAN_MAP +ALL_DOWNCODE_MAPS[6]=CZECH_MAP +ALL_DOWNCODE_MAPS[7]=POLISH_MAP +ALL_DOWNCODE_MAPS[8]=LATVIAN_MAP + +var Downcoder = new Object(); +Downcoder.Initialize = function() +{ + if (Downcoder.map) // already made + return ; + Downcoder.map ={} + Downcoder.chars = '' ; + for(var i in ALL_DOWNCODE_MAPS) + { + var lookup = ALL_DOWNCODE_MAPS[i] + for (var c in lookup) + { + Downcoder.map[c] = lookup[c] ; + Downcoder.chars += c ; + } + } + Downcoder.regex = new RegExp('[' + Downcoder.chars + ']|[^' + Downcoder.chars + ']+','g') ; +} + +downcode= function( slug ) +{ + Downcoder.Initialize() ; + var downcoded ="" + var pieces = slug.match(Downcoder.regex); + if(pieces) + { + for (var i = 0 ; i < pieces.length ; i++) + { + if (pieces[i].length == 1) + { + var mapped = Downcoder.map[pieces[i]] ; + if (mapped != null) + { + downcoded+=mapped; + continue ; + } + } + downcoded+=pieces[i]; + } + } + else + { + downcoded = slug; + } + return downcoded; +} + + +function URLify(s, num_chars) { + // changes, e.g., "Petty theft" to "petty_theft" + // remove all these words from the string before urlifying + s = downcode(s); + removelist = ["a", "an", "as", "at", "before", "but", "by", "for", "from", + "is", "in", "into", "like", "of", "off", "on", "onto", "per", + "since", "than", "the", "this", "that", "to", "up", "via", + "with"]; + r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi'); + s = s.replace(r, ''); + // if downcode doesn't hit, the char will be stripped here + s = s.replace(/[^-\w\s]/g, ''); // remove unneeded chars + s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces + s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens + s = s.toLowerCase(); // convert to lowercase + return s.substring(0, num_chars);// trim to first num_chars chars +} + diff --git a/static/admin/js_orig/LICENSE-JQUERY.txt b/static/admin/js_orig/LICENSE-JQUERY.txt new file mode 100644 index 00000000..a4c5bd76 --- /dev/null +++ b/static/admin/js_orig/LICENSE-JQUERY.txt @@ -0,0 +1,20 @@ +Copyright (c) 2010 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/static/admin/js_orig/SelectBox.js b/static/admin/js_orig/SelectBox.js new file mode 100644 index 00000000..f28c8615 --- /dev/null +++ b/static/admin/js_orig/SelectBox.js @@ -0,0 +1,111 @@ +var SelectBox = { + cache: new Object(), + init: function(id) { + var box = document.getElementById(id); + var node; + SelectBox.cache[id] = new Array(); + var cache = SelectBox.cache[id]; + for (var i = 0; (node = box.options[i]); i++) { + cache.push({value: node.value, text: node.text, displayed: 1}); + } + }, + redisplay: function(id) { + // Repopulate HTML select box from cache + var box = document.getElementById(id); + box.options.length = 0; // clear all options + for (var i = 0, j = SelectBox.cache[id].length; i < j; i++) { + var node = SelectBox.cache[id][i]; + if (node.displayed) { + box.options[box.options.length] = new Option(node.text, node.value, false, false); + } + } + }, + filter: function(id, text) { + // Redisplay the HTML select box, displaying only the choices containing ALL + // the words in text. (It's an AND search.) + var tokens = text.toLowerCase().split(/\s+/); + var node, token; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + node.displayed = 1; + for (var j = 0; (token = tokens[j]); j++) { + if (node.text.toLowerCase().indexOf(token) == -1) { + node.displayed = 0; + } + } + } + SelectBox.redisplay(id); + }, + delete_from_cache: function(id, value) { + var node, delete_index = null; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + delete_index = i; + break; + } + } + var j = SelectBox.cache[id].length - 1; + for (var i = delete_index; i < j; i++) { + SelectBox.cache[id][i] = SelectBox.cache[id][i+1]; + } + SelectBox.cache[id].length--; + }, + add_to_cache: function(id, option) { + SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); + }, + cache_contains: function(id, value) { + // Check if an item is contained in the cache + var node; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + return true; + } + } + return false; + }, + move: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (option.selected && SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + move_all: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + sort: function(id) { + SelectBox.cache[id].sort( function(a, b) { + a = a.text.toLowerCase(); + b = b.text.toLowerCase(); + try { + if (a > b) return 1; + if (a < b) return -1; + } + catch (e) { + // silently fail on IE 'unknown' exception + } + return 0; + } ); + }, + select_all: function(id) { + var box = document.getElementById(id); + for (var i = 0; i < box.options.length; i++) { + box.options[i].selected = 'selected'; + } + } +} diff --git a/static/admin/js_orig/SelectFilter2.js b/static/admin/js_orig/SelectFilter2.js new file mode 100644 index 00000000..fc7baaa0 --- /dev/null +++ b/static/admin/js_orig/SelectFilter2.js @@ -0,0 +1,165 @@ +/* +SelectFilter2 - Turns a multiple-select box into a filter interface. + +Requires core.js, SelectBox.js and addevent.js. +*/ +(function($) { +function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() != 'form') { + return findForm(node.parentNode); + } + return node; +} + +window.SelectFilter = { + init: function(field_id, field_name, is_stacked, admin_media_prefix) { + if (field_id.match(/__prefix__/)){ + // Don't intialize on empty forms. + return; + } + var from_box = document.getElementById(field_id); + from_box.id += '_from'; // change its ID + from_box.className = 'filtered'; + + var ps = from_box.parentNode.getElementsByTagName('p'); + for (var i=0; i, because it just gets in the way. + from_box.parentNode.removeChild(ps[i]); + } else if (ps[i].className.indexOf("help") != -1) { + // Move help text up to the top so it isn't below the select + // boxes or wrapped off on the side to the right of the add + // button: + // from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild); + // GRAPPELLI CUSTOM: remove help-text, because trusted editors should know what to do + from_box.parentNode.removeChild(ps[i]); + } + } + + //
    or
    + var selector_div = quickElement('div', from_box.parentNode); + selector_div.className = is_stacked ? 'selector stacked' : 'selector'; + + //
    + var selector_available = quickElement('div', selector_div, ''); + selector_available.className = 'selector-available'; + var title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name])); + // GRAPPELLI CUSTOM: removed help-icon (trusted editors should know what to do) + // quickElement('img', title_available, '', 'src', admin_media_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', 'title', interpolate(gettext('This is the list of available %s. You may choose some by selecting them in the box below and then clicking the "Choose" arrow between the two boxes.'), [field_name])); + + var filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter'); + filter_p.className = 'selector-filter'; + + var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input"); + + var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/selector-search.gif', 'class', 'help-tooltip', 'alt', '', 'title', interpolate(gettext("Type into this box to filter down the list of available %s."), [field_name])); + + filter_p.appendChild(document.createTextNode(' ')); + + var filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter")); + filter_input.id = field_id + '_input'; + + selector_available.appendChild(from_box); + var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'title', interpolate(gettext('Click to choose all %s at once.'), [field_name]), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_all_link'); + choose_all.className = 'selector-chooseall'; + + //
      + var selector_chooser = quickElement('ul', selector_div, ''); + selector_chooser.className = 'selector-chooser'; + var add_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Choose'), 'title', gettext('Choose'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_link'); + add_link.className = 'selector-add'; + var remove_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Remove'), 'title', gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_link'); + remove_link.className = 'selector-remove'; + + //
      + var selector_chosen = quickElement('div', selector_div, ''); + selector_chosen.className = 'selector-chosen'; + var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name])); + // GRAPPELLI CUSTOM: removed help-icon (trusted editors should know what to do) + // quickElement('img', title_chosen, '', 'src', admin_media_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', 'title', interpolate(gettext('This is the list of chosen %s. You may remove some by selecting them in the box below and then clicking the "Remove" arrow between the two boxes.'), [field_name])); + + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); + to_box.className = 'filtered'; + var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_all_link'); + clear_all.className = 'selector-clearall'; + + from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); + + // Set up the JavaScript event handlers for the select box filter interface + addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); + addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); + addEvent(from_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) }); + addEvent(to_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) }); + addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); SelectFilter.refresh_icons(field_id); }); + addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); SelectFilter.refresh_icons(field_id); }); + addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); + SelectBox.init(field_id + '_from'); + SelectBox.init(field_id + '_to'); + // Move selected from_box options to to_box + SelectBox.move(field_id + '_from', field_id + '_to'); + + if (!is_stacked) { + // In horizontal mode, give the same height to the two boxes. + var j_from_box = $(from_box); + var j_to_box = $(to_box); + var resize_filters = function() { j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight()); } + if (j_from_box.outerHeight() > 0) { + resize_filters(); // This fieldset is already open. Resize now. + } else { + // This fieldset is probably collapsed. Wait for its 'show' event. + j_to_box.closest('fieldset').one('show.fieldset', resize_filters); + } + } + + // Initial icon refresh + SelectFilter.refresh_icons(field_id); + }, + refresh_icons: function(field_id) { + var from = $('#' + field_id + '_from'); + var to = $('#' + field_id + '_to'); + var is_from_selected = from.find('option:selected').length > 0; + var is_to_selected = to.find('option:selected').length > 0; + // Active if at least one item is selected + $('#' + field_id + '_add_link').toggleClass('active', is_from_selected); + $('#' + field_id + '_remove_link').toggleClass('active', is_to_selected); + // Active if the corresponding box isn't empty + $('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0); + $('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0); + }, + filter_key_up: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // don't submit form if user pressed Enter + if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { + from.selectedIndex = 0; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = 0; + return false; + } + var temp = from.selectedIndex; + SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); + from.selectedIndex = temp; + return true; + }, + filter_key_down: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // right arrow -- move across + if ((event.which && event.which == 39) || (event.keyCode && event.keyCode == 39)) { + var old_index = from.selectedIndex; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = (old_index == from.length) ? from.length - 1 : old_index; + return false; + } + // down arrow -- wrap around + if ((event.which && event.which == 40) || (event.keyCode && event.keyCode == 40)) { + from.selectedIndex = (from.length == from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; + } + // up arrow -- wrap around + if ((event.which && event.which == 38) || (event.keyCode && event.keyCode == 38)) { + from.selectedIndex = (from.selectedIndex == 0) ? from.length - 1 : from.selectedIndex - 1; + } + return true; + } +} + +})(grp.jQuery); diff --git a/static/admin/js_orig/actions.js b/static/admin/js_orig/actions.js new file mode 100644 index 00000000..0c4f9f30 --- /dev/null +++ b/static/admin/js_orig/actions.js @@ -0,0 +1,135 @@ +/** + * GRAPPELLI ACTIONS.JS + * minor modifications compared with the original js + * + */ + +(function($) { + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + checker = function(checked) { + if (checked) { + showQuestion(); + $(actionCheckboxes).attr("checked", true) + .parent().parent().addClass(options.selectedClass); + } else { + reset(); + $(actionCheckboxes).attr("checked", false) + .parent().parent().removeClass(options.selectedClass); + } + }; + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: _actions_icnt + }, true)); + $(options.allToggle).attr("checked", function() { + if (sel == actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + }; + showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + }; + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + }; + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + }; + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + }; + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() == 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).attr("checked")); + updateCounter(); + }); + $("div.grp-changelist-actions li.grp-question a").click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("div.grp-changelist-actions li.grp-clear-selection a").click(function(event) { + event.preventDefault(); + $(options.allToggle).attr("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { var event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { + var inrange = false; + $(lastChecked).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + + // GRAPPELLI CUSTOM: REMOVED ALL JS-CONFIRMS + // TRUSTED EDITORS SHOULD KNOW WHAT TO DO + + // GRAPPELLI CUSTOM: submit on select + $(options.actionSelect).attr("autocomplete", "off").change(function(evt){ + $(this).parents("form").submit(); + }); + + }; + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.grp-changelist-actions", + counterContainer: "li.grp-action-counter span.grp-action-counter", + allContainer: "div.grp-changelist-actions li.grp-all", + acrossInput: "div.grp-changelist-actions input.select-across", + acrossQuestions: "div.grp-changelist-actions li.grp-question", + acrossClears: "div.grp-changelist-actions li.grp-clear-selection", + allToggle: "#action-toggle", + selectedClass: "grp-selected", + actionSelect: "div.grp-changelist-actions select" + }; +})(grp.jQuery); + diff --git a/static/admin/js_orig/actions.min.js b/static/admin/js_orig/actions.min.js new file mode 100644 index 00000000..0c4f9f30 --- /dev/null +++ b/static/admin/js_orig/actions.min.js @@ -0,0 +1,135 @@ +/** + * GRAPPELLI ACTIONS.JS + * minor modifications compared with the original js + * + */ + +(function($) { + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + checker = function(checked) { + if (checked) { + showQuestion(); + $(actionCheckboxes).attr("checked", true) + .parent().parent().addClass(options.selectedClass); + } else { + reset(); + $(actionCheckboxes).attr("checked", false) + .parent().parent().removeClass(options.selectedClass); + } + }; + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: _actions_icnt + }, true)); + $(options.allToggle).attr("checked", function() { + if (sel == actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + }; + showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + }; + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + }; + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + }; + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + }; + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() == 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).attr("checked")); + updateCounter(); + }); + $("div.grp-changelist-actions li.grp-question a").click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("div.grp-changelist-actions li.grp-clear-selection a").click(function(event) { + event.preventDefault(); + $(options.allToggle).attr("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { var event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { + var inrange = false; + $(lastChecked).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + + // GRAPPELLI CUSTOM: REMOVED ALL JS-CONFIRMS + // TRUSTED EDITORS SHOULD KNOW WHAT TO DO + + // GRAPPELLI CUSTOM: submit on select + $(options.actionSelect).attr("autocomplete", "off").change(function(evt){ + $(this).parents("form").submit(); + }); + + }; + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.grp-changelist-actions", + counterContainer: "li.grp-action-counter span.grp-action-counter", + allContainer: "div.grp-changelist-actions li.grp-all", + acrossInput: "div.grp-changelist-actions input.select-across", + acrossQuestions: "div.grp-changelist-actions li.grp-question", + acrossClears: "div.grp-changelist-actions li.grp-clear-selection", + allToggle: "#action-toggle", + selectedClass: "grp-selected", + actionSelect: "div.grp-changelist-actions select" + }; +})(grp.jQuery); + diff --git a/static/admin/js_orig/admin/DateTimeShortcuts.js b/static/admin/js_orig/admin/DateTimeShortcuts.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/admin/DateTimeShortcuts.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/admin/RelatedObjectLookups.js b/static/admin/js_orig/admin/RelatedObjectLookups.js new file mode 100644 index 00000000..1065d602 --- /dev/null +++ b/static/admin/js_orig/admin/RelatedObjectLookups.js @@ -0,0 +1,179 @@ +// Handles related-objects functionality: lookup link for raw_id_fields +// and Add Another links. + +function html_unescape(text) { + // Unescape a string that was escaped using django.utils.html.escape. + text = text.replace(/</g, '<'); + text = text.replace(/>/g, '>'); + text = text.replace(/"/g, '"'); + text = text.replace(/'/g, "'"); + text = text.replace(/&/g, '&'); + return text; +} + +// IE doesn't accept periods or dashes in the window name, but the element IDs +// we use to generate popup window names may contain them, therefore we map them +// to allowed characters in a reversible way so that we can locate the correct +// element when the popup window is dismissed. +function id_to_windowname(text) { + text = text.replace(/\./g, '__dot__'); + text = text.replace(/\-/g, '__dash__'); + return text; +} + +function windowname_to_id(text) { + text = text.replace(/__dot__/g, '.'); + text = text.replace(/__dash__/g, '-'); + return text; +} + +function showRelatedObjectLookupPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^lookup_/, ''); + name = id_to_windowname(name); + var href; + if (triggeringLink.href.search(/\?/) >= 0) { + href = triggeringLink.href + '&pop=1'; + } else { + href = triggeringLink.href + '?pop=1'; + } + // GRAPPELLI CUSTOM: changed width + var win = window.open(href, name, 'height=500,width=980,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissRelatedLookupPopup(win, chosenId) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + chosenId; + } else { + document.getElementById(name).value = chosenId; + } + // GRAPPELLI CUSTOM: element focus + elem.focus(); + win.close(); +} + +// GRAPPELLI CUSTOM +function removeRelatedObject(triggeringLink) { + var id = triggeringLink.id.replace(/^remove_/, ''); + var elem = document.getElementById(id); + elem.value = ""; + elem.focus(); +} + +function showAddAnotherPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^add_/, ''); + name = id_to_windowname(name); + href = triggeringLink.href; + if (href.indexOf('?') == -1) { + href += '?_popup=1'; + } else { + href += '&_popup=1'; + } + // GRAPPELLI CUSTOM: changed width + var win = window.open(href, name, 'height=500,width=980,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissAddAnotherPopup(win, newId, newRepr) { + // newId and newRepr are expected to have previously been escaped by + // django.utils.html.escape. + newId = html_unescape(newId); + newRepr = html_unescape(newRepr); + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem) { + if (elem.nodeName == 'SELECT') { + var o = new Option(newRepr, newId); + elem.options[elem.options.length] = o; + o.selected = true; + } else if (elem.nodeName == 'INPUT') { + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + newId; + elem.focus(); + } else { + elem.value = newId; + elem.focus(); + } + // GRAPPELLI CUSTOM + // NOTE: via http://code.djangoproject.com/ticket/10191 + // check if the className contains radiolist - if it's HORIZONTAL, then it won't match if we compare explicitly + } else if (elem.className.indexOf('radiolist') > -1) { + var cnt = elem.getElementsByTagName('li').length; + var idName = elem.id+'_'+cnt; + var newLi = document.createElement('li'); + var newLabel = document.createElement('label'); + var newText = document.createTextNode(' '+newRepr); + try { + // IE doesn't support settings name, type, or class by setAttribute + var newInput = document.createElement(''); + } catch(err) { + var newInput = document.createElement('input'); + newInput.setAttribute('class', elem.className); + newInput.setAttribute('type', 'radio'); + newInput.setAttribute('name', name.slice(3)); + } + newLabel.setAttribute('for', idName); + newInput.setAttribute('id', idName); + newInput.setAttribute('value', newId); + newInput.setAttribute('checked', 'checked'); + newLabel.appendChild(newInput); + // check if the content being added is a tag - useful for image lists + if (newRepr.charAt(0) == '<' && newRepr.charAt(newRepr.length-1) == '>') { + newLabel.innerHTML += newRepr; + } else { + newLabel.appendChild(newText); + } + newLi.appendChild(newLabel); + elem.appendChild(newLi); + } + } else { + // might be a SelectBox + var toId = name + "_to"; + elem = document.getElementById(toId); + + // GRAPPELLI CUSTOM + // SelectBox code isn't customized, but CheckboxSelectMultiple doesn't exist in the original + if (elem) { + // It is a select box + var o = new Option(newRepr, newId); + SelectBox.add_to_cache(toId, o); + SelectBox.redisplay(toId); + } else { + // last chance. might be a CheckboxSelectMultiple + // get the list of checkboxes + var list = document.getElementById(name + "_0").parentNode.parentNode.parentNode; + var inputId = name + '_' + list.childNodes.length; + var newText = document.createTextNode(' '+newRepr); + + // create a new list item with a checkbox and label in it + var newInput = document.createElement('input'); + newInput.setAttribute('type', 'checkbox'); + newInput.setAttribute('name', name); + newInput.setAttribute('value', newId); + newInput.setAttribute('id', inputId); + newInput.setAttribute('checked', 'checked'); + + var newLabel = document.createElement('label'); + newLabel.setAttribute('for', inputId); + + newLabel.appendChild(newInput); + + if (newRepr.charAt(0) == '<' && newRepr.charAt(newRepr.length-1) == '>') { + newLabel.innerHTML += newRepr; + } else { + newLabel.appendChild(newText); + } + + var newLi = document.createElement('li'); + newLi.appendChild(newLabel); + + // append the new list item to the list + list.appendChild(newLi); + } + } + win.close(); +} diff --git a/static/admin/js_orig/admin/ordering.js b/static/admin/js_orig/admin/ordering.js new file mode 100644 index 00000000..fa995880 --- /dev/null +++ b/static/admin/js_orig/admin/ordering.js @@ -0,0 +1,4 @@ +// dropped +// not used in grappelli +// not used in django either +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/calendar.js b/static/admin/js_orig/calendar.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/calendar.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/collapse.js b/static/admin/js_orig/collapse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/collapse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/collapse.min.js b/static/admin/js_orig/collapse.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/collapse.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/compress.py b/static/admin/js_orig/compress.py new file mode 100644 index 00000000..8d2caa28 --- /dev/null +++ b/static/admin/js_orig/compress.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +import os +import optparse +import subprocess +import sys + +here = os.path.dirname(__file__) + +def main(): + usage = "usage: %prog [file1..fileN]" + description = """With no file paths given this script will automatically +compress all jQuery-based files of the admin app. Requires the Google Closure +Compiler library and Java version 6 or later.""" + parser = optparse.OptionParser(usage, description=description) + parser.add_option("-c", dest="compiler", default="~/bin/compiler.jar", + help="path to Closure Compiler jar file") + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose") + parser.add_option("-q", "--quiet", + action="store_false", dest="verbose") + (options, args) = parser.parse_args() + + compiler = os.path.expanduser(options.compiler) + if not os.path.exists(compiler): + sys.exit("Google Closure compiler jar file %s not found. Please use the -c option to specify the path." % compiler) + + if not args: + if options.verbose: + sys.stdout.write("No filenames given; defaulting to admin scripts\n") + args = [os.path.join(here, f) for f in [ + "actions.js", "collapse.js", "inlines.js", "prepopulate.js"]] + + for arg in args: + if not arg.endswith(".js"): + arg = arg + ".js" + to_compress = os.path.expanduser(arg) + if os.path.exists(to_compress): + to_compress_min = "%s.min.js" % "".join(arg.rsplit(".js")) + cmd = "java -jar %s --js %s --js_output_file %s" % (compiler, to_compress, to_compress_min) + if options.verbose: + sys.stdout.write("Running: %s\n" % cmd) + subprocess.call(cmd.split()) + else: + sys.stdout.write("File %s not found. Sure it exists?\n" % to_compress) + +if __name__ == '__main__': + main() diff --git a/static/admin/js_orig/core.js b/static/admin/js_orig/core.js new file mode 100644 index 00000000..ab776509 --- /dev/null +++ b/static/admin/js_orig/core.js @@ -0,0 +1,211 @@ +// Core javascript helper functions + +// basic browser identification & version +var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); +var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); + +// Cross-browser event handlers. +function addEvent(obj, evType, fn) { + if (obj.addEventListener) { + obj.addEventListener(evType, fn, false); + return true; + } else if (obj.attachEvent) { + var r = obj.attachEvent("on" + evType, fn); + return r; + } else { + return false; + } +} + +function removeEvent(obj, evType, fn) { + if (obj.removeEventListener) { + obj.removeEventListener(evType, fn, false); + return true; + } else if (obj.detachEvent) { + obj.detachEvent("on" + evType, fn); + return true; + } else { + return false; + } +} + +// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]); +function quickElement() { + var obj = document.createElement(arguments[0]); + if (arguments[2] != '' && arguments[2] != null) { + var textNode = document.createTextNode(arguments[2]); + obj.appendChild(textNode); + } + var len = arguments.length; + for (var i = 3; i < len; i += 2) { + obj.setAttribute(arguments[i], arguments[i+1]); + } + arguments[1].appendChild(obj); + return obj; +} + +// ---------------------------------------------------------------------------- +// Cross-browser xmlhttp object +// from http://jibbering.com/2002/4/httprequest.html +// ---------------------------------------------------------------------------- +var xmlhttp; +/*@cc_on @*/ +/*@if (@_jscript_version >= 5) + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } +@else + xmlhttp = false; +@end @*/ +if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { + xmlhttp = new XMLHttpRequest(); +} + +// ---------------------------------------------------------------------------- +// Find-position functions by PPK +// See http://www.quirksmode.org/js/findpos.html +// ---------------------------------------------------------------------------- +function findPosX(obj) { + var curleft = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curleft += obj.offsetLeft - obj.scrollLeft; + } + } else if (obj.x) { + curleft += obj.x; + } + return curleft; +} + +function findPosY(obj) { + var curtop = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curtop += obj.offsetTop - obj.scrollTop; + } + } else if (obj.y) { + curtop += obj.y; + } + return curtop; +} + +//----------------------------------------------------------------------------- +// Date object extensions +// ---------------------------------------------------------------------------- + +Date.prototype.getTwelveHours = function() { + hours = this.getHours(); + if (hours == 0) { + return 12; + } + else { + return hours <= 12 ? hours : hours-12 + } +} + +Date.prototype.getTwoDigitMonth = function() { + return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1); +} + +Date.prototype.getTwoDigitDate = function() { + return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); +} + +Date.prototype.getTwoDigitTwelveHour = function() { + return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); +} + +Date.prototype.getTwoDigitHour = function() { + return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); +} + +Date.prototype.getTwoDigitMinute = function() { + return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); +} + +Date.prototype.getTwoDigitSecond = function() { + return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); +} + +Date.prototype.getHourMinute = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); +} + +Date.prototype.getHourMinuteSecond = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); +} + +Date.prototype.strftime = function(format) { + var fields = { + c: this.toString(), + d: this.getTwoDigitDate(), + H: this.getTwoDigitHour(), + I: this.getTwoDigitTwelveHour(), + m: this.getTwoDigitMonth(), + M: this.getTwoDigitMinute(), + p: (this.getHours() >= 12) ? 'PM' : 'AM', + S: this.getTwoDigitSecond(), + w: '0' + this.getDay(), + x: this.toLocaleDateString(), + X: this.toLocaleTimeString(), + y: ('' + this.getFullYear()).substr(2, 4), + Y: '' + this.getFullYear(), + '%' : '%' + }; + var result = '', i = 0; + while (i < format.length) { + if (format.charAt(i) === '%') { + result = result + fields[format.charAt(i + 1)]; + ++i; + } + else { + result = result + format.charAt(i); + } + ++i; + } + return result; +} + +// ---------------------------------------------------------------------------- +// String object extensions +// ---------------------------------------------------------------------------- +String.prototype.pad_left = function(pad_length, pad_string) { + var new_string = this; + for (var i = 0; new_string.length < pad_length; i++) { + new_string = pad_string + new_string; + } + return new_string; +} + +// ---------------------------------------------------------------------------- +// Get the computed style for and element +// ---------------------------------------------------------------------------- +function getStyle(oElm, strCssRule){ + var strValue = ""; + if(document.defaultView && document.defaultView.getComputedStyle){ + strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); + } + else if(oElm.currentStyle){ + strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ + return p1.toUpperCase(); + }); + strValue = oElm.currentStyle[strCssRule]; + } + return strValue; +} diff --git a/static/admin/js_orig/dateparse.js b/static/admin/js_orig/dateparse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/dateparse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/getElementsBySelector.js b/static/admin/js_orig/getElementsBySelector.js new file mode 100644 index 00000000..15b57a19 --- /dev/null +++ b/static/admin/js_orig/getElementsBySelector.js @@ -0,0 +1,167 @@ +/* document.getElementsBySelector(selector) + - returns an array of element objects from the current document + matching the CSS selector. Selectors can contain element names, + class names and ids and can be nested. For example: + + elements = document.getElementsBySelect('div#main p a.external') + + Will return an array of all 'a' elements with 'external' in their + class attribute that are contained inside 'p' elements that are + contained inside the 'div' element which has id="main" + + New in version 0.4: Support for CSS2 and CSS3 attribute selectors: + See http://www.w3.org/TR/css3-selectors/#attribute-selectors + + Version 0.4 - Simon Willison, March 25th 2003 + -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows + -- Opera 7 fails +*/ + +function getAllChildren(e) { + // Returns all children of element. Workaround required for IE5/Windows. Ugh. + return e.all ? e.all : e.getElementsByTagName('*'); +} + +document.getElementsBySelector = function(selector) { + // Attempt to fail gracefully in lesser browsers + if (!document.getElementsByTagName) { + return new Array(); + } + // Split selector in to tokens + var tokens = selector.split(' '); + var currentContext = new Array(document); + for (var i = 0; i < tokens.length; i++) { + token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');; + if (token.indexOf('#') > -1) { + // Token is an ID selector + var bits = token.split('#'); + var tagName = bits[0]; + var id = bits[1]; + var element = document.getElementById(id); + if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) { + // ID not found or tag with that ID not found, return false. + return new Array(); + } + // Set currentContext to contain just this element + currentContext = new Array(element); + continue; // Skip to next token + } + if (token.indexOf('.') > -1) { + // Token contains a class selector + var bits = token.split('.'); + var tagName = bits[0]; + var className = bits[1]; + if (!tagName) { + tagName = '*'; + } + // Get elements matching tag, filter them for class selector + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + try { + elements = currentContext[h].getElementsByTagName(tagName); + } + catch(e) { + elements = []; + } + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) { + currentContext[currentContextIndex++] = found[k]; + } + } + continue; // Skip to next token + } + // Code to deal with attribute selectors + if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) { + var tagName = RegExp.$1; + var attrName = RegExp.$2; + var attrOperator = RegExp.$3; + var attrValue = RegExp.$4; + if (!tagName) { + tagName = '*'; + } + // Grab all of the tagName elements within current context + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + elements = currentContext[h].getElementsByTagName(tagName); + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + var checkFunction; // This function will be used to filter the elements + switch (attrOperator) { + case '=': // Equality + checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); }; + break; + case '~': // Match one of space seperated words + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); }; + break; + case '|': // Match start with value followed by optional hyphen + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); }; + break; + case '^': // Match starts with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); }; + break; + case '$': // Match ends with value - fails with "Warning" in Opera 7 + checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); }; + break; + case '*': // Match ends with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); }; + break; + default : + // Just test for existence of attribute + checkFunction = function(e) { return e.getAttribute(attrName); }; + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (checkFunction(found[k])) { + currentContext[currentContextIndex++] = found[k]; + } + } + // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue); + continue; // Skip to next token + } + // If we get here, token is JUST an element (not a class or ID selector) + tagName = token; + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements = currentContext[h].getElementsByTagName(tagName); + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = found; + } + return currentContext; +} + +/* That revolting regular expression explained +/^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/ + \---/ \---/\-------------/ \-------/ + | | | | + | | | The value + | | ~,|,^,$,* or = + | Attribute + Tag +*/ diff --git a/static/admin/js_orig/inlines.js b/static/admin/js_orig/inlines.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/inlines.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/inlines.min.js b/static/admin/js_orig/inlines.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/inlines.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/jquery.init.js b/static/admin/js_orig/jquery.init.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/jquery.init.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/jquery.js b/static/admin/js_orig/jquery.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/jquery.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/jquery.min.js b/static/admin/js_orig/jquery.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/jquery.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/json.min.js b/static/admin/js_orig/json.min.js new file mode 100644 index 00000000..f708ed51 --- /dev/null +++ b/static/admin/js_orig/json.min.js @@ -0,0 +1,29 @@ + +if(!this.JSON){this.JSON={};} +(function(){function f(n){return n<10?'0'+n:n;} +if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ +f(this.getUTCMonth()+1)+'-'+ +f(this.getUTCDate())+'T'+ +f(this.getUTCHours())+':'+ +f(this.getUTCMinutes())+':'+ +f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} +var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} +function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} +if(typeof rep==='function'){value=rep.call(holder,key,value);} +switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} +gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i 0) { + values.push($(field).val()); + } + }) + field.val(URLify(values.join(' '), maxLength)); + }; + + $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); + }); + }; +})(grp.jQuery); \ No newline at end of file diff --git a/static/admin/js_orig/prepopulate.min.js b/static/admin/js_orig/prepopulate.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/prepopulate.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/timeparse.js b/static/admin/js_orig/timeparse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/admin/js_orig/timeparse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/admin/js_orig/urlify.js b/static/admin/js_orig/urlify.js new file mode 100644 index 00000000..d8f2549e --- /dev/null +++ b/static/admin/js_orig/urlify.js @@ -0,0 +1,140 @@ +var LATIN_MAP = { + 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç': + 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I', + 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': + 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ű': 'U', + 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a', 'â': 'a', 'ã': 'a', 'ä': + 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', + 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': + 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', + 'û': 'u', 'ü': 'u', 'ű': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y' +} +var LATIN_SYMBOLS_MAP = { + '©':'(c)' +} +var GREEK_MAP = { + 'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8', + 'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p', + 'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w', + 'ά':'a', 'έ':'e', 'ί':'i', 'ό':'o', 'ύ':'y', 'ή':'h', 'ώ':'w', 'ς':'s', + 'ϊ':'i', 'ΰ':'y', 'ϋ':'y', 'ΐ':'i', + 'Α':'A', 'Β':'B', 'Γ':'G', 'Δ':'D', 'Ε':'E', 'Ζ':'Z', 'Η':'H', 'Θ':'8', + 'Ι':'I', 'Κ':'K', 'Λ':'L', 'Μ':'M', 'Ν':'N', 'Ξ':'3', 'Ο':'O', 'Π':'P', + 'Ρ':'R', 'Σ':'S', 'Τ':'T', 'Υ':'Y', 'Φ':'F', 'Χ':'X', 'Ψ':'PS', 'Ω':'W', + 'Ά':'A', 'Έ':'E', 'Ί':'I', 'Ό':'O', 'Ύ':'Y', 'Ή':'H', 'Ώ':'W', 'Ϊ':'I', + 'Ϋ':'Y' +} +var TURKISH_MAP = { + 'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U', + 'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G' +} +var RUSSIAN_MAP = { + 'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh', + 'з':'z', 'и':'i', 'й':'j', 'к':'k', 'л':'l', 'м':'m', 'н':'n', 'о':'o', + 'п':'p', 'р':'r', 'с':'s', 'т':'t', 'у':'u', 'ф':'f', 'х':'h', 'ц':'c', + 'ч':'ch', 'ш':'sh', 'щ':'sh', 'ъ':'', 'ы':'y', 'ь':'', 'э':'e', 'ю':'yu', + 'я':'ya', + 'А':'A', 'Б':'B', 'В':'V', 'Г':'G', 'Д':'D', 'Е':'E', 'Ё':'Yo', 'Ж':'Zh', + 'З':'Z', 'И':'I', 'Й':'J', 'К':'K', 'Л':'L', 'М':'M', 'Н':'N', 'О':'O', + 'П':'P', 'Р':'R', 'С':'S', 'Т':'T', 'У':'U', 'Ф':'F', 'Х':'H', 'Ц':'C', + 'Ч':'Ch', 'Ш':'Sh', 'Щ':'Sh', 'Ъ':'', 'Ы':'Y', 'Ь':'', 'Э':'E', 'Ю':'Yu', + 'Я':'Ya' +} +var UKRAINIAN_MAP = { + 'Є':'Ye', 'І':'I', 'Ї':'Yi', 'Ґ':'G', 'є':'ye', 'і':'i', 'ї':'yi', 'ґ':'g' +} +var CZECH_MAP = { + 'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u', + 'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T', + 'Ů':'U', 'Ž':'Z' +} + +var POLISH_MAP = { + 'ą':'a', 'ć':'c', 'ę':'e', 'ł':'l', 'ń':'n', 'ó':'o', 'ś':'s', 'ź':'z', + 'ż':'z', 'Ą':'A', 'Ć':'C', 'Ę':'e', 'Ł':'L', 'Ń':'N', 'Ó':'o', 'Ś':'S', + 'Ź':'Z', 'Ż':'Z' +} + +var LATVIAN_MAP = { + 'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n', + 'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i', + 'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z' +} + +var ALL_DOWNCODE_MAPS=new Array() +ALL_DOWNCODE_MAPS[0]=LATIN_MAP +ALL_DOWNCODE_MAPS[1]=LATIN_SYMBOLS_MAP +ALL_DOWNCODE_MAPS[2]=GREEK_MAP +ALL_DOWNCODE_MAPS[3]=TURKISH_MAP +ALL_DOWNCODE_MAPS[4]=RUSSIAN_MAP +ALL_DOWNCODE_MAPS[5]=UKRAINIAN_MAP +ALL_DOWNCODE_MAPS[6]=CZECH_MAP +ALL_DOWNCODE_MAPS[7]=POLISH_MAP +ALL_DOWNCODE_MAPS[8]=LATVIAN_MAP + +var Downcoder = new Object(); +Downcoder.Initialize = function() +{ + if (Downcoder.map) // already made + return ; + Downcoder.map ={} + Downcoder.chars = '' ; + for(var i in ALL_DOWNCODE_MAPS) + { + var lookup = ALL_DOWNCODE_MAPS[i] + for (var c in lookup) + { + Downcoder.map[c] = lookup[c] ; + Downcoder.chars += c ; + } + } + Downcoder.regex = new RegExp('[' + Downcoder.chars + ']|[^' + Downcoder.chars + ']+','g') ; +} + +downcode= function( slug ) +{ + Downcoder.Initialize() ; + var downcoded ="" + var pieces = slug.match(Downcoder.regex); + if(pieces) + { + for (var i = 0 ; i < pieces.length ; i++) + { + if (pieces[i].length == 1) + { + var mapped = Downcoder.map[pieces[i]] ; + if (mapped != null) + { + downcoded+=mapped; + continue ; + } + } + downcoded+=pieces[i]; + } + } + else + { + downcoded = slug; + } + return downcoded; +} + + +function URLify(s, num_chars) { + // changes, e.g., "Petty theft" to "petty_theft" + // remove all these words from the string before urlifying + s = downcode(s); + removelist = ["a", "an", "as", "at", "before", "but", "by", "for", "from", + "is", "in", "into", "like", "of", "off", "on", "onto", "per", + "since", "than", "the", "this", "that", "to", "up", "via", + "with"]; + r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi'); + s = s.replace(r, ''); + // if downcode doesn't hit, the char will be stripped here + s = s.replace(/[^-\w\s]/g, ''); // remove unneeded chars + s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces + s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens + s = s.toLowerCase(); // convert to lowercase + return s.substring(0, num_chars);// trim to first num_chars chars +} + diff --git a/static/autocomplete_light/addanother.js b/static/autocomplete_light/addanother.js new file mode 100644 index 00000000..ebc48990 --- /dev/null +++ b/static/autocomplete_light/addanother.js @@ -0,0 +1,101 @@ +$(document).ready(function() { + if (! $('a[onclick="return showAddAnotherPopup(this);"]').length) { + + /* Credit: django.contrib.admin (BSD) */ + + var showAddAnotherPopup = function(triggeringLink) { + var name = triggeringLink.attr( 'id' ).replace(/^add_/, ''); + name = id_to_windowname(name); + href = triggeringLink.attr( 'href' ); + + if (href.indexOf('?') == -1) { + href += '?'; + } + + href += '&winName=' + name; + + var height = 500; + var width = 800; + var left = (screen.width/2)-(width/2); + var top = (screen.height/2)-(height/2); + var win = window.open(href, name, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width='+width+', height='+height+', top='+top+', left='+left) + + function removeOverlay() { + if (win.closed) { + $('#yourlabs_overlay').remove(); + } else { + setTimeout(removeOverlay, 500); + } + } + + $('body').append('
      8) { + // If not on IE8 and friends, that's all we need to do. + return value === undefined ? this.data(key) : this.data(key, value); + } + + if ($.fn.yourlabsRegistry.data == undefined) { + $.fn.yourlabsRegistry.data = {}; + } + + if ($.fn.yourlabsRegistry.guid == undefined) { + $.fn.yourlabsRegistry.guid = function() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace( + /[xy]/g, + function(c) { + var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); + return v.toString(16); + } + ); + } + } + + var attributeName = 'data-yourlabs-' + key + '-registry-id'; + var id = this.attr(attributeName); + + if (id == undefined) { + id = $.fn.yourlabsRegistry.guid(); + this.attr(attributeName, id); + } + + if (value != undefined) { + $.fn.yourlabsRegistry.data[id] = value; + } + + return $.fn.yourlabsRegistry.data[id]; +} + +/* +The autocomplete class constructor: + +- takes a takes a text input element as argument, +- sets attributes and methods for this instance. + +The reason you want to learn about all this script is that you will then be +able to override any variable or function in it on a case-per-case basis. +However, overriding is the job of the jQuery plugin so the procedure is +described there. +*/ +yourlabs.Autocomplete = function (input) { + /* + The text input element that should have an autocomplete. + */ + this.input = input; + + // The value of the input. It is kept as an attribute for optimisation + // purposes. + this.value = ''; + + /* + It is possible to wait until a certain number of characters have been + typed in the input before making a request to the server, to limit the + number of requests. + + However, you may want the autocomplete to behave like a select. If you + want that a simple click shows the autocomplete, set this to 0. + */ + this.minimumCharacters = 2; + + /* + In a perfect world, we would hide the autocomplete when the input looses + focus (on blur). But in reality, if the user clicks on a choice, the + input looses focus, and that would hide the autocomplete, *before* we + can intercept the click on the choice. + + When the input looses focus, wait for this number of milliseconds before + hiding the autocomplete. + */ + this.hideAfter = 500; + + /* + The server should have a URL that takes the input value, and responds + with the list of choices as HTML. In most cases, an absolute URL is + better. + */ + this.url = false; + + /* + Although this script will make sure that it doesn't have multiple ajax + requests at the time, it also supports debouncing. + + Set a number of milliseconds here, it is the number of milliseconds that it + will wait before querying the server. The higher it is, the less it will + spam the server but the more the user will wait. + */ + this.xhrWait = 200; + + /* + As the server responds with plain HTML, we need a selector to find the + choices that it contains. + + For example, if the URL returns an HTML body where every result is in a + div of class "choice", then this should be set to '.choice'. + */ + this.choiceSelector = '.choice'; + + /* + When the user hovers a choice, it is nice to hilight it, for + example by changing it's background color. That's the job of CSS code. + + However, the CSS can not depend on the :hover because the user can + hilight choices with the keyboard by pressing the up and down + keys. + + To counter that problem, we specify a particular class that will be set + on a choice when it's 'hilighted', and unset when it's + 'dehilighted'. + */ + this.hilightClass = 'hilight'; + + /* + The value of the input is passed to the server via a GET variable. This + is the name of the variable. + */ + this.queryVariable = 'q'; + + /* + This dict will also be passed to the server as GET variables. + + If this autocomplete depends on another user defined value, then the + other user defined value should be set in this dict. + + Consider a country select and a city autocomplete. The city autocomplete + should only fetch city choices that are in the selected country. To + achieve this, update the data with the value of the country select: + + $('select[name=country]').change(function() { + $('city[name=country]').yourlabsAutocomplete().data = { + country: $(this).val(), + } + }); + */ + this.data = {}; + + /* + To avoid several requests to be pending at the same time, the current + request is aborted before a new one is sent. This attribute will hold the + current XMLHttpRequest. + */ + this.xhr = false; + + /* + fetch() keeps a copy of the data sent to the server in this attribute. This + avoids double fetching the same autocomplete. + */ + this.lastData = {}; + + // The autocomplete box HTML. + this.box = $('') +} + +/* +Rather than directly setting up the autocomplete (DOM events etc ...) in +the constructor, setup is done in this method. This allows to: + +- instanciate an Autocomplete, +- override attribute/methods of the instance, +- and *then* setup the instance. + */ +yourlabs.Autocomplete.prototype.initialize = function() { + this.input + .on('blur.autocomplete', $.proxy(this.inputBlur, this)) + .on('click.autocomplete', $.proxy(this.inputClick, this)) + .on('keypress.autocomplete', $.proxy(this.inputKeypress, this)) + .on('keyup.autocomplete', $.proxy(this.inputKeyup, this)) + .on('keydown.autocomplete', $.proxy(this.inputKeydown, this)) + + /* + Bind mouse events to fire signals. Because the same signals will be + sent if the user uses keyboard to work with the autocomplete. + */ + this.box + .on('mouseenter', this.choiceSelector, $.proxy(this.boxMouseenter, this)) + .on('mouseleave', this.choiceSelector, $.proxy(this.boxMouseleave, this)) + .on('click', this.choiceSelector, $.proxy(this.boxClick, this)) + + /* + Initially - empty data queried + */ + this.data[this.queryVariable] = ''; +} + +// Unbind callbacks on input. +yourlabs.Autocomplete.prototype.destroy = function(input) { + input + .unbind('blur.autocomplete') + .unbind('click.autocomplete') + .unbind('keypress.autocomplete') + .unbind('keyup.autocomplete') + .unbind('keydown.autocomplete') +} + +yourlabs.Autocomplete.prototype.inputBlur = function(e) { + window.setTimeout($.proxy(this.hide, this), this.hideAfter); +} + +yourlabs.Autocomplete.prototype.inputClick = function(e) { + if (this.value.length >= this.minimumCharacters) + this.show(); +} + +// When mouse enters the box: +yourlabs.Autocomplete.prototype.boxMouseenter = function(e) { + // ... the first thing we want is to send the dehilight signal + // for any hilighted choice ... + var current = this.box.find('.' + this.hilightClass); + + this.input.trigger('dehilightChoice', + [current, this]); + + // ... and then sent the hilight signal for the choice. + this.input.trigger('hilightChoice', + [$(e.currentTarget), this]); +} + +// When mouse leaves the box: +yourlabs.Autocomplete.prototype.boxMouseleave = function(e) { + // Send dehilightChoice when the mouse leaves a choice. + this.input.trigger('dehilightChoice', + [this.box.find('.' + this.hilightClass), this]); +} + +// When mouse clicks in the box: +yourlabs.Autocomplete.prototype.boxClick = function(e) { + var current = this.box.find('.' + this.hilightClass); + + this.input.trigger('selectChoice', [current, this]); +} + +// Return the value to pass to this.queryVariable. +yourlabs.Autocomplete.prototype.getQuery = function() { + // Return the input's value by default. + return this.input.val(); +} + +yourlabs.Autocomplete.prototype.inputKeyup = function(e) { + if (!this.input.is(':visible')) + // Don't handle keypresses on hidden inputs (ie. with limited choices) + return; + + switch(e.keyCode) { + case 40: // down arrow + case 38: // up arrow + case 16: // shift + case 17: // ctrl + case 18: // alt + break + + case 9: // tab + case 13: // enter + if (!this.box.is(':visible')) return + + var choice = this.box.find('.' + this.hilightClass); + + if (!choice.length) { + // Don't get in the way, let the browser submit form or focus + // on next element. + return; + } + + e.preventDefault(); + e.stopPropagation(); + + this.input.trigger('selectChoice', [choice, this]); + break + + case 27: // escape + if (!this.box.is(':visible')) return + this.hide() + break + + default: + this.refresh() + } +} + +yourlabs.Autocomplete.prototype.inputKeydown = function(e) { + // Don't handle keypresses on hidden inputs (ie. with limited choices) + if (!this.input.is(':visible')) return; + + // Avoid double call to move(). + this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]) + + this.move(e); +} + +// This function is in charge of keyboard usage. +yourlabs.Autocomplete.prototype.inputKeypress = function(e) { + // Don't handle keypresses on hidden inputs (ie. with limited choices) + if (!this.input.is(':visible')) return; + + // Return if it already handled by inputKeydown. + if (this.suppressKeyPressRepeat) return; + + this.move(e); +} + +// This function is in charge of ensuring that a relevant autocomplete is +// shown. +yourlabs.Autocomplete.prototype.show = function(html) { + // First recalculate the absolute position since the autocomplete may + // have changed position. + this.fixPosition(); + + // Is autocomplete empty ? + var empty = $.trim(this.box.find(this.choiceSelector)).length == 0; + + // If the inner container is empty or data has changed and there is no + // current pending request, rely on fetch(), which should show the + // autocomplete as soon as it's done fetching. + if ((this.hasChanged() || empty) && !this.xhr) { + this.fetch(); + return; + } + + // And actually, fetch() will call show() with the response + // body as argument. + if (html != undefined) { + this.box.html(html); + } + + // Don't display empty boxes. + if (this.box.is(':empty')) { + if (this.box.is(':visible')) { + this.hide(); + } + return; + } + + var current = this.box.find('.' + this.hilightClass); + var first = this.box.find(this.choiceSelector + ':first'); + if (first && !current.length) { + first.addClass(this.hilightClass); + } + + // Show the inner and outer container only if necessary. + if (!this.box.is(':visible')) { + this.box.css('display', 'block'); + } +} + +// This function is in charge of the opposite. +yourlabs.Autocomplete.prototype.hide = function() { + this.box.hide(); +} + +// This function is in charge of hilighting the right result from keyboard +// navigation. +yourlabs.Autocomplete.prototype.move = function(e) { + // If the autocomplete should not be displayed then return. + if (this.value.length < this.minimumCharacters) return true; + + // The current choice if any. + var current = this.box.find('.' + this.hilightClass); + + // Prevent default browser behaviours on TAB and RETURN if a choice is + // hilighted. + if ($.inArray(e.keyCode, [9,13]) > -1 && current.length) { + e.preventDefault(); + } + + // If not KEY_UP or KEY_DOWN, then return. + if (e.keyCode == 38 && !e.shiftKey) var way = 'up'; + else if (e.keyCode == 40) var way = 'down'; + else return; + + // The first and last choices. If the user presses down on the last + // choice, then the first one will be hilighted. + var first = this.box.find(this.choiceSelector + ':first'); + var last = this.box.find(this.choiceSelector + ':last'); + + // The choice that should be hilighted after the move. + var target; + + // The autocomplete must be shown so that the user sees what choice + // he is hilighting. + this.show(); + + // If a choice is currently hilighted: + if (current.length) { + if (way == 'up') { + // The target choice becomes the first previous choice. + target = current.prevAll(this.choiceSelector + ':first'); + + // If none, then the last choice becomes the target. + if (!target.length) target = last; + } else { + // The target choice becomes the first next** choice. + target = current.nextAll(this.choiceSelector + ':first'); + + // If none, then the first choice becomes the target. + if (!target.length) target = first; + } + + // Trigger dehilightChoice on the currently hilighted choice. + this.input.trigger('dehilightChoice', + [current, this]); + } else { + target = way == 'up' ? last : first; + } + + // Avoid moving the cursor in the input. + e.preventDefault(); + + // Trigger hilightChoice on the target choice. + this.input.trigger('hilightChoice', + [target, this]); +} + +// Calculate and set the outer container's absolute positionning. +yourlabs.Autocomplete.prototype.fixPosition = function() { + // Insert the autocomplete container after the input. + var pos = $.extend({}, this.input.position(), { + height: this.input.outerHeight() + }); + + this.input.parents().filter(function() { + return $(this).css('overflow') === 'hidden'; + }).first().css('overflow', 'visible').addClass('autocomplete-light-clearfix'); + + this.box.insertAfter(this.input).css( + {top: pos.top + pos.height, left: pos.left}); +} + +// Proxy fetch(), with some sanity checks. +yourlabs.Autocomplete.prototype.refresh = function() { + // Set the new current value. + this.value = this.getQuery(); + + // If the input doesn't contain enought characters then abort, else fetch. + this.value.length < this.minimumCharacters ? this.hide() : this.fetch(); +} + +// Return true if the data for this query has changed from last query. +yourlabs.Autocomplete.prototype.hasChanged = function() { + for(var key in this.data) { + if (!key in this.lastData || this.data[key] != this.lastData[key]) { + return true; + } + } + return false; +} + +// Manage requests to this.url. +yourlabs.Autocomplete.prototype.fetch = function() { + // Add the current value to the data dict. + this.data[this.queryVariable] = this.value; + + // Ensure that this request is different from the previous one + if (!this.hasChanged()) { + // Else show the same box again. + this.show(); + return; + } + + this.lastData = {}; + for(var key in this.data) { + this.lastData[key] = this.data[key]; + } + + // Abort any current request. + if (this.xhr) this.xhr.abort(); + + // Abort any request that we planned to make. + if (this.timeoutId) clearTimeout(this.timeoutId); + + // Make an asynchronous GET request to this.url in this.xhrWait ms + this.timeoutId = setTimeout($.proxy(this.makeXhr, this), this.xhrWait); +} + +// Wrapped ajax call to use with setTimeout in fetch(). +yourlabs.Autocomplete.prototype.makeXhr = function() { + this.input.addClass('xhr-pending'); + + this.xhr = $.ajax(this.url, { + type: "GET", + data: this.data, + complete: $.proxy(this.fetchComplete, this) + }); +} + +// Callback for the ajax response. +yourlabs.Autocomplete.prototype.fetchComplete = function(jqXHR, textStatus) { + this.input.removeClass('xhr-pending'); + + if (this.xhr == jqXHR) this.xhr = false; + if (textStatus == 'abort') return; + this.show(jqXHR.responseText); +} + +/* +The jQuery plugin that manages Autocomplete instances across the various +inputs. It is named 'yourlabsAutocomplete' rather than just 'autocomplete' +to live happily with other plugins that may define an autocomplete() jQuery +plugin. + +It takes an array as argument, the array may contain any attribute or +function that should override the Autocomplete builtin. For example: + + $('input#your-autocomplete').yourlabsAutocomplete({ + url: '/some/url/', + hide: function() { + this.outerContainer + }, + }) + +Also, it implements a simple identity map, which means that: + + // First call for an input instanciates the Autocomplete instance + $('input#your-autocomplete').yourlabsAutocomplete({ + url: '/some/url/', + }); + + // Other calls return the previously created Autocomplete instance + $('input#your-autocomplete').yourlabsAutocomplete().data = { + newData: $('#foo').val(), + } + +To destroy an autocomplete, call yourlabsAutocomplete('destroy'). +*/ +$.fn.yourlabsAutocomplete = function(overrides) { + if (this.length < 1) { + // avoid crashing when called on a non existing element + return; + } + + var overrides = overrides ? overrides : {}; + var autocomplete = this.yourlabsRegistry('autocomplete'); + + if (overrides == 'destroy') { + if (autocomplete) { + autocomplete.destroy(this); + this.removeData('autocomplete'); + } + return + } + + // Disable the browser's autocomplete features on that input. + this.attr('autocomplete', 'off'); + + // If no Autocomplete instance is defined for this id, make one. + if (autocomplete == undefined) { + // Instanciate Autocomplete. + var autocomplete = new yourlabs.Autocomplete(this); + + // Extend the instance with data-autocomplete-* overrides + for (var key in this.data()) { + if (!key) continue; + if (key.substr(0, 12) != 'autocomplete' || key == 'autocomplete') + continue; + var newKey = key.replace('autocomplete', ''); + var newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1); + autocomplete[newKey] = this.data(key); + } + + // Extend the instance with overrides. + autocomplete = $.extend(autocomplete, overrides); + + if (!autocomplete.url) { + alert('Autocomplete needs a url !'); + return; + } + + this.yourlabsRegistry('autocomplete', autocomplete); + + // All set, call initialize(). + autocomplete.initialize(); + } + + // Return the Autocomplete instance for this id from the registry. + return autocomplete; +}; + +// Binding some default behaviors. +$(document).ready(function() { + function removeHilightClass(e, choice, autocomplete) { + choice.removeClass(autocomplete.hilightClass); + }; + $(document).bind('hilightChoice', function(e, choice, autocomplete) { + choice.addClass(autocomplete.hilightClass); + }); + $(document).bind('dehilightChoice', removeHilightClass); + $(document).bind('selectChoice', removeHilightClass); + $(document).bind('selectChoice', function(e, choice, autocomplete) { + autocomplete.hide(); + }); +}); diff --git a/static/autocomplete_light/delete.png b/static/autocomplete_light/delete.png new file mode 100644 index 00000000..d59bcd24 Binary files /dev/null and b/static/autocomplete_light/delete.png differ diff --git a/static/autocomplete_light/old_style.css b/static/autocomplete_light/old_style.css new file mode 100644 index 00000000..2cc7f109 --- /dev/null +++ b/static/autocomplete_light/old_style.css @@ -0,0 +1,122 @@ +/* + * Admin specific styling are prefixed with body.change-form. + */ + +.yourlabs-autocomplete +{ + position: absolute; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.yourlabs-autocomplete .hilight +{ + color: #ffffff !important; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.yourlabs-autocomplete .choice, .yourlabs-autocomplete [data-value], .yourlabs-autocomplete em +{ + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; + color: black; + cursor: pointer; +} + +/* + * You should use the "block" class because the "div" class is deprecated since + * 2.0. However, the "div" class is still supported for backward compatibility. + */ +.block, +.div +{ + display: block; +} + +/* admin specific */ +body.change-form .autocomplete-light-widget +{ + float: left; +} + +.autocomplete-light-widget .deck [data-value] +{ + list-style-type: none; + margin-bottom: 5px; + padding-right: 8px; + padding-bottom: 5px; +} + +.autocomplete-light-widget .deck [data-value] .remove +{ + background-image: url('../admin/img/inline-delete.png'); + color: #fff; + cursor: pointer; + float: left; + height: 15px; + margin-right: 10px; + text-indent: -999px; + width: 15px; +} + +.autocomplete-light-widget .deck [data-value] .remove:hover +{ + background-position: -15px 0; +} + +.yourlabs-autocomplete .choice-detail, +.yourlabs-autocomplete .choice-update +{ + display: none; +} + +/* grappelli specific */ +fieldset.grp-module .grp-row { + overflow: visible !important; +} + +/* credit: http://www.csslab.cl/2008/01/30/ventana-modal-solo-con-css/ */ +#yourlabs_overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #000; + z-index:1001; + opacity:.75; + -moz-opacity: 0.75; + filter: alpha(opacity=75); +} diff --git a/static/autocomplete_light/remote.js b/static/autocomplete_light/remote.js new file mode 100644 index 00000000..6fd05159 --- /dev/null +++ b/static/autocomplete_light/remote.js @@ -0,0 +1,41 @@ +if (window.yourlabs == undefined) window.yourlabs = {}; + +yourlabs.RemoteAutocompleteWidget = { + /* + The default deck getValue() implementation just returns the PK from the + choice HTML. RemoteAutocompleteWidget.getValue's implementation checks for + a url too. If a url is found, it will post to that url and expect the pk to + be in the response. + + This is how autocomplete-light supports proposing values that are not there + in the database until user selection. + */ + getValue: function(choice) { + var value = choice.data('value'); + + if (typeof(value)=='string' && isNaN(value) && value.match(/^https?:/)) { + $.ajax(this.autocompleteOptions.url, { + async: false, + type: 'post', + data: { + 'value': value + }, + success: function(text, jqXHR, textStatus) { + value = text; + } + }); + + choice.data('value', value); + } + + return value; + } +} + +$(document).bind('yourlabsWidgetReady', function() { + // Instanciate decks with RemoteAutocompleteWidget as override for all widgets with + // autocomplete 'remote'. + $('body').on('initialize', '.autocomplete-light-widget[data-bootstrap=rest_model]', function() { + $(this).yourlabsWidget(yourlabs.RemoteAutocompleteWidget); + }); +}); diff --git a/static/autocomplete_light/style.css b/static/autocomplete_light/style.css new file mode 100644 index 00000000..9e8bffe2 --- /dev/null +++ b/static/autocomplete_light/style.css @@ -0,0 +1,186 @@ +/* + * Admin specific styling are prefixed with body.change-form. + */ + +.yourlabs-autocomplete +{ + position: absolute; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.yourlabs-autocomplete .hilight +{ + color: #ffffff !important; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.yourlabs-autocomplete .choice, +.yourlabs-autocomplete [data-value], +.yourlabs-autocomplete em +{ + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; + color: black; + cursor: pointer; +} + +/* + * You should use the "block" class because the "div" class is deprecated since + * 2.0. However, the "div" class is still supported for backward compatibility. + */ +.block, +.div +{ + display: block; +} + +.autocomplete-light-widget { + display: inline-block; + /* for the add-another image */ + vertical-align: middle; +} + +.autocomplete-light-widget input, +.autocomplete-light-widget input:focus { + margin: 0; + outline: 0; + width: 230px; +} + +.autocomplete-light-widget { + /* "Position" the widget */ + position: relative; +} + +input.autocomplete { + position: relative; + vertical-align: top; +} + +input.autocomplete.xhr-pending { + background-image: url('xhr-pending.gif'); + background-repeat: no-repeat; + background-position: right; +} + +.autocomplete-light-widget.modern-style { + border: 1px solid lightgrey; + padding: 4px 4px 3px 4px; +} + +.autocomplete-light-widget.modern-style input, +.autocomplete-light-widget.modern-style input:focus { + border: 0; + margin: 2px 0; +} + +.autocomplete-light-widget.modern-style .deck [data-value], +.autocomplete-light-widget.modern-style .deck .choice { + border: 1px solid lightgrey; + border-radius: 4px; +} + +.autocomplete-light-widget.yourlabs-autocomplete { + position: absolute; + top: 100%; + left: 0; + z-index: 100; +} + +.autocomplete-light-widget .deck [data-value], +.autocomplete-light-widget .deck .choice +{ + list-style-type: none; + display: inline-block; + padding-top: 3px; + padding-right: 3px; +} + +.autocomplete-light-widget .deck [data-value] .remove +{ + background-image: url('delete.png'); + color: #fff; + cursor: pointer; + text-indent: -999px; + height: 16px; + width: 16px; + display: inline-block; + background-position-y: -1px; + background-repeat: no-repeat; +} + +.autocomplete-light-widget .deck [data-value] .remove:hover +{ + background-position: -15px 0; +} + +.yourlabs-autocomplete .choice-detail, +.yourlabs-autocomplete .choice-update +{ + display: none; +} + +/* These lines are important to avoid style change to the underlying divs */ +.autocomplete-light-clearfix:before, +.autocomplete-light-clearfix:after { + content: " "; + display: table; +} +.autocomplete-light-clearfix:after { + clear: both; +} +.autocomplete-light-clearfix { + *zoom: 1; +} + +/* grappelli specific */ +fieldset.grp-module .grp-row { + overflow: visible !important; +} + +/* credit: http://www.csslab.cl/2008/01/30/ventana-modal-solo-con-css/ */ +#yourlabs_overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #000; + z-index:1001; + opacity:.75; + -moz-opacity: 0.75; + filter: alpha(opacity=75); +} diff --git a/static/autocomplete_light/text_widget.js b/static/autocomplete_light/text_widget.js new file mode 100644 index 00000000..9b72f66a --- /dev/null +++ b/static/autocomplete_light/text_widget.js @@ -0,0 +1,274 @@ +/* +This script enables TextWidget, a widget for CharField that supports +autocomplete for comma-separated values. + +It's organization is not final, there are a couple of things that are also used +in widget.js that will be re-factored probably in a script called lib.js. + +The API however, is consistent with widget.js, and is not meant to change. + +For now, the script is composed of these parts: + +- a handful of jQuery extensions to ease treatment of comma separated values in + an input, +- yourlabs.TextWidget is stripped version of yourlabs.Widget, to handle the + behavior of a comma separated autocompleted input, +- yourlabsTextWidget jQuery extension which role is to manage TextWidget instances, +- yourlabsTextWidget initialization system, which supports dynamically added + autocompletes (ie. admin inlines) +*/ + +jQuery.fn.getSelectionStart = function(){ + // Written by jQuery4U + // http://www.jquery4u.com/snippets/6-jquery-cursor-functions/#.UDPQ9xXtFw8 +    if(this.lengh == 0) return -1; +    input = this[0]; +  +    var pos = input.value.length; +  +    if (input.createTextRange) { + if (window.getSelection) { + var r = window.getSelection(); //IE11 + } else { + var r = document.selection.createRange().duplicate(); + r.moveEnd('character', input.value.length); + } +        if (r.text == '') +         pos = input.value.length; +        pos = input.value.lastIndexOf(r.text); +    } else if(typeof(input.selectionStart)!="undefined") +    pos = input.selectionStart; +  +    return pos; +} + +jQuery.fn.getCursorPosition = function(){ + // Written by jQuery4U +    if(this.lengh == 0) return -1; +    return $(this).getSelectionStart(); +} + +// Return the word on which the cursor is on. +// +// Consider the pipe "|" as an ASCII representation of the cursor, with such an +// input value:: +// +// foo, bar|, baz +// +// getCursorWord would return 'bar'. +jQuery.fn.getCursorWord = function() { + var value = $(this).val(); + var positions = $(this).getCursorWordPositions(); + return value.substring(positions[0], positions[1]); +} + +// Return the offsets of the word on which the cursor is on. +// +// Consider the pipe "|" as an ASCII representation of the cursor, with such an +// input value:: +// +// foo, bar|, baz +// +// getCursorWord would return [6, 8]. +jQuery.fn.getCursorWordPositions = function() { + var position = $(this).getCursorPosition(); + var value = $(this).val(); + var word = ''; + + // find start of word + for(var start=position - 1; start >= 0; start--) { + if (value[start] == ',') { + break; + } + } + start = start < 0 ? 0 : start; + + // find end of word + for(var end=position; end <= value.length - 1; end++) { + if (value[end] == ',') { + break; + } + } + + while(value[start] == ',' || value[start] == ' ') start++; + while(value[end] == ',' || value[end] == ' ') end--; + + return [start, end + 1]; +} + +// TextWidget ties an input with an autocomplete. +yourlabs.TextWidget = function(input) { + this.input = input; + this.autocompleteOptions = { + getQuery: function() { + return this.input.getCursorWord(); + } + } +} + +// The widget is in charge of managing its Autocomplete. +yourlabs.TextWidget.prototype.initializeAutocomplete = function() { + this.autocomplete = this.input.yourlabsAutocomplete( + this.autocompleteOptions); + + // Add a class to ease css selection of autocompletes for widgets + this.autocomplete.box.addClass( + 'autocomplete-light-text-widget'); +}; + +// Bind Autocomplete.selectChoice signal to TextWidget.selectChoice() +yourlabs.TextWidget.prototype.bindSelectChoice = function() { + this.input.bind('selectChoice', function(e, choice) { + if (!choice.length) + return // placeholder: create choice here + + $(this).yourlabsTextWidget().selectChoice(choice); + }); +}; + +// Called when a choice is selected from the Autocomplete. +yourlabs.TextWidget.prototype.selectChoice = function(choice) { + var inputValue = this.input.val(); + var choiceValue = this.getValue(choice); + var positions = this.input.getCursorWordPositions(); + + var newValue = inputValue.substring(0, positions[0]); + newValue += choiceValue; + newValue += inputValue.substring(positions[1]); + + this.input.val(newValue); + this.input.focus(); +} + +// Return the value of an HTML choice, used to fill the input. +yourlabs.TextWidget.prototype.getValue = function(choice) { + return $.trim(choice.html().replace(/(<([^>]+)>)/ig,"")); +} + +// Initialize the widget. +yourlabs.TextWidget.prototype.initialize = function() { + this.initializeAutocomplete(); + this.bindSelectChoice(); +} + +// Destroy the widget. Takes a widget element because a cloned widget element +// will be dirty, ie. have wrong .input and .widget properties. +yourlabs.TextWidget.prototype.destroy = function(input) { + input + .unbind('selectChoice') + .yourlabsAutocomplete('destroy'); +} + +// TextWidget factory, registry and destroyer, as jQuery extension. +$.fn.yourlabsTextWidget = function(overrides) { + var overrides = overrides ? overrides : {}; + + if (overrides == 'destroy') { + var widget = this.data('widget'); + if (widget) { + widget.destroy(this); + this.removeData('widget'); + } + return + } + + if (this.data('widget') == undefined) { + // Instanciate the widget + var widget = new yourlabs.TextWidget(this); + + // Pares data-* + var data = this.data(); + var dataOverrides = { + autocompleteOptions: { + // workaround a display bug + minimumCharacters: 0, + getQuery: function() { + // Override getQuery since we need the autocomplete to filter + // choices based on the word the cursor is on, rather than the full + // input value. + return this.input.getCursorWord(); + } + } + }; + for (var key in data) { + if (!key) continue; + + if (key.substr(0, 12) == 'autocomplete') { + if (key == 'autocomplete') continue; + + var newKey = key.replace('autocomplete', ''); + newKey = newKey.replace(newKey[0], newKey[0].toLowerCase()) + dataOverrides['autocompleteOptions'][newKey] = data[key]; + } else { + dataOverrides[key] = data[key]; + } + } + + // Allow attribute overrides + widget = $.extend(widget, dataOverrides); + + // Allow javascript object overrides + widget = $.extend(widget, overrides); + + this.data('widget', widget); + + // Setup for usage + widget.initialize(); + + // Widget is ready + widget.input.attr('data-widget-ready', 1); + widget.input.trigger('widget-ready'); + } + + return this.data('widget'); +} + +$(document).ready(function() { + $('body').on('initialize', 'input[data-widget-bootstrap=text]', function() { + /* + Only setup autocompletes on inputs which have + data-widget-bootstrap=text, if you want to initialize some + autocompletes with custom code, then set + data-widget-boostrap=yourbootstrap or something like that. + */ + $(this).yourlabsTextWidget(); + }); + + // Solid initialization, usage:: + // + // $(document).bind('yourlabsTextWidgetReady', function() { + // $('body').on('initialize', 'input[data-widget-bootstrap=text]', function() { + // $(this).yourlabsTextWidget({ + // yourCustomArgs: // ... + // }) + // }); + // }); + $(document).trigger('yourlabsTextWidgetReady'); + + $('.autocomplete-light-text-widget:not([id*="__prefix__"])').each(function() { + $(this).trigger('initialize'); + }); + + $(document).bind('DOMNodeInserted', function(e) { + var widget = $(e.target).find('.autocomplete-light-text-widget'); + + if (!widget.length) { + widget = $(e.target).is('.autocomplete-light-text-widget') ? $(e.target) : false; + + if (!widget) { + return; + } + } + + // Ignore inserted autocomplete box elements. + if (widget.is('.yourlabs-autocomplete')) { + return; + } + + // Ensure that the newly added widget is clean, in case it was cloned. + widget.yourlabsWidget('destroy'); + widget.find('input').yourlabsAutocomplete('destroy'); + + widget.trigger('initialize'); + }); +}) diff --git a/static/autocomplete_light/widget.js b/static/autocomplete_light/widget.js new file mode 100644 index 00000000..5a161104 --- /dev/null +++ b/static/autocomplete_light/widget.js @@ -0,0 +1,443 @@ +/* +Widget complements Autocomplete by enabling autocompletes to be used as +value holders. It looks very much like Autocomplete in its design. Thus, it +is recommended to read the source of Autocomplete first. + +Widget behaves like the autocomplete in facebook profile page, which all +users should be able to use. + +Behind the scenes, Widget maintains a normal hidden select which makes it +simple to play with on the server side like on the client side. If a value +is added and selected in the select element, then it is added to the deck, +and vice-versa. + +It needs some elements, and established vocabulary: + +- ".autocomplete-light-widget" element wraps all the HTML necessary for the + widget, +- ".deck" contains the list of selected choice(s) as HTML, +- "input" should be the text input that has the Autocomplete, +- "select" a (optionnaly multiple) select +- ".remove" a (preferabely hidden) element that contains a value removal + indicator, like an "X" sign or a trashcan icon, it is used to prefix every + children of the deck +- ".choice-template" a (preferabely hidden) element that contains the template + for choices which are added directly in the select, as they should be + copied in the deck, + +To avoid complexity, this script relies on extra HTML attributes, and +particularely one called 'data-value'. Learn more about data attributes: +http://dev.w3.org/html5/spec/global-attributes.html#embedding-custom-non-visible-data-with-the-data-attributes + +When a choice is selected from the Autocomplete, its element is cloned +and appended to the deck - "deck" contains "choices". It is important that the +choice elements of the autocomplete all contain a data-value attribute. +The value of data-value is used to fill the selected options in the hidden +select field. + +If choices may not all have a data-value attribute, then you can +override Widget.getValue() to implement your own logic. +*/ + +// Our class will live in the yourlabs global namespace. +if (window.yourlabs == undefined) window.yourlabs = {}; + +$.ajaxSettings.traditional = true + +/* +Instanciate a Widget. +*/ +yourlabs.Widget = function(widget) { + // These attributes where described above. + this.widget = widget; + this.input = this.widget.find('input'); + this.select = this.widget.find('select'); + this.deck = this.widget.find('.deck'); + this.choiceTemplate = this.widget.find('.choice-template .choice'); + + // The number of choices that the user may select with this widget. Set 0 + // for no limit. In the case of a foreign key you want to set it to 1. + this.maximumValues = 0; + + // Clear input when choice made? 1 for yes, 0 for no + this.clearInputOnSelectChoice = "1"; +} + +// When a choice is selected from the autocomplete of this widget, +// getValue() is called to add and select the option in the select. +yourlabs.Widget.prototype.getValue = function(choice) { + return choice.attr('data-value'); +}; + +// The widget is in charge of managing its Autocomplete. +yourlabs.Widget.prototype.initializeAutocomplete = function() { + this.autocomplete = this.input.yourlabsAutocomplete() + + // Add a class to ease css selection of autocompletes for widgets + this.autocomplete.box.addClass('autocomplete-light-widget'); +}; + +// Bind Autocomplete.selectChoice signal to Widget.selectChoice() +yourlabs.Widget.prototype.bindSelectChoice = function() { + this.input.bind('selectChoice', function(e, choice) { + if (!choice.length) + return // placeholder: create choice here + + var widget = $(this).parents('.autocomplete-light-widget' + ).yourlabsWidget(); + + widget.selectChoice(choice); + }); +}; + +// Called when a choice is selected from the Autocomplete. +yourlabs.Widget.prototype.selectChoice = function(choice) { + // Get the value for this choice. + var value = this.getValue(choice); + + if (!value) { + if (window.console) console.log('yourlabs.Widget.getValue failed'); + return; + } + + this.freeDeck(); + this.addToDeck(choice, value); + this.addToSelect(choice, value); + + var index = $(':input:visible').index(this.input); + this.resetDisplay(); + + if (this.input.is(':visible')) { + this.input.focus(); + } else { + var next = $(':input:visible:eq('+ index +')'); + next.focus(); + } + + if (this.clearInputOnSelectChoice === "1") + this.input.val(''); +} + +// Unselect a value if the maximum number of selected values has been +// reached. +yourlabs.Widget.prototype.freeDeck = function() { + var slots = this.maximumValues - this.deck.children().length; + + if (this.maximumValues && slots < 1) { + // We'll remove the first choice which is supposed to be the oldest + var choice = $(this.deck.children()[0]); + + this.deselectChoice(choice); + } +} + +// Empty the search input and hide it if maximumValues has been reached. +yourlabs.Widget.prototype.resetDisplay = function() { + var selected = this.select.find('option:selected').length; + + if (this.maximumValues && selected == this.maximumValues) { + this.input.hide(); + } else { + this.input.show(); + } + + this.deck.show(); + + // Also fix the position if the autocomplete is shown. + if (this.autocomplete.box.is(':visible')) this.autocomplete.fixPosition(); +} + +yourlabs.Widget.prototype.deckChoiceHtml = function(choice, value) { + var deckChoice = choice.clone(); + + this.addRemove(deckChoice); + + return deckChoice; +} + +yourlabs.Widget.prototype.optionChoice = function(option) { + var optionChoice = this.choiceTemplate.clone(); + + var target = optionChoice.find('.append-option-html'); + + if (target.length) { + target.append(option.html()); + } else { + optionChoice.html(option.html()); + } + + return optionChoice; +} + +yourlabs.Widget.prototype.addRemove = function(choices) { + var removeTemplate = this.widget.find('.remove:last') + .clone().css('display', 'inline-block'); + + var target = choices.find('.prepend-remove'); + + if (target.length) { + target.prepend(removeTemplate); + } else { + // Add the remove icon to each choice + choices.prepend(removeTemplate); + } +} + +// Add a selected choice of a given value to the deck. +yourlabs.Widget.prototype.addToDeck = function(choice, value) { + var existing_choice = this.deck.find('[data-value="'+value+'"]'); + + // Avoid duplicating choices in the deck. + if (!existing_choice.length) { + var deckChoice = this.deckChoiceHtml(choice); + + // In case getValue() actually **created** the value, for example + // with a post request. + deckChoice.attr('data-value', value); + + this.deck.append(deckChoice); + } +} + +// Add a selected choice of a given value to the deck. +yourlabs.Widget.prototype.addToSelect = function(choice, value) { + var option = this.select.find('option[value="'+value+'"]'); + + if (! option.length) { + this.select.append( + ''); + option = this.select.find('option[value="'+value+'"]'); + } + + option.attr('selected', 'selected'); + + this.select.trigger('change'); + this.updateAutocompleteExclude(); +} + +// Called when the user clicks .remove in a deck choice. +yourlabs.Widget.prototype.deselectChoice = function(choice) { + var value = this.getValue(choice); + + this.select.find('option[value="'+value+'"]').remove(); + this.select.trigger('change'); + + choice.remove(); + + if (this.deck.children().length == 0) { + this.deck.hide(); + } + + this.updateAutocompleteExclude(); + this.resetDisplay(); +}; + +yourlabs.Widget.prototype.updateAutocompleteExclude = function() { + var widget = this; + var choices = this.deck.find(this.autocomplete.choiceSelector); + + this.autocomplete.data['exclude'] = $.map(choices, function(choice) { + return widget.getValue($(choice)); + }); +} + +yourlabs.Widget.prototype.initialize = function() { + this.initializeAutocomplete(); + + // Working around firefox tempering form values after reload + var widget = this; + this.deck.find(this.autocomplete.choiceSelector).each(function() { + var value = widget.getValue($(this)); + var option = widget.select.find('option[value="'+value+'"]'); + if (!option.attr('selected')) option.attr('selected', true); + }); + + var choices = this.deck.find( + this.input.yourlabsAutocomplete().choiceSelector); + + this.addRemove(choices); + this.resetDisplay(); + + this.bindSelectChoice(); + this.clearBoth() +} + +// Add an empty div with clear:both after the widget's container. +// This is meant to support django-responsive-admin templates. +yourlabs.Widget.prototype.clearBoth = function() { + this.widget.parent().append('
      '); +} + +// Destroy the widget. Takes a widget element because a cloned widget element +// will be dirty, ie. have wrong .input and .widget properties. +yourlabs.Widget.prototype.destroy = function(widget) { + widget.find('input') + .unbind('selectChoice') + .yourlabsAutocomplete('destroy'); +} + +// Get or create or destroy a widget instance. +// +// On first call, yourlabsWidget() will instanciate a widget applying all +// passed overrides. +// +// On later calls, yourlabsWidget() will return the previously created widget +// instance, which is stored in widget.data('widget'). +// +// Calling yourlabsWidget('destroy') will destroy the widget. Useful if the +// element was blindly cloned with .clone(true) for example. +$.fn.yourlabsWidget = function(overrides) { + var overrides = overrides ? overrides : {}; + + var widget = this.yourlabsRegistry('widget'); + + if (overrides == 'destroy') { + if (widget) { + widget.destroy(this); + this.removeData('widget'); + } + return + } + + if (widget == undefined) { + // Instanciate the widget + var widget = new yourlabs.Widget(this); + + // Extend the instance with data-widget-* overrides + for (var key in this.data()) { + if (!key) continue; + if (key.substr(0, 6) != 'widget' || key == 'widget') continue; + var newKey = key.replace('widget', ''); + var newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1); + widget[newKey] = this.data(key); + } + + // Allow javascript object overrides + widget = $.extend(widget, overrides); + + $(this).yourlabsRegistry('widget', widget); + + // Setup for usage + widget.initialize(); + + // Widget is ready + widget.widget.attr('data-widget-ready', 1); + widget.widget.trigger('widget-ready'); + } + + return widget; +} + +$(document).ready(function() { + $('body').on('initialize', '.autocomplete-light-widget[data-widget-bootstrap=normal]', function() { + /* + Only setup widgets which have data-widget-bootstrap=normal, if you want to + initialize some Widgets with custom code, then set + data-widget-boostrap=yourbootstrap or something like that. + */ + $(this).yourlabsWidget(); + }); + + // Call Widget.deselectChoice when .remove is clicked + $('body').on('click', '.autocomplete-light-widget .deck .remove', function() { + var widget = $(this).parents('.autocomplete-light-widget' + ).yourlabsWidget(); + + var selector = widget.input.yourlabsAutocomplete().choiceSelector; + var choice = $(this).parents(selector); + + widget.deselectChoice(choice); + }); + + // Solid initialization, usage: + // + // + // $(document).bind('yourlabsWidgetReady', function() { + // $('.your.autocomplete-light-widget').on('initialize', function() { + // $(this).yourlabsWidget({ + // yourCustomArgs: // ... + // }) + // }); + // }); + $(document).trigger('yourlabsWidgetReady'); + + $('.autocomplete-light-widget:not([id*="__prefix__"])').each(function() { + $(this).trigger('initialize'); + }); + + $(document).bind('DOMNodeInserted', function(e) { + /* + Support values added directly in the select via js (ie. choices created in + modal or popup). + + For this, we listen to DOMNodeInserted and intercept insert of ') + */ + if ($(e.target).is('option')) { // added an option ? + var widget = $(e.target).parents('.autocomplete-light-widget'); + + if (!widget.length) { + return; + } + + widget = widget.yourlabsWidget(); + var option = $(e.target); + var value = option.attr('value'); + var choice = widget.deck.find('[data-value="'+value+'"]'); + + if (!choice.length) { + var deckChoice = widget.optionChoice(option); + + deckChoice.attr('data-value', value); + + widget.selectChoice(deckChoice); + } + } else { // added a widget ? + var notReady = '.autocomplete-light-widget:not([data-widget-ready])' + var widget = $(e.target).find(notReady); + + if (!widget.length) { + return; + } + + // Ignore inserted autocomplete box elements. + if (widget.is('.yourlabs-autocomplete')) { + return; + } + + // Ensure that the newly added widget is clean, in case it was + // cloned with data. + widget.yourlabsWidget('destroy'); + widget.find('input').yourlabsAutocomplete('destroy'); + + // added a widget: initialize the widget. + widget.trigger('initialize'); + } + }); + + var ie = yourlabs.getInternetExplorerVersion(); + if (ie != -1 && ie < 9) { + observe = [ + '.autocomplete-light-widget:not([data-yourlabs-skip])', + '.autocomplete-light-widget option:not([data-yourlabs-skip])' + ].join(); + $(observe).attr('data-yourlabs-skip', 1); + + function ieDOMNodeInserted() { + // http://msdn.microsoft.com/en-us/library/ms536957 + $(observe).each(function() { + $(document).trigger(jQuery.Event('DOMNodeInserted', {target: $(this)})); + $(this).attr('data-yourlabs-skip', 1); + }); + + setTimeout(ieDOMNodeInserted, 500); + } + setTimeout(ieDOMNodeInserted, 500); + } + +}); diff --git a/static/autocomplete_light/xhr-pending.gif b/static/autocomplete_light/xhr-pending.gif new file mode 100644 index 00000000..d0bce154 Binary files /dev/null and b/static/autocomplete_light/xhr-pending.gif differ diff --git a/static/grappelli/css/admin-tools.css b/static/grappelli/css/admin-tools.css new file mode 100644 index 00000000..1c932ff5 --- /dev/null +++ b/static/grappelli/css/admin-tools.css @@ -0,0 +1,85 @@ + + + +/* Tools in Breadcrumbs: Edit Mode, Trash List +------------------------------------------------------------------------------------------------------ */ + +#breadcrumbs .tools { + margin: -7px 32px -20px 0; +} + +#breadcrumbs .tools > li > a { + padding: 0; + width: 20px; + height: 30px; + border: 0; +} +#breadcrumbs .tools a.edit-dashboard-toggle-handler:link, #breadcrumbs .tools a.edit-dashboard-toggle-handler:visited { + background: transparent url('../img/icons/icon-edit-dashboard-toggle-handler.png') 50% 50% no-repeat; +} +#breadcrumbs .tools a.edit-dashboard-toggle-handler:hover, #breadcrumbs .tools a.edit-dashboard-toggle-handler:active, +#breadcrumbs .tools a.tools-active.edit-dashboard-toggle-handler { + background: transparent url('../img/icons/icon-edit-dashboard-toggle-handler-hover.png') 50% 50% no-repeat !important; +} + +#breadcrumbs .tools a.trash-list-toggle-handler:link, #breadcrumbs .tools a.trash-list-toggle-handler:visited { + background: transparent url('../img/icons/icon-trash-list-toggle-handler.png') 50% 50% no-repeat; +} +#breadcrumbs .tools a.trash-list-toggle-handler:hover, #breadcrumbs .tools a.trash-list-toggle-handler:active, +#breadcrumbs .tools a.tools-active.trash-list-toggle-handler { + background: transparent url('../img/icons/icon-trash-list-toggle-handler-hover.png') 50% 50% no-repeat !important; +} + + +/* Trash List ......................................... */ + +ul.tools li.trash-list-container { + opacity: 1 !important; + overflow: visible !important; +} + +ul.trash-list { + position: absolute; + float: none; + display: block; + right: 2px; + z-index: 900; + top: 28px; + min-width: 218px; + border: 1px solid #ccc; + border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; + border-top-right-radius: 0; -moz-border-radius-topright: 0 !important; -webkit-border-top-right-radius: 0; + border-top-left-radius: 0; -moz-border-radius-topleft: 0 !important; -webkit-border-top-left-radius: 0; + background: #e6e6e6; + box-shadow: 0 10px 50px #ccc; -moz-box-shadow: 0 10px 50px #ccc; -webkit-box-shadow: 0 10px 50px #ccc; +} + +/* Empty breaks in Chrome 11+: Elements are not displayed initially even if they are not empty */ +/*ul.trash-list:empty { + display: none; +}*/ + +ul.trash-list li { + position: relative; + float: none; + margin: 0 !important; + width: 100%; + border-top: 1px solid #f4f4f4 !important; + border-bottom: 1px solid #d4d4d4 !important; +} +ul.trash-list li:last-child { + border-bottom: 0 !important; +} + +ul.trash-list li a { + padding-left: 10px; + border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; + background: transparent !important; + opacity: 1 !important; +} +ul.trash-list li a:link, ul.trash-list li a:visited { + color: #309bbf; +} +ul.trash-list li a:hover, ul.trash-list li a:active { + color: #444; +} \ No newline at end of file diff --git a/static/grappelli/css/base.css b/static/grappelli/css/base.css new file mode 100644 index 00000000..1f33cc04 --- /dev/null +++ b/static/grappelli/css/base.css @@ -0,0 +1,35 @@ + + + +/* Reset Styles (reset.css of Blueprint www.blueprintcss.org) +------------------------------------------------------------------------------------------------------ */ + +@import url('reset.css'); + + + +/* Grappelli Styles: + The core settings of Grappelli are defined here. + Do not change them (better use your own skins/css in the next section). +------------------------------------------------------------------------------------------------------ */ + +@import url('typography.css'); +@import url('structures.css'); +@import url('components.css'); +@import url('tools.css'); +@import url('forms.css'); +@import url('buttons.css'); +@import url('tables.css'); +@import url('admin-tools.css'); + + + +/* Grappelli Skins & Custom Styles: + Use the delivered Grappelli skins or import your own skins/css here +------------------------------------------------------------------------------------------------------ */ + +/* Grappelli Basic Skin: The Plain Version */ +/*@import url('grappelli-skin-basic.css');*/ + +/* Grappelli Default Skin: Adds Border-Radius & Background-Gradients to the Grappelli Basic Skin */ +@import url('grappelli-skin-default.css'); diff --git a/static/grappelli/css/buttons.css b/static/grappelli/css/buttons.css new file mode 100644 index 00000000..9a7183b4 --- /dev/null +++ b/static/grappelli/css/buttons.css @@ -0,0 +1,379 @@ + + + +/* Submit, Delete & Cancel Buttons +------------------------------------------------------------------------------------------------------ */ + +input[type=submit], input[type=reset], input[type=button], button { + margin-top: 0; + margin-bottom: 0; + padding: 4px 5px 5px; + width: auto; + height: 25px; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + cursor: pointer; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + input[type=submit], input[type=reset], input[type=button], button { + padding: 5px 8px 4px; + } +} + +.submit-row a.submit-link, +.submit-row a.delete-link, +.submit-row a.cancel-link { + display: block; + padding: 5px 10px; + font-weight: bold; +} +.submit-row input[type=submit], +.submit-row input[type=button] { + padding: 5px 10px; + height: 28px; + font-weight: bold; +} + +input[type=submit], +#bookmark-add-cancel, +.submit-row a.delete-link:link, .submit-row a.delete-link:visited, +.submit-row a.cancel-link:link, .submit-row a.cancel-link:visited, +.submit-row input[type=button] { + opacity: .6; +} + +input[type=submit]:hover, +#bookmark-add-cancel:hover, +.submit-row a.delete-link:hover, .submit-row a.delete-link:active, +.submit-row a.cancel-link:hover, .submit-row a.cancel-link:active, +.submit-row input[type=button]:hover { + opacity: 1; +} + +input[type=submit].default { + opacity: 1; +} + + + +/* Icons & Buttons +------------------------------------------------------------------------------------------------------ */ + +button.fb_show, +button.ui-datepicker-trigger, +button.ui-timepicker-trigger, +button.ui-gAutocomplete-browse, +button.ui-gAutoSlugField-toggle, +button.ui-gFacelist-browse, +a.button, +.vDateField + span a, +.vTimeField + span a, +a.fb_show, +a.related-lookup, +a.add-another { + position: relative; + margin-left: -25px; +} + +button.fb_show, +button.ui-gAutocomplete-browse, +button.ui-gFacelist-browse, +button.ui-gAutoSlugField-toggle, +button.ui-datepicker-trigger, +button.ui-timepicker-trigger, +button.fb_show:hover, +button.ui-gAutocomplete-browse:hover, +button.ui-gFacelist-browse:hover, +button.ui-gAutoSlugField-toggle:hover, +button.ui-datepicker-trigger:hover, +button.ui-timepicker-trigger:hover { + width: 25px; + background: 50% 50% no-repeat; +} +button.fb_show[disabled], +button.ui-gAutocomplete-browse[disabled], +button.ui-gFacelist-browse[disabled], +button.ui-gAutoSlugField-toggle[disabled], +button.ui-datepicker-trigger[disabled], +button.ui-timepicker-trigger[disabled], +input[disabled] + a { + background: 50% 50% no-repeat !important; + opacity: 0.3; + cursor: auto !important; +} + +#changelist table button { + top: -5px; + margin-bottom: -12px; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + #changelist table button { + margin-bottom: -11px; + } +} + + +/* Hide Images in Templates ........................................... */ + +a.add-another img, a.related-lookup img { + opacity: 0; +} +a.related-lookup img { + display: none; +} + + +/* Autocomplete Button ......................................... */ + +button.ui-gAutocomplete-browse, +button.ui-gFacelist-browse { + background-image: url('../img/icons/icon-related-lookup.png'); +} +button.ui-gAutocomplete-browse:hover, +button.ui-gFacelist-browse:hover { + background-image: url('../img/icons/icon-related-lookup-hover.png'); +} +button.ui-gAutocomplete-browse[disabled], button.ui-gAutocomplete-browse[disabled]:hover, +button.ui-gFacelist-browse[disabled], button.ui-gFacelist-browse[disabled]:hover { + background-image: url('../img/icons/icon-related-lookup-hover.png') !important; +} + + +/* AutoSlugField Button ......................................... */ + +/* TODO: lock/unlock icons .. */ + +button.ui-gAutoSlugField-toggle { + background-image: url('../img/icons/icon-related-lookup.png'); +} +button.ui-gAutoSlugField-toggle:hover { + background-image: url('../img/icons/icon-related-lookup-hover.png'); +} +button.ui-gAutoSlugField-toggle[disabled], button.ui-gAutoSlugField-toggle[disabled]:hover { + background-image: url('../img/icons/icon-related-lookup-hover.png') !important; +} + + +/* Datepicker Button ......................................... */ + +button.ui-datepicker-trigger { + background-image: url('../img/icons/icon-datepicker.png'); +} +button.ui-datepicker-trigger:hover { + background-image: url('../img/icons/icon-datepicker-hover.png'); +} +button.ui-datepicker-trigger[disabled], button.ui-datepicker-trigger[disabled]:hover { + background-image: url('../img/icons/icon-datepicker-hover.png') !important; +} + + +/* Timepicker Button ......................................... */ + +button.ui-timepicker-trigger { + background-image: url('../img/icons/icon-timepicker.png'); +} +button.ui-timepicker-trigger:hover { + background-image: url('../img/icons/icon-timepicker-hover.png'); +} +button.ui-timepicker-trigger[disabled], button.ui-timepicker-trigger[disabled]:hover { + background-image: url('../img/icons/icon-timepicker-hover.png') !important; +} + + +/* Search Button ......................................... */ + +button.search { + position: relative; + float: right; + top: 0; + right: 5px; + margin: 0 0 0 -30px; + background: url('../img/icons/icon-search.png') 0 50% no-repeat scroll; +} +button.search:hover { + background: url('../img/icons/icon-search-hover.png') 0 50% no-repeat scroll; +} +button.search[disabled], button.search[disabled]:hover { + background: url('../img/icons/icon-search-hover.png') 0 50% no-repeat scroll !important; +} + + + +/* Links as Buttons +------------------------------------------------------------------------------------------------------ */ + +a.button, +.datecrumbs a, +.datecrumbs span { + display: inline-block; + padding: 4px 8px 4px; + font-size: 11px; + font-weight: bold; +} + + +/* Drop-Down Button ......................................... */ + +a.button.drop-down { + float: right; + padding-left: 20px; + padding-top: 3px; +} +a.button.drop-down[class*="selected"] { + position: relative; + z-index: 1000; + height: 17px; +} +a.button.drop-down:link, a.button.drop-down:visited { + background: url('../img/icons/icon-dropdown.png') 3px 3px no-repeat; +} +a.button.drop-down[class*="selected"], +a.button.drop-down:hover, a.button.drop-down:active { + background: url('../img/icons/icon-dropdown-hover.png') 3px 3px no-repeat; +} + + +/* Filebrowser & Related Lookup ......................................... */ + +a.fb_show img { + width: 0; + height: 0; + opacity: 0; +} + +a.fb_show, +a.related-lookup { + display: inline-block; + margin-bottom: -5px; + width: 23px; + height: 23px; + font-size: 0; + line-height: 0; + background: 50% 50% no-repeat; +} + +a.fb_show:link, a.fb_show:visited, +.tinyMCE .browse span { + background-image: url('../img/icons/icon-fb-show.png'); +} +a.fb_show:hover, a.fb_show:active, +.tinyMCE .browse span:hover { + background-image: url('../img/icons/icon-fb-show-hover.png'); +} +a.related-lookup:link, a.related-lookup:visited { + background-image: url('../img/icons/icon-related-lookup.png'); +} +a.related-lookup:hover, a.related-lookup:active { + background-image: url('../img/icons/icon-related-lookup-hover.png'); +} +div.autocomplete-wrapper-m2m a.related-lookup:link, div.autocomplete-wrapper-m2m a.related-lookup:visited { + background-image: url('../img/icons/icon-related-lookup-m2m.png'); +} +div.autocomplete-wrapper-m2m a.related-lookup:hover, div.autocomplete-wrapper-m2m a.related-lookup:active { + background-image: url('../img/icons/icon-related-lookup-m2m-hover.png'); +} + +input[disabled] + a.fb_show { + background-image: url('../img/icons/icon-fb-show-hover.png') !important; +} +input[disabled] + a.related-lookup { + background-image: url('../img/icons/icon-related-lookup-hover.png') !important; +} + +a.related-lookup + strong { + position: relative; + top: -4px; + margin-left: 5px; + font-size: 11px; + font-weight: bold; +} +#changelist table a.fb_show, +#changelist table a.related-lookup { + top: -5px; + margin-bottom: -12px; +} +#changelist table a.related-lookup + strong { + top: -1px; +} + + +/* Add Another ......................................... */ + +a.add-another { + position: relative; + display: inline-block; + margin-left: 3px; + width: 14px; + height: 14px; + vertical-align: top; + font-size: 11px; + line-height: 16px; + background: 50% 50% no-repeat; +} + +a.add-another:link, a.add-another:visited { + background-image: url('../img/icons/icon-add_another.png'); +} +a.add-another:hover, a.add-another:active { + background-image: url('../img/icons/icon-add_another-hover.png'); +} + +/*.change-list table tbody a.add-another { + position: relative; + top: -7px; +} + +.radiolist.inline + a.add-another, +.checkboxlist.inline + a.add-another { + float: left; + margin-left: -20px; + margin-right: -10000px; +} +.row.cells ul.radiolist.inline + a.add-another, +.row.cells ul.checkboxlist.inline + a.add-another { + float: none; + margin-right: 0; +}*/ + + + +/* Unknown, Yes & No Workaround +------------------------------------------------------------------------------------------------------ */ + +img[src$="img/admin/icon-unknown.gif"] { + padding: 0; + width: 15px; + height: 15px; + color: transparent; + background: url('../img/icons/icon-unknown.png') 0 50% no-repeat; +} +img[src$="img/admin/icon-no.gif"] { + padding: 0; + width: 15px; + height: 15px; + color: transparent; + background: url('../img/icons/icon-no.png') 0 50% no-repeat; +} +img[src$="img/admin/icon-yes.gif"] { + padding: 0; + width: 15px; + height: 15px; + color: transparent; + background: url('../img/icons/icon-yes.png') 0 50% no-repeat; +} + +#changelist form table img[src$="img/admin/icon-unknown.gif"] { + position: relative; + top: 2px; + vertical-align: top; +} +#changelist form table img[src$="img/admin/icon-no.gif"] { + position: relative; + top: 3px; + vertical-align: top; +} +#changelist form table img[src$="img/admin/icon-yes.gif"] { + position: relative; + top: 2px; + vertical-align: top; +} + diff --git a/static/grappelli/css/components.css b/static/grappelli/css/components.css new file mode 100644 index 00000000..f8d8d1ce --- /dev/null +++ b/static/grappelli/css/components.css @@ -0,0 +1,890 @@ + + + +/* Paragraphs & Other Typo Formats +------------------------------------------------------------------------------------------------------ */ + +.module p { + margin: 0; + padding: 5px 0; +} +fieldset.module label + p { + font-size: 11px; + line-height: 15px; +} + + + +/* Modules +------------------------------------------------------------------------------------------------------ */ + +.module { + margin: 0 0 7px; +} + +.form-container .module { + min-width: 938px; +} +#changelist .span-flexible .module + ul.submit-row { + margin-top: 10px; +} +/* Empty breaks in Chrome 11+: Elements are not displayed initially even if they are not empty */ +/*.module:empty { + padding: 0; + height: 0; + border: 0; + visibility: hidden; +}*/ + +/* Nested Modules Basics ......................................... */ + +.module .module, +.module fielset.module { + margin: 0; +} + + + +/* Groups +------------------------------------------------------------------------------------------------------ */ + +.group { + margin: 0 -4px 7px; + padding: 2px; +} +.form-container .group { + min-width: 940px; +} + + + +/* Elements in Modules & Groups +------------------------------------------------------------------------------------------------------ */ + + +/* 1st Level Elements ......................................... */ + +.group h2, +.module h2 { + padding: 6px 10px; +} +.group h2+.tools+* { + margin-top: 2px; +} + + +/* 2nd Level Elements (Dark/Bright) ......................................... */ + +.group h3, +.module h3 { + margin: 0; + padding: 5px 10px; +} + + +/* 3rd Level Elements ......................................... */ + +.group h4, +.module h4 { + margin: 0; + padding: 4px 10px 4px 10px; +} + +.module .description { + padding: 8px 10px; + font-size: 11px; +} + + + +/* Modules & Groups Overrides +------------------------------------------------------------------------------------------------------ */ + +.module:first-child { + margin-top: 0 !important; +} +.group .module:first-child { + margin-top: 2px !important; +} +.group:first-child { + margin-top: -4px; +} +.group .module { + margin-top: 2px; + margin-bottom: 0; +} +.group .module .module { + margin-top: 0; +} +.group:last-child, +.module:last-child { + margin-bottom: 0; +} + + + +/* Collapsible Structures +------------------------------------------------------------------------------------------------------ */ + +.collapse.closed *, +.collapse.closed .module.table, +.collapse.closed .module.table * { + display: none; +} + +.collapse-handler { + cursor: pointer; +} + +.collapse.closed .collapse-handler, +.collapse.closed .tools, +.collapse.closed .tools * { + display: block !important; +} +.collapse.closed h3+.tools, +.collapse.closed h4+.tools { + margin-top: 1px !important; +} + + + +/* Row +------------------------------------------------------------------------------------------------------ */ + +.row { + padding: 5px 10px; + font-weight: bold; +} + +fieldset.module .row + .module { + margin-top: -1px !important; +} + + + +/* Cell +------------------------------------------------------------------------------------------------------ */ + +.row .cell { + display: inline-block; + margin-top: -5px; + margin-bottom: -5px; + padding: 5px 10px; + width: auto; +} +.row .cell + .cell { + padding-left: 18px; +} + + + +/* Fieldset Row +------------------------------------------------------------------------------------------------------ */ + +fieldset.module .row { + padding: 8px 10px; + line-height: 18px; + font-weight: normal; +} +fieldset.module .row.cells { + white-space: nowrap; + overflow: hidden; +} + + + +/* Fieldset Cell +------------------------------------------------------------------------------------------------------ */ + +fieldset.module .cell { + margin: -8px 0 -1000px 0; + padding: 8px 18px 1000px 0; + vertical-align: top; + white-space: nowrap; + height: 100%; +} +fieldset.module .cell:last-child, fieldset.module .cell.last { + margin-right: -20px; +} + + +/* Tabular Modules +------------------------------------------------------------------------------------------------------ */ + +.module.table { + display: table; + margin: 0 0 -2px; + width: 100%; + border-collapse: separate; + border-spacing: 0 2px; +} +h2 + .module.table, +h2 + * + .module.table, +h2 + * + * + .module.table { + margin-top: 0 !important; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + .module.table { + margin-bottom: -1px; + border-spacing: 0 1px !important; + } +} + +.module.thead { + display: table-header-group; +} +.module.tfoot { + display: table-footer-group; +} +.module.thead, +.module.tfoot { + font-size: 11px; + font-weight: bold; +} +.module.table .tr { + display: table-row; +} + +.module.tbody { + display: table-row-group; +} + +.module.table .th, +.module.table .td { + display: table-cell; + float: none; + overflow: hidden; + margin-right: 0; + padding: 1px 20px; + height: 100%; + vertical-align: top; + white-space: nowrap; +} + +.module.tbody .th, +.module.tbody .td { + padding-top: 5px; + padding-bottom: 5px; +} +.module.table .th:first-of-type, +.module.table .td:first-of-type { + padding-left: 10px; +} +.module.tbody .th.tools, +.module.tbody .td.tools { + padding-left: 0; + width: 100%; +} + +.empty-form { + display: none !important; +} + + + +/* Add Items +------------------------------------------------------------------------------------------------------ */ + +.module.add-item { + height: 28px; +} +.module.add-item>a { + position: relative; + top: 6px; + padding: 5px 10px; + font-weight: bold; +} + + + +/* Selectors +------------------------------------------------------------------------------------------------------ */ + +.selector { + position: relative; + float: left; + overflow: hidden; + width: 758px; +} +.selector-available, .selector-chosen { + float: left; + width: 366px; +} +.selector.stacked .selector-available, .selector.stacked .selector-chosen { + width: 756px; +} +.selector h2, .inline-group .selector h2, +.inline-related fieldset .selector-available h2, .inline-related fieldset .selector-chosen h2 { + padding: 7px 5px 6px 7px; + font-size: 12px; + line-height: 13px; + font-weight: bold; +} +.selector .selector-filter { + padding: 3px 5px 2px 2px; + min-height: 25px; + font-weight: bold; + /*line-height: 25px;*/ + /*text-indent: 25px;*/ + /*background: url('../img/icons/icon-searchbox.png') 6px 50% no-repeat;*/ +} +.selector .selector-available .selector-filter { + line-height: 25px; + text-indent: 25px; + background: url('../img/icons/icon-searchbox.png') 6px 50% no-repeat; +} +.selector .selector-chosen .selector-filter { + margin: 0 0 -3px; + padding: 6px 5px 2px 26px; + /*line-height: 25px;*/ + /*text-indent: 25px;*/ + background: url('../img/icons/icon-searchbox.png') 6px 8px no-repeat; +} +.selector .selector-filter input[type=text] { + position: relative; + margin: 0; + width: 326px !important; + max-width: 326px !important; +} +.selector.stacked .selector-filter input[type=text] { + width: 716px !important; + max-width: 716px !important; +} +.selector .selector-filter img { + display: none; +} +.selector .selector-chosen .selector-filter:after { + content: " " url('../img/icons/icon-selector_filter.png'); + opacity: .75; +} +.selector.stacked .selector-chosen .selector-filter:after { + content: " " url('../img/icons/icon-selector_add-m2m_vertical-hover.png'); +} +.selector select[multiple=multiple] { + margin: 0; + padding-left: 3px; + max-width: 367px !important; + width: 367px !important; + height: 200px; +} +.selector.stacked select[multiple=multiple] { + width: 757px !important; + max-width: 757px !important; +} +.selector h2 + select { + /*display: none;*/ + position: relative; + top: -1px; +} +.selector ul.selector-chooser { + float: left; + margin: 110px 2px 0; + padding: 0; + width: 18px; +} +.selector.stacked ul.selector-chooser { + margin: 4px 0 0 356px; + width: 36px; +} +.selector.stacked ul.selector-chooser li { + float: left; +} +a.selector-add, a.selector-remove { + display: block; + width: 18px; + height: 18px; + color: transparent !important; + background-position: 50% 0; + background-repeat: no-repeat; +} +a.selector-add:link, a.selector-add:visited { + background-image: url('../img/icons/icon-selector_add-m2m_horizontal.png'); +} +a.selector-add:hover, a.selector-add:active { + background-image: url('../img/icons/icon-selector_add-m2m_horizontal-hover.png'); +} +a.selector-remove:link, a.selector-remove:visited { + background-image: url('../img/icons/icon-selector_remove-m2m_horizontal.png'); +} +a.selector-remove:hover, a.selector-remove:active { + background-image: url('../img/icons/icon-selector_remove-m2m_horizontal-hover.png'); +} +.selector.stacked a.selector-add:link, .selector.stacked a.selector-add:visited { + background-image: url('../img/icons/icon-selector_add-m2m_vertical.png'); +} +.selector.stacked a.selector-add:hover, .selector.stacked a.selector-add:active { + background-image: url('../img/icons/icon-selector_add-m2m_vertical-hover.png'); +} +.selector.stacked a.selector-remove:link, .selector.stacked a.selector-remove:visited { + background-image: url('../img/icons/icon-selector_remove-m2m_vertical.png'); +} +.selector.stacked a.selector-remove:hover, .selector.stacked a.selector-remove:active { + background-image: url('../img/icons/icon-selector_remove-m2m_vertical-hover.png'); +} +a.selector-chooseall, a.selector-clearall { + display: block; + margin: 0; + padding: 2px 7px; + font-size: 11px; + line-height: 13px; + font-weight: bold; +} + + + +/* Link-List, Actions, Feed, Table of Contents +------------------------------------------------------------------------------------------------------ */ + +.link-list ul li, +.feed ul li, +.table-of-contents ul li { + padding: 0; + font-size: 11px; + line-height: 15px; + font-weight: bold; +} +.link-list ul li a, +.feed ul li a, .feed ul li span, +.table-of-contents ul li a { + display: block; + padding: 5px 10px; + font-weight: bold; + line-height: 13px; + background-color: transparent; + background-position: 50% 50%; + background-repeat: no-repeat; +} +.actions p, +.link-list p, +.feed p { + color: #999; + font-size: 11px; + padding: 3px 10px; +} +.link-list ul li a, +.feed ul li a { + padding-left: 25px; +} +a.internal, +a.external { + background-repeat: no-repeat; +} +.dashboard a.internal { + background-position: 12px 7px; +} +.dashboard a.external { + background-position: 10px 8px; +} +.documentation a.external { + padding-left: 12px; + background-position: 1px 3px; +} +a.internal:link, a.internal:visited { + background-image: url('../img/icons/icon-navigation-internal.png'); +} +a.internal:hover, a.internal:active { + background-image: url('../img/icons/icon-navigation-internal-hover.png'); +} +a.external:link, a.external:visited { + background-image: url('../img/icons/icon-navigation-external.png'); +} +a.external:hover, a.external:active { + background-image: url('../img/icons/icon-navigation-external-hover.png'); +} + +.feed ul li a, .feed ul li span { + line-height: 13px; +} +.feed ul li span.date { + float: right; + padding: 5px 5px 0 5px; +} + + + +/* Basic Actions & Module Actions +------------------------------------------------------------------------------------------------------ */ + +ul.actions { + position: relative; + float: right; + clear: both; +} +ul.actions li { + position: relative; + float: left; +} +ul.actions li + li { + margin-left: 20px; +} +ul.actions li a { + padding-left: 15px; + font-size: 11px; + background-position: 0 50%; + background-repeat: no-repeat; +} + +.actions ul li { + padding: 4px 5px 4px 25px; + font-size: 11px; + line-height: 12px; +} + +.actions ul li a { + margin-left: -15px; + padding-left: 15px; + font-weight: bold; + background-position: 0 50%; + background-repeat: no-repeat; +} + +.actions li.add-link a:link, .actions li.add-link a:visited { + background-image: url('../img/icons/icon-actions-add-link.png'); +} +.actions li.add-link a:hover, .actions li.add-link a:active { + background-image: url('../img/icons/icon-actions-add-link-hover.png'); +} +.actions li.change-link a:link, .actions li.change-link a:visited { + background-image: url('../img/icons/icon-actions-change-link.png'); +} +.actions li.change-link a:hover, .actions li.change-link a:active { + background-image: url('../img/icons/icon-actions-change-link-hover.png'); +} + +.actions li.delete-link { + text-decoration: line-through; + background: url('../img/icons/icon-actions-delete-link.png') 10px 7px no-repeat; +} + + + +/* Module Search & Module Filter +------------------------------------------------------------------------------------------------------ */ + +.module.search, +.module.filter { + position: relative; + float: right; + z-index: 1001; + padding: 8px 10px; +} +.module.filter + .module.search { + padding-right: 0; +} + +.module.filter .pulldown-container { + position: absolute; + width: inherit; +} + +.module.search .tooltip { + position: absolute; +} +.module.search .tooltip.search-fields { + top: 25px; +} +.module.search .tooltip .tooltip-pointer { + position: relative; + z-index: 1000; + display: block; + width: 30px; + height: 8px; + background: transparent url('../img/backgrounds/tooltip-pointer.png') 10px 100% no-repeat scroll; +} +.module.search .tooltip .tooltip-content { + position: relative; + z-index: 990; + top: -1px; + padding: 8px 10px; + font-size: 11px; + line-height: 15px; +} + +a.button.toggle-filters { + display: block; + margin: 0; + padding: 4px 20px 4px 8px; +} +a.button.toggle-filters:link, a.button.toggle-filters:visited { + background: transparent url('../img/icons/icon-dropdown.png') 100% 3px no-repeat; +} +.selected a.button.toggle-filters:link, .selected a.button.toggle-filters:visited { + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; +} +.open a.button.toggle-filters, .selected a.button.toggle-filters, +.selected a.button.toggle-filters:hover, .selected a.button.toggle-filters:active, +a.button.toggle-filters:hover, a.button.toggle-filters:active { + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; +} +.selected a.button.toggle-filters:link, .selected a.button.toggle-filters:visited { + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; +} +.open a.button.toggle-filters, +.open.selected a.button.toggle-filters, +.selected a.button.toggle-filters:hover, .selected a.button.toggle-filters:active, +a.button.toggle-filters:hover, a.button.toggle-filters:active { + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; +} + +.filter-pulldown { + display: none; + position: relative; + z-index: 1000; + margin: -1px 0; + padding: 0 10px 10px; +} +.filter-pulldown .filter { + position: relative; + padding: 7px 0 0; + width: 100%; +} +.filter-pulldown select { + width: 100% !important; +} +.filter-pulldown label { + margin: 0 0 -2px; + padding: 0; + width: 100% !important; + line-height: 12px; + font-weight: bold; +} + + + +/* Module Date Hierarchy +------------------------------------------------------------------------------------------------------ */ + +.module + .module.date-hierarchy { + margin-top: -8px; +} + +.date-hierarchy ul { + position: relative; + float: left; + clear: both; + font-size: 11px; + line-height: 16px; + font-weight: bold; +} +.date-hierarchy ul li { + position: relative; + float: left; + margin-right: 10px; +} +.module.date-hierarchy ul a, +.module.date-hierarchy ul span { + padding: 2px 5px 1px; + font-weight: normal; +} +.date-hierarchy ul li a.date-hierarchy-back { + padding-left: 10px; + background: 0 50% no-repeat scroll; +} + +.date-hierarchy a.date-hierarchy-back:link, .date-hierarchy a.date-hierarchy-back:visited { + background-image: url('../img/icons/icon-date-hierarchy-back.png'); +} +.date-hierarchy a.date-hierarchy-back:hover, .date-hierarchy a.date-hierarchy-back:active { + background-image: url('../img/icons/icon-date-hierarchy-back-hover.png'); +} + + + +/* Pagination +------------------------------------------------------------------------------------------------------ */ + +.module.pagination { + padding: 8px 10px; +} +.module .module.pagination { + position: relative; + float: left; +} +ul.pagination { + position: relative; + clear: both; + margin: 0; + padding: 0; + width: auto; + font-weight: bold; +} +ul.pagination li { + position: relative; + float: left; + display: block; + margin-right: 3px; +} +ul.pagination li.results { + margin-right: 10px; +} +ul.pagination li.separator { + border-color: transparent; +} +ul.pagination li:last-child { + clear: right; +} + +ul.pagination span, +ul.pagination a { + display: inline-block; + padding: 4px 8px 4px; + min-width: 25px; + font-size: 11px; + font-weight: bold; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +ul.pagination li.separator span { + padding: 4px 0; + min-width: 10px; + font-size: 14px; +} +ul.pagination li.showall { + margin-left: 7px; +} +.submit-row ul.pagination li, +.submit-row ul.pagination li.results { + padding-top: 0 !important; + padding-bottom: 0 !important; +} + + + +/* Module Changelist-Results +------------------------------------------------------------------------------------------------------ */ + +.module.changelist-results { + background: url('../img/backgrounds/changelist-results.png') repeat scroll !important; +} +.changelist-actions + .changelist-results, +.changelist-results + .changelist-actions { + margin-top: -1px; +} + + + +/* Module Changelist Actions +------------------------------------------------------------------------------------------------------ */ + +.changelist-actions { + position: relative; + margin-bottom: 0; +} + +.changelist-actions ul { + position: relative; + float: left; + display: inline; + font-size: 11px; + line-height: 16px; + font-weight: bold; + margin: -1px 10px -1px 0; +} +.changelist-actions ul li { + position: relative; + float: left; + display: block; + margin-right: 3px; +} + +.changelist-actions ul a, +.changelist-actions ul span { + display: inline-block; + padding: 4px 8px 3px; + font-size: 11px; + font-weight: bold; +} +.changelist-actions ul span span { + padding: 0; +} + +.changelist-actions #action-toggle { + display: none; +} +.changelist-actions select { + float: left; + margin: 0 10px 0 0; + width: 278px; +} + +.changelist-actions li.all, +.changelist-actions li.clear-selection, +.changelist-actions li.question { + display: none; +} + + + +/* Submit Row +------------------------------------------------------------------------------------------------------ */ + +.module.submit-row { + width: 100%; +} +ul.submit-row { + position: relative; + float: left; + clear: both; + width: 100%; +} +.pagination + ul.submit-row { + float: right; + clear: none; + width: 25%; +} +ul.submit-row li { + float: right; + margin-left: 10px; +} + +ul.submit-row li.left { + float: left; +} +ul.submit-row li.left:first-child { + margin-left: 0; +} + + + +/* Module Footer +------------------------------------------------------------------------------------------------------ */ + +.module.footer { + position: fixed; + z-index: 1000; + bottom: 0; + margin: 0 -20px; + padding: 12px 20px; + min-width: 100px; + width: 100%; + opacity: 1; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +.module.footer .changelist-actions { + position: relative; + float: left; + clear: none; + width: 75%; + padding: 2px 0 0; +} +.change-list .module.footer ul.submit-row { + position: relative; + float: right; + clear: none; + width: 25%; +} + + + +/* Sortable +------------------------------------------------------------------------------------------------------ */ + +.sortablehelper, sortablehelper * { + display: none; +} + + + + + + + diff --git a/static/grappelli/css/datepicker/grappelli-theme-extensions.css b/static/grappelli/css/datepicker/grappelli-theme-extensions.css new file mode 100644 index 00000000..c5df9884 --- /dev/null +++ b/static/grappelli/css/datepicker/grappelli-theme-extensions.css @@ -0,0 +1,392 @@ + +body { +/* background: #e4f !important;*/ +} + + + + + +/* Widget Basics +------------------------------------------------------------------------------------------------------ */ + +.module.ui-widget { + border: none; + background: #fff; +} +.ui-widget-content { + border: 1px solid #ccc; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + background: #eee; +} + + + +/* Accordion +------------------------------------------------------------------------------------------------------ */ + + +/* Overlays */ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { + display: block; + font-size: 1em; + padding: 0 0 0 12px; +} +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { + top: 0; + margin-top: 0; + margin-bottom: 0; + padding: 5px 15px; + border-top: 1px solid #fff; +} +.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker +----------------------------------*/ + + + +.ui-accordion-header { + margin-top: 2px !important; + cursor: pointer; + outline: none; +} +.ui-accordion .ui-accordion-header a { + padding: 0 0 0 12px; + color: #444; + outline: none; +} + +.ui-accordion-header.ui-state-default { + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.ui-accordion-header.ui-state-active { + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; +} + + +/* Accordion Module ......................................... */ + +.module .ui-accordion-header.ui-state-default { + border: 1px solid #bdbdbd; + background-color: #a1d4e5; +} +.module .ui-accordion-header.ui-state-default:hover { + background-color: #d6d6d6; +} +.module .ui-accordion-header.ui-state-active { + border: 1px solid #bdbdbd; + background-color: #d6d6d6; +} + + + +/* Accordion Module in Group......................................... */ + +.group .module .ui-accordion-header.ui-state-default { + border: 1px solid #c7c7c7; + background-color: #cee9f2; +} +.group .module .ui-accordion-header.ui-state-default:hover { + background-color: #e0e0e0; +} +.group .module .ui-accordion-header.ui-state-active { + border: 1px solid #c7c7c7; + background-color: #e0e0e0; +} + + + + +/*.module .ui-accordion-header { + border-top: 1px solid #e4f; +}*/ +.group .module .ui-accordion-header { + border-top: 1px solid #4ef; +} + + + +/* Datepicker +------------------------------------------------------------------------------------------------------ */ + +.ui-datepicker { + width: auto !important; padding: 3px 3px 0; + border-color: #bdbdbd; + box-shadow: 0 0 10px #333; -moz-box-shadow: 0 0 10px #333; -webkit-box-shadow: 0 0 10px #333; +} +.ui-datepicker .ui-datepicker-header { + padding: 2px 0; + height: 25px; +} +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { + position: absolute; + top: 4px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 3px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { + margin: 3px 25px 2px; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + float:left; + font-size:1em; + margin: -3px 0 -1px !important; + min-width: 30px; +} +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { + float: right; +} +.ui-datepicker table { + width: 100%; + font-size: 12px; + margin: 0 0 2px; +} +.ui-datepicker th { padding: 5px 0; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { + min-width: 25px; + border: 0; padding: 1px; +} +.ui-datepicker td span, .ui-datepicker td a { + padding: 4px 0 3px; + text-align: center; + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; +} +.ui-datepicker td a.ui-state-hover { + color: #fff !important; + border-color: #444 !important; + background: #444 !important; +} +.ui-datepicker td a.ui-state-active { +/* color: #fff;*/ +/* border-color: #aaa;*/ + background: #fff; +} +.ui-datepicker td a.ui-state-highlight { +/* color: #fff;*/ + border-color: #bababa; + background: #D6D6D6; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: 10px 0 0; + padding: 0; + border-left: 0; + border-right: 0; + border-bottom: 0; + } +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: 3px 0; + padding: 4px 5px 5px; + height: 25px; + font-size: 12px; + background: #fff; + cursor: pointer; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + opacity: 1 !important; + color: #fff; font-weight: bold; + border-color: #309bbf; + background: #309bbf; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-state-hover { + color: #fff !important; + border-color: #444 !important; + background: #444 !important; +} + +.ui-datepicker-multi .ui-datepicker-group-first .ui-datepicker-title, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title { + margin-right: 5px !important; +} +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title, +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-title { + margin-left: 5px !important; +} + +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; +} +.ui-datepicker-multi .ui-datepicker-group-first table, +.ui-datepicker-multi .ui-datepicker-group-middle table { + margin-right: 5px !important; +} +.ui-datepicker-multi .ui-datepicker-group-middle table, +.ui-datepicker-multi .ui-datepicker-group-last table { + margin-left: 5px !important; +} +.ui-datepicker-multi .ui-datepicker-group-middle table { + margin-left: 3px !important; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + border: none; +} + +.ui-datepicker-append { + margin-left: 6px; color: #999; font-size: 10px; +} + + + +/* Tabs +------------------------------------------------------------------------------------------------------ */ + +.ui-tabs { + padding: 0; zoom: 1; +} +.ui-tabs .ui-tabs-nav { + padding: 0; + color: #444; font-size: 12px; + border: none; + border-bottom: 1px solid #bdbdbd; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; +/* -moz-border-radius-bottomright: 0;*/ + background: none; +} +.ui-tabs .ui-tabs-nav li { + position: relative; float: left; + border-bottom-width: 1px !important; + margin: 0 .2em -1px 0; + padding: 0; +} +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { + padding-bottom: 0px; border-bottom-width: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { + padding: 0; + display: block; + border: 1px solid #bdbdbd; + border-top: 1px solid #fff; + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; + background: #eee; +} +.ui-tabs .ui-tabs-hide { display: none !important; } + + + + +/* gAutocomplete +------------------------------------------------------------------------------------------------------ */ + +.ui-gAutocomplete-wrapper { + position: absolute; + z-index: 400; +} +ul.ui-gAutocomplete-results { + margin-top: 4px; + padding: 5px; + border: 1px solid #ddd; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + box-shadow: 0 0 3px #444; -moz-box-shadow: 0 0 3px #444; -webkit-box-shadow: 0 0 3px #444; + background: #fff; +} +ul.ui-gAutocomplete-results li { + padding: 2px 5px; + color: #666; + cursor: pointer; +} +ul.ui-gAutocomplete-results li:hover { + background: #e1f0f5; +} +ul.ui-gAutocomplete-results li:first-child { + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} +ul.ui-gAutocomplete-results li:last-child { + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} +ul.ui-gAutocomplete-results li + li { + border-top: 1px solid #eee; +} + +ul.ui-gAutocomplete-results li b { + margin: 0 1px; + color: #444; +/* text-decoration: underline;*/ +} + + + +/* gFacelist +------------------------------------------------------------------------------------------------------ */ + +/*span.ui-gFacelist-message { + display: inline-block; + height: 25px; + background: #fff; + margin: 0; + padding: 3px 5px 4px; + vertical-align: middle; + color: #666; font-family: Arial, sans-serif; font-size: 12px; font-weight: bold; + border: 1px solid #bbb; + border-color: #ccc #ddd #ddd #ccc; + border-top-left-radius: 3px; -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; + border-top-right-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + outline: none; +}*/ + +.ui-gFacelist-toolbar input.ui-gAutocomplete-autocomplete { +/* margin-top: 4px;*/ +/* width: 100px;*/ + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; +} +.ui-gFacelist-toolbar button { + border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; +} + +.ui-gFacelist-toolbar .ui-gAutocomplete-wrapper { + margin-top: -4px; +} + +ul.ui-gFacelist-facelist { + position: relative; float: left; clear: both; + padding: 0px 5px 5px; + border: 1px solid #bbb; + border-color: #ccc #ddd #ddd #ccc; + border-top: none; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + background: #fff; + +} +li.ui-gFacelist-item { + position: relative; float: left; + margin-top: 5px; padding: 3px 6px 2px; + width: auto; + font-weight: bold; + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; + background: #ddd; +} +li.ui-gFacelist-item { + margin-right: 5px; +} + +a.ui-gFacelist-item-remove { + display: inline-block; + margin: 0 0 -3px 0; + width: 16px; + height: 16px; + background: transparent 100% 3px no-repeat; +} diff --git a/static/grappelli/css/forms.css b/static/grappelli/css/forms.css new file mode 100644 index 00000000..84e21f6d --- /dev/null +++ b/static/grappelli/css/forms.css @@ -0,0 +1,1243 @@ + + + +/* Basic Settings, Fieldsets, Form-Rows +------------------------------------------------------------------------------------------------------ */ + +form { + margin: 0; + padding: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +.row p.help { + margin: 3px 0 2px 0; + padding: 0; +} +.row.cells p.help { + max-width: 278px; + white-space: normal !important; +} + +.row ul.radio-list + p.help, +.row ul.checkbox-list + p.help { + margin-top: -3px; +} + + + +/* Errors +------------------------------------------------------------------------------------------------------ */ + +.errornote { + margin-bottom: 7px; + padding: 8px 10px; + font-size: 12px; + font-weight: bold; +} +/* little fix to accomodate the top aligned login form .. */ +.errornote.login-errors { + margin-bottom: 0 !important; + padding: 8px 12px; +} +ul.errorlist { + margin: 6px 0 -3px; + font-size: 11px; + line-height: 13px; + font-weight: bold; +} +ul.errorlist li { + padding: 0 5px 0 0; +} +p.errornote + ul.errorlist { + margin-bottom: 8px; +} +ul.errorlist:empty { + display: none; + margin: 0; +} +.group.tabular ul.errorlist { + margin-left: 11px; +} +.group.stacked ul.errorlist { + margin-left: 11px; + margin-bottom: 5px; +} +.group.stacked h3 + * + ul.errorlist { + margin: 0 !important; + padding: 5px 11px; +} +.cell ul.errorlist { + padding-left: 0; +} +.cell ul.errorlist li { + padding-left: 0; +} +.cell label + * + ul.errorlist, +.cell label + * + * + ul.errorlist { + padding-left: 160px !important; +} +table ul.errorlist { + margin: -9px 0 6px; +} +.group.stacked .row ul.errorlist, +.module.table ul.errorlist { + margin-top: 5px; + margin-left: 0; + margin-bottom: -3px; +} +ul.radiolist.inline + ul.errorlist, +ul.radiolist.inline + * + ul.errorlist { + position: relative; clear: both; +} +ul.radiolist + ul.errorlist, +ul.radiolist + * + ul.errorlist { + margin-top: 0 !important; +} + +.module.table .tbody>ul.errorlist { + margin-top: 2px; + margin-left: 11px; + margin-bottom: 2px; +} +.module.table .tr ul.errorlist { + margin-left: 0; +} +.module.table ul.radiolist + ul.errorlist, +.module.table ul.radiolist + * + ul.errorlist { + margin: -2px 0 0; +} +table ul.errorlist li, +.module.table ul.errorlist li { + padding-left: 0; +} +p.errornote + ul.errorlist li { + padding-left: 10px; +} + + + +/* Labels & Other Typographic Elements in Forms +------------------------------------------------------------------------------------------------------ */ + +label { + margin: 5px 0 -5px; + font-size: 11px; + line-height: 15px; + cursor: pointer; +} +.required label, label.required, +.row .required label, .row label.required { + font-weight: bold; +} + +.module label { + display: block; + padding: 0 0 6px; + white-space: normal; +} +.module .vCheckboxLabel { + display: inline; + float: none; + clear: both; + margin: 0 0 0 10px; + padding: 0; +} + + + +/* Form Elements +------------------------------------------------------------------------------------------------------ */ + +input, textarea, select, button { + margin: 0; + vertical-align: top; + font-family: Arial, sans-serif; + font-size: 12px; + font-weight: bold; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} + + +/* Text, Password ................................................... */ + +input[type=text], input[type=password] { + padding: 5px 5px 4px; + height: 25px; +} +/* Webkit browser hack: apply same horizontal padding as in moz browsers + Moz Browsers have a default horizontal padding of 3px in input[type=submit] */ +@media screen and (-webkit-min-device-pixel-ratio:0) { + input[type=text], input[type=password] { + line-height: 13px !important; + } +} + + +/* Searchbar ................................................... */ + +form#changelist-search { + position: relative; + float: left; + clear: both; +} +input#searchbar { + position: relative; + float: left; + padding-left: 8px; + padding-right: 30px; + width: 218px; + height: 26px; + font-size: 11px; +} + + +/* FileBrowseField ................................................... */ + +input.vFileBrowseField { + padding-right: 25px; +} + + +/* File ................................................... */ + +input[type=file] { + position: relative; + top: 1px; + height: auto; + border: 0; +} +.th input[type=file], +.td input[type=file] { + top: 3px; + margin-bottom: -2px; +} + +.module p.file-upload { + margin-bottom: 5px !important; + padding: 3px 0 0 !important; + font-size: 11px; + line-height: 20px; +/* font-size: 0;*/ +/* color: transparent;*/ +} +.file-upload a { + font-size: 12px; + font-weight: bold; +} +.file-upload br { + display: none; +} +.file-upload .clearable-file-input { + display: block; + margin: 0 0 5px; + padding: 0; + min-width: 320px; +} +.file-upload .clearable-file-input label { + display: inline-block; + float: none; + margin-bottom: -2px; + position: relative; + top: 0; +} +.file-upload .clearable-file-input input { + top: 5px !important; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + .file-upload .clearable-file-input input { + top: 7px !important; + } +} +.file-upload input[type=file] { + position: relative; + top: 1px; + height: auto; + border: 0; +} + + +/* Date & Time ................................................... */ + +.vDateField, .vTimeField { + margin-left: 0; +} +p.datetime { + margin-bottom: 0 !important; + padding: 0; +} +p.datetime input.vTimeField { + margin-left: 13px; +} + + +/* Textarea ................................................... */ + +textarea { + vertical-align: top; + padding: 3px 5px; +} +fieldset.monospace textarea { + font-family: "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace; +} + + +/* Select ................................................... */ + +select { + padding: 4px 3px 4px 3px; + height: 25px; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + select { + padding: 4px 28px 4px 8px; + -webkit-appearance: textfield; + background: #fff url('../img/icons/icon-form-select.png') 100% 50% no-repeat; + } +} +select[multiple=multiple] { + padding-right: 5px; + height: 160px; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + select[multiple=multiple] { + background-image: none; + } +} + + +/* Checkbox, Radio ................................................... */ + +input[type=checkbox], input[type=radio] { + position: relative; + margin: 0; +} +.row input[type=checkbox], .row input[type=radio] { + margin-left: 0; + margin-right: 5px; +} +.th>input[type=radio], +.th>input[type=checkbox], +.td>input[type=radio], +.td>input[type=checkbox] { + top: 5px; + margin-bottom: -3px; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + .th>input[type=radio], + .td>input[type=radio] { + top: 6px; + margin-bottom: -2px; + } + .th>input[type=checkbox], + .td>input[type=checkbox] { + top: 7px; + margin-bottom: -2px; + } +} +.row input[type=radio], +.th ul.radiolist input[type=radio], +.td ul.radiolist input[type=radio] { + top: 0; +} +.row input[type=checkbox], +.th ul.checkboxlist input[type=checkbox], +.td ul.checkboxlist input[type=checkbox] { + top: 2px; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + .row input[type=radio], + .th ul.radiolist input[type=radio], + .td ul.radiolist input[type=radio] { + top: 1px; + } + .row input[type=checkbox], + .th ul.checkboxlist input[type=checkbox], + .td ul.checkboxlist input[type=checkbox] { + top: 3px; + } +} +.th input[type=radio], +.th input[type=checkbox], +.td input[type=radio], +.td input[type=checkbox], +ul.radiolist input[type=radio], +ul.checkboxlist input[type=checkbox] { + margin-left: 0; + margin-right: 5px; +} + +.row input[type=checkbox] + label { + position: relative; + float: none; + top: 0; + display: inline-block; + margin-bottom: -2px; +} + +.row ul.checkboxlist input[type=checkbox] { + top: 0; + margin: 0 5px 0 0; +} +.row ul.checkboxlist label input[type=checkbox] { + top: -2px; + vertical-align: middle; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + .row ul.checkboxlist label input[type=checkbox] { + top: -1px; + vertical-align: middle; + } +} + +.row label + input + p.help input[type=checkbox] { + position: relative; + top: -2px; + margin: 0 3px 0 0; +} + +ul.tools .delete-handler-container input[type=checkbox], +ul.tools .remove-handler-container input[type=checkbox] { + display: none !important; +} + + +/* Radiolists & Checkboxlists ................................................... */ + +ul.radiolist, ul.checkboxlist { + position: relative; + float: none; + display: inline-block; + margin: 5px 0; + padding: 0; + font-size: 11px; + line-height: 15px; + font-weight: normal; +} + +.row>ul.radiolist, .row>ul.checkboxlist { + margin: 0; +} + +ul.radiolist li + li, ul.checkboxlist li + li { + margin-top: 2px; +} + +ul.radiolist.inline, ul.checkboxlist.inline { + float: left; + display: inline; + margin-top: 5px; + margin-bottom: 3px; + padding-right: 20px; +} +th ul.radiolist.inline, th ul.checkboxlist.inline, +td ul.radiolist.inline, td ul.checkboxlist.inline { + margin-top: 0; +} +ul.radiolist.inline li, ul.checkboxlist.inline li { + float: left; + display: inline; + margin-top: 0 !important; + margin-bottom: 2px; + padding-right: 20px; +} +.module.tbody ul.radiolist.inline, .module.tbody ul.checkboxlist.inline { + display: inline; + white-space: normal; +} +.module.tbody ul.radiolist.inline li, .module.tbody ul.checkboxlist.inline li { + position: relative; + float: left; + display: inline; +} +.row.cells ul.radiolist.inline li, .row.cells ul.checkboxlist.inline li { + float: none; +} + +ul.radiolist label, ul.checkboxlist label { + float: none; + display: inline-block; + margin: 0; + padding: 0; + width: auto !important; + white-space: nowrap; +} + + +/* Changelist Form Fields ................................................... */ + +#changelist table input[type=text], +#changelist table input[type=password], +#changelist table input[type=file], +#changelist table select, +#changelist table textarea { + position: relative; + top: -5px; + margin-bottom: -9px; + vertical-align: top; +} +#changelist table input[type=file] { + top: -3px; + margin-bottom: -7px; +} +#changelist table input[type=radio], +#changelist table input[type=checkbox] { + position: relative; + top: 0; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + #changelist table input[type=radio], + #changelist table input[type=checkbox] { + top: 1px; + } +} +#changelist table thead input[type=radio], +#changelist table thead input[type=checkbox] { + top: 0; +} + + + +/* Form Fields in Grid +------------------------------------------------------------------------------------------------------ */ + +input[class*="span"], select[class*="span"], textarea[class*="span"] { + margin-right: 0; +} + +.span-24 input[type=text], .span-24 input[type=password], +.span-24 select, .span-24 textarea, +input[type=text].span-24, input[type=password].span-24, +select.span-24, textarea.span-24, +.span-24 .ui-gFacelist-message, +.span-24 .ui-gFacelist-facelist, +.span-24 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-24 { + width: 918px; +} +.span-24 div.autocomplete-wrapper-m2m ul.repr, +.span-24 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-24 ul.repr, +div.autocomplete-wrapper-m2m.span-24 ul.repr li { + max-width: 860px; +} +.span-23 input[type=text], .span-23 input[type=password], +.span-23 select, .span-23 textarea, +input[type=text].span-23, input[type=password].span-23, +select.span-23, textarea.span-23, +.span-23 .ui-gFacelist-message, +.span-23 .ui-gFacelist-facelist, +.span-23 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-23 { + width: 878px; +} +.span-23 div.autocomplete-wrapper-m2m ul.repr, +.span-23 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-23 ul.repr, +div.autocomplete-wrapper-m2m.span-23 ul.repr li { + max-width: 820px; +} +.span-22 input[type=text], .span-22 input[type=password], +.span-22 select, .span-22 textarea, +input[type=text].span-22, input[type=password].span-22, +select.span-22, textarea.span-22, +.span-22 .ui-gFacelist-message, +.span-22 .ui-gFacelist-facelist, +.span-22 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-22 { + width: 838px; +} +.span-22 div.autocomplete-wrapper-m2m ul.repr, +.span-22 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-22 ul.repr, +div.autocomplete-wrapper-m2m.span-22 ul.repr li { + max-width: 780px; +} +.span-21 input[type=text], .span-21 input[type=password], +.span-21 select, .span-21 textarea, +input[type=text].span-21, input[type=password].span-21, +select.span-21, textarea.span-21, +.span-21 .ui-gFacelist-message, +.span-21 .ui-gFacelist-facelist, +.span-21 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-21 { + width: 798px; +} +.span-21 div.autocomplete-wrapper-m2m ul.repr, +.span-21 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-21 ul.repr, +div.autocomplete-wrapper-m2m.span-21 ul.repr li { + max-width: 740px; +} +.span-20 input[type=text], .span-20 input[type=password], +.span-20 select, .span-20 textarea, +input[type=text].span-20, input[type=password].span-20, +select.span-20, textarea.span-20, +.span-20 .ui-gFacelist-message, +.span-20 .ui-gFacelist-facelist, +.span-20 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-20, +.span-24 label + input[type=text], .span-24 label + input[type=password], +.span-24 label + select, .span-24 label + textarea { + width: 758px; +} +.span-20 div.autocomplete-wrapper-m2m ul.repr, +.span-20 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-20 ul.repr, +div.autocomplete-wrapper-m2m.span-20 ul.repr li { + max-width: 700px; +} +.span-19 input[type=text], .span-19 input[type=password], +.span-19 select, .span-19 textarea, +input[type=text].span-19, input[type=password].span-19, +select.span-19, textarea.span-19, +.span-19 .ui-gFacelist-message, +.span-19 .ui-gFacelist-facelist, +.span-19 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-19, +.span-23 label + input[type=text], .span-23 label + input[type=password], +.span-23 label + select, .span-23 label + textarea { + width: 718px; +} +.span-19 div.autocomplete-wrapper-m2m ul.repr, +.span-19 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-19 ul.repr, +div.autocomplete-wrapper-m2m.span-19 ul.repr li { + max-width: 660px; +} +.span-18 input[type=text], .span-18 input[type=password], +.span-18 select, .span-18 textarea, +input[type=text].span-18, input[type=password].span-18, +select.span-18, textarea.span-18, +.span-18 .ui-gFacelist-message, +.span-18 .ui-gFacelist-facelist, +.span-18 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-18, +.span-22 label + input[type=text], .span-22 label + input[type=password], +.span-22 label + select, .span-22 label + textarea { + width: 678px; +} +.span-18 div.autocomplete-wrapper-m2m ul.repr, +.span-18 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-18 ul.repr, +div.autocomplete-wrapper-m2m.span-18 ul.repr li { + max-width: 620px; +} +.span-17 input[type=text], .span-17 input[type=password], +.span-17 select, .span-17 textarea, +input[type=text].span-17, input[type=password].span-17, +select.span-17, textarea.span-17, +.span-17 .ui-gFacelist-message, +.span-17 .ui-gFacelist-facelist, +.span-17 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-17, +.span-21 label + input[type=text], .span-21 label + input[type=password], +.span-1 label + select, .span-21 label + textarea { + width: 638px; +} +.span-17 div.autocomplete-wrapper-m2m ul.repr, +.span-17 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-17 ul.repr, +div.autocomplete-wrapper-m2m.span-17 ul.repr li { + max-width: 580px; +} +.span-16 input[type=text], .span-16 input[type=password], +.span-16 select, .span-16 textarea, +input[type=text].span-16, input[type=password].span-16, +select.span-16, textarea.span-16, +.span-16 .ui-gFacelist-message, +.span-16 .ui-gFacelist-facelist, +.span-24 input.vForeignKeyRawIdAdminField, +.span-24 input.vManyToManyRawIdAdminField, +.span-16 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-16, +.span-20 label + input[type=text], .span-20 label + input[type=password], +.span-20 label + select, .span-20 label + textarea { + width: 598px; +} +.span-16 div.autocomplete-wrapper-m2m ul.repr, +.span-16 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-16 ul.repr, +div.autocomplete-wrapper-m2m.span-16 ul.repr li { + max-width: 540px; +} +.span-15 input[type=text], .span-15 input[type=password], +.span-15 select, .span-15 textarea, +input[type=text].span-15, input[type=password].span-15, +select.span-15, textarea.span-15, +.span-15 .ui-gFacelist-message, +.span-15 .ui-gFacelist-facelist, +.span-23 input.vForeignKeyRawIdAdminField, +.span-23 input.vManyToManyRawIdAdminField, +.span-15 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-15, +.span-19 label + input[type=text], .span-19 label + input[type=password], +.span-19 label + select, .span-19 label + textarea { + width: 558px; +} +.span-15 div.autocomplete-wrapper-m2m ul.repr, +.span-15 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-15 ul.repr, +div.autocomplete-wrapper-m2m.span-15 ul.repr li { + max-width: 500px; +} +.span-14 input[type=text], .span-14 input[type=password], +.span-14 select, .span-14 textarea, +input[type=text].span-14, input[type=password].span-14, +select.span-14, textarea.span-14, +.span-14 .ui-gFacelist-message, +.span-14 .ui-gFacelist-facelist, +.span-22 input.vForeignKeyRawIdAdminField, +.span-22 input.vManyToManyRawIdAdminField, +.span-14 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-14, +.span-18 label + input[type=text], .span-18 label + input[type=password], +.span-18 label + select, .span-18 label + textarea { + width: 518px; +} +.span-14 div.autocomplete-wrapper-m2m ul.repr, +.span-14 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-14 ul.repr, +div.autocomplete-wrapper-m2m.span-14 ul.repr li { + max-width: 460px; +} +.span-13 input[type=text], .span-13 input[type=password], +.span-13 select, .span-13 textarea, +input[type=text].span-13, input[type=password].span-13, +select.span-13, textarea.span-13, +.span-13 .ui-gFacelist-message, +.span-13 .ui-gFacelist-facelist, +.span-21 input.vForeignKeyRawIdAdminField, +.span-21 input.vManyToManyRawIdAdminField, +.span-13 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-13, +.span-17 label + input[type=text], .span-17 label + input[type=password], +.span-17 label + select, .span-17 label + textarea { + width: 478px; +} +.span-13 div.autocomplete-wrapper-m2m ul.repr, +.span-13 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-13 ul.repr, +div.autocomplete-wrapper-m2m.span-13 ul.repr li { + max-width: 420px; +} +.span-12 input[type=text], .span-12 input[type=password], +.span-12 select, .span-12 textarea, +input[type=text].span-12, input[type=password].span-12, +select.span-12, textarea.span-12, +.span-12 .ui-gFacelist-message, +.span-12 .ui-gFacelist-facelist, +.span-20 input.vForeignKeyRawIdAdminField, +.span-20 input.vManyToManyRawIdAdminField, +.span-12 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-12, +.span-16 label + input[type=text], .span-16 label + input[type=password], +.span-16 label + select, .span-16 label + textarea { + width: 438px; +} +.span-12 div.autocomplete-wrapper-m2m ul.repr, +.span-12 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-12 ul.repr, +div.autocomplete-wrapper-m2m.span-12 ul.repr li { + max-width: 380px; +} +.span-11 input[type=text], .span-11 input[type=password], +.span-11 select, .span-11 textarea, +input[type=text].span-11, input[type=password].span-11, +select.span-11, textarea.span-11, +.span-11 .ui-gFacelist-message, +.span-11 .ui-gFacelist-facelist, +.span-19 input.vForeignKeyRawIdAdminField, +.span-19 input.vManyToManyRawIdAdminField, +.span-11 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-11, +.span-15 label + input[type=text], .span-15 label + input[type=password], +.span-15 label + select, .span-15 label + textarea { + width: 398px; +} +.span-11 div.autocomplete-wrapper-m2m ul.repr, +.span-11 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-11 ul.repr, +div.autocomplete-wrapper-m2m.span-11 ul.repr li { + max-width: 340px; +} +.span-10 input[type=text], .span-10 input[type=password], +.span-10 select, .span-10 textarea, +input[type=text].span-10, input[type=password].span-10, +select.span-10, textarea.span-10, +.span-10 .ui-gFacelist-message, +.span-10 .ui-gFacelist-facelist, +.span-18 input.vForeignKeyRawIdAdminField, +.span-18 input.vManyToManyRawIdAdminField, +.span-10 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-10, +.span-14 label + input[type=text], .span-4 label + input[type=password], +.span-14 label + select, .span-14 label + textarea { + width: 358px; +} +.span-10 div.autocomplete-wrapper-m2m ul.repr, +.span-10 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-10 ul.repr, +div.autocomplete-wrapper-m2m.span-10 ul.repr li { + max-width: 300px; +} +.span-9 input[type=text], .span-9 input[type=password], +.span-9 select, .span-9 textarea, +input[type=text].span-9, input[type=password].span-9, +select.span-9, textarea.span-9, +.span-9 .ui-gFacelist-message, +.span-9 .ui-gFacelist-facelist, +.span-17 input.vForeignKeyRawIdAdminField, +.span-17 input.vManyToManyRawIdAdminField, +.span-9 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-9, +.span-13 label + input[type=text], .span-13 label + input[type=password], +.span-13 label + select, .span-13 label + textarea { + width: 318px; +} +.span-9 div.autocomplete-wrapper-m2m ul.repr, +.span-9 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-9 ul.repr, +div.autocomplete-wrapper-m2m.span-9 ul.repr li { + max-width: 260px; +} +.span-8 input[type=text], .span-8 input[type=password], +.span-8 select, .span-8 textarea, +input[type=text].span-8, input[type=password].span-8, +select.span-8, textarea.span-8, +.span-8 .ui-gFacelist-message, +.span-8 .ui-gFacelist-facelist, +.span-16 input.vForeignKeyRawIdAdminField, +.span-16 input.vManyToManyRawIdAdminField, +.span-8 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-8, +.span-12 label + input[type=text], .span-12 label + input[type=password], +.span-12 label + select, .span-12 label + textarea { + width: 278px; +} +.span-8 div.autocomplete-wrapper-m2m ul.repr, +.span-8 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-8 ul.repr, +div.autocomplete-wrapper-m2m.span-8 ul.repr li { + max-width: 220px; +} +.span-7 input[type=text], .span-7 input[type=password], +.span-7 select, .span-7 textarea, +input[type=text].span-7, input[type=password].span-7, +select.span-7, textarea.span-7, +.span-15 input.vForeignKeyRawIdAdminField, +.span-15 input.vManyToManyRawIdAdminField, +.span-7 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-7, +.span-11 label + input[type=text], .span-11 label + input[type=password], +.span-11 label + select, .span-11 label + textarea { + width: 238px; +} +.span-7 div.autocomplete-wrapper-m2m ul.repr, +.span-7 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-7 ul.repr, +div.autocomplete-wrapper-m2m.span-7 ul.repr li { + max-width: 180px; +} +.span-6 input[type=text], .span-6 input[type=password], +.span-6 select, .span-6 textarea, +input[type=text].span-6, input[type=password].span-6, +select.span-6, textarea.span-6, +.span-14 input.vForeignKeyRawIdAdminField, +.span-14 input.vManyToManyRawIdAdminField, +.span-6 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-6, +.span-10 label + input[type=text], .span-10 label + input[type=password], +.span-10 label + select, .span-10 label + textarea { + width: 198px; +} +.span-6 div.autocomplete-wrapper-m2m ul.repr, +.span-6 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-6 ul.repr, +div.autocomplete-wrapper-m2m.span-6 ul.repr li { + max-width: 140px; +} +.span-5 input[type=text], .span-5 input[type=password], +.span-5 select, .span-5 textarea, +input[type=text].span-5, input[type=password].span-5, +select.span-5, textarea.span-5, +.span-13 input.vForeignKeyRawIdAdminField, +.span-13 input.vManyToManyRawIdAdminField, +.span-5 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-5, +.span-9 label + input[type=text], .span-9 label + input[type=password], +.span-9 label + select, .span-9 label + textarea { + width: 158px; +} +.span-5 div.autocomplete-wrapper-m2m ul.repr, +.span-5 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-5 ul.repr, +div.autocomplete-wrapper-m2m.span-5 ul.repr li { + max-width: 100px; +} +.span-4 input[type=text], .span-4 input[type=password], +.span-4 select, .span-4 textarea, +input[type=text].span-4, input[type=password].span-4, +select.span-4, textarea.span-4, +.span-12 input.vForeignKeyRawIdAdminField, +.span-12 input.vManyToManyRawIdAdminField, +.span-4 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-4, +.span-8 label + input[type=text], .span-8 label + input[type=password], +.span-8 label + select, .span-8 label + textarea { + width: 118px; +} +.span-4 div.autocomplete-wrapper-m2m ul.repr, +.span-4 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-4 ul.repr, +div.autocomplete-wrapper-m2m.span-4 ul.repr li { + max-width: 60px; +} +.span-3 input[type=text], .span-3 input[type=password], +.span-3 select, .span-3 textarea, +input[type=text].span-3, input[type=password].span-3, +select.span-3, textarea.span-3, +.span-11 input.vForeignKeyRawIdAdminField, +.span-11 input.vManyToManyRawIdAdminField, +.span-3 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-3, +.span-7 label + input[type=text], .span-7 label + input[type=password], +.span-7 label + select, .span-7 label + textarea { + width: 78px; +} +.span-3 div.autocomplete-wrapper-m2m ul.repr, +.span-3 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-3 ul.repr, +div.autocomplete-wrapper-m2m.span-3 ul.repr li { + max-width: 20px; +} +.span-2 input[type=text], .span-2 input[type=password], +.span-2 select, .span-2 textarea, +input[type=text].span-2, input[type=password].span-2, +select.span-2, textarea.span-2, +.span-10 input.vForeignKeyRawIdAdminField, +.span-10 input.vManyToManyRawIdAdminField, +.span-2 div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-m2m.span-2, +.span-6 label + input[type=text], .span-6 label + input[type=password], +.span-6 label + select, .span-6 label + textarea { + width: 38px; +} +.span-2 div.autocomplete-wrapper-m2m ul.repr, +.span-2 div.autocomplete-wrapper-m2m ul.repr li, +div.autocomplete-wrapper-m2m.span-2 ul.repr, +div.autocomplete-wrapper-m2m.span-2 ul.repr li { + max-width: 30px; +} + + +.container-grid .span-flexible input[type=text], .container-grid .span-flexible input[type=password], +.container-grid .span-flexible textarea, .container-grid .span-flexible select { + width: 100% !important; +} + + + +/* Form Elements: Basic Widths & Heights +------------------------------------------------------------------------------------------------------ */ + +input[type=text], +input[type=password], +.vDateField, +.vTimeField, +.vIntegerField, +.vPositiveSmallIntegerField, +.vManyToManyRawIdAdminField, +.vForeignKeyRawIdAdminField { + width: 118px; +} + +input.vTextField, +input.vURLField, +input.vFileBrowseField, +textarea, +.vLargeTextField, +.vXMLLargeTextField { + width: 278px; +} + +.row select { + min-width: 118px; +} + +.vLargeTextField { + height: 118px; +} + + + +/* Large Form Elements in Change-Form: Widths & Heights +------------------------------------------------------------------------------------------------------ */ + +.row .vTextField, +.row .vURLField, +.row .vFileBrowseField, +.row textarea, +.row .vLargeTextField, +.row .vXMLLargeTextField, +div.autocomplete-wrapper-m2m { + width: 758px; +} +.row select { + max-width: 758px; +} +div.autocomplete-wrapper-m2m ul.repr, +div.autocomplete-wrapper-m2m ul.repr li { + max-width: 700px; +} + + + +/* Form Elements in Changelist-Results Table & Tabular Modules: Widths & Heights +------------------------------------------------------------------------------------------------------ */ + +.changelist-results table select, +.module.table select, +.module.table div.autocomplete-wrapper-m2m { + max-width: 278px; +} +.module.table div.autocomplete-wrapper-m2m { + width: 278px; +} +.module.table div.autocomplete-wrapper-m2m ul.repr, +.module.table div.autocomplete-wrapper-m2m ul.repr li { + max-width: 222px; +} + + +/* Form Elements Cells +------------------------------------------------------------------------------------------------------ */ + +.cell input[type=text], +.cell input[type=password], +.cell select, +.cell div.autocomplete-wrapper-m2m { + max-width: 280px; +} +.cell div.autocomplete-wrapper-m2m { + width: 280px; +} +.cell div.autocomplete-wrapper-m2m ul.repr, +.cell div.autocomplete-wrapper-m2m ul.repr li { + max-width: 222px; +} + + +/* Autocomplete Elements +------------------------------------------------------------------------------------------------------ */ + + +/* Autocomplete Wrappers (Input and Input-Lookalike) ......................................... */ + +div.autocomplete-wrapper-m2m, +div.autocomplete-wrapper-fk input.ui-autocomplete-input { + padding-right: 55px; + color: #666; + border: 1px solid #ccc; +/* border-color: #ccc #ddd #ddd #ccc;*/ + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; + box-shadow: 0 1px 3px #eaeaea inset; -moz-box-shadow: 0 1px 3px #eaeaea inset; -webkit-box-shadow: 0 1px 3px #eaeaea inset; +/* background: #fff url('../img/backgrounds/autocomplete.png') repeat-x scroll;*/ + background: #fff; +/* background: #f2f8fa;*/ +/* background: #e1f0f5;*/ +} +div.autocomplete-wrapper-m2m.state-focus, +div.autocomplete-wrapper-fk input.ui-autocomplete-input:focus { + border-color: #999; + background: #e1f0f5; +/* border: 1px solid #309bbf;*/ +/* background: #fff url('../img/backgrounds/autocomplete.png');*/ +} + +div.autocomplete-wrapper-m2m { + display: inline-block; + position: relative; + padding: 0 0 0 1px; +/* width: 758px;*/ + height: auto !important; + vertical-align: top; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +div.autocomplete-wrapper-fk { + display: inline-block; + position: relative; + width: auto !important; + height: auto !important; + margin: 0 !important; + padding: 0 !important; + vertical-align: top; + font-size: 0 !important; /* Set font-size and line-height to 0 to let the   at the end of the autocomplete-wrapper disappear */ + line-height: 0 !important; + background: transparent !important; +} + + +/* M2M Listing ......................................... */ + +div.autocomplete-wrapper-m2m ul.repr { +/* position: relative;*/ + float: left; +/* clear: both;*/ +/* padding-right: 25px;*/ + width: 100%; + overflow: hidden; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +div.autocomplete-wrapper-m2m li { +/* position: relative;*/ + float: left; + display: inline; + overflow: hidden; + text-overflow: ellipsis; +} +div.autocomplete-wrapper-m2m li.search { + margin-top: 1px; + margin-bottom: 1px; + background: transparent; +} +div.autocomplete-wrapper-m2m li.search input[type=text] { + margin: 0 0 -1px !important; + padding: 0 4px !important; + width: 100px; + height: 22px !important; + font-size: 12px !important; + line-height: 16px !important; + outline: 0 !important; + border: 0 !important; + box-shadow: none !important; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; + background: transparent !important; + cursor: text; +} +div.autocomplete-wrapper-m2m li.repr { + margin-top: 3px; + margin-bottom: 0; + margin-right: 5px; + font-weight: bold; + line-height: 18px; +} + + +/* Autocomplete Icons ......................................... */ + +div.autocomplete-wrapper-m2m li.repr a.m2m-remove { + color: #666; + padding-left: 5px; +} + +div.autocomplete-wrapper-fk.autocomplete-preremove input.ui-autocomplete-input, +div.autocomplete-wrapper-m2m.autocomplete-preremove li.repr a { + color: #bf3030 !important; +} + +div.autocomplete-wrapper-m2m li.repr.autocomplete-preremove a { + color: #bf3030 !important; +} + +div.autocomplete-wrapper-m2m a.related-lookup, +div.autocomplete-wrapper-fk a.related-lookup { + position: absolute; + border: 1px solid #ccc; +} +div.autocomplete-wrapper-m2m a.related-lookup { + top: -1px; + right: -1px; +/* border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px;*/ +} + +div.autocomplete-wrapper-fk a.related-lookup { + top: 0; + right: 0; +} +div.autocomplete-wrapper-fk a.related-remove, +div.autocomplete-wrapper-m2m a.related-remove, +div.autocomplete-wrapper-fk div.loader, +div.autocomplete-wrapper-m2m div.loader { + display: inline-block; + position: absolute; + right: 24px; + top: 0; + font-size: 0; + line-height: 0; + width: 23px; + height: 23px; + border: 1px solid #ccc; +/* border-radius: 15px; -moz-border-radius: 15px; -webkit-border-radius: 15px;*/ +} +div.autocomplete-wrapper-m2m a.related-remove + a.related-lookup { + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; +} +div.autocomplete-wrapper-fk a.related-remove:link, +div.autocomplete-wrapper-fk a.related-remove:visited, +div.autocomplete-wrapper-m2m a.related-remove:link, +div.autocomplete-wrapper-m2m a.related-remove:visited { + background: #fff url('../img/icons/icon-autocomplete-fk-remove.png') 50% 50% no-repeat scroll; +} +div.autocomplete-wrapper-fk a.related-remove:hover, +div.autocomplete-wrapper-fk a.related-remove:active, +div.autocomplete-wrapper-m2m a.related-remove:hover, +div.autocomplete-wrapper-m2m a.related-remove:active { + background: #fff url('../img/icons/icon-autocomplete-fk-remove-hover.png') 50% 50% no-repeat scroll; +} + +div.autocomplete-wrapper-m2m.state-focus a.related-lookup, +div.autocomplete-wrapper-fk input.ui-autocomplete-input:focus + * + a.related-lookup, +div.autocomplete-wrapper-m2m.state-focus a.related-remove, +div.autocomplete-wrapper-fk input.ui-autocomplete-input:focus + * + * + a.related-remove, +div.autocomplete-wrapper-m2m.state-focus .loader, +div.autocomplete-wrapper-fk input.ui-autocomplete-input:focus + * + * + * + .loader { + border-color: #999; +} + +div.autocomplete-wrapper-fk div.loader, +div.autocomplete-wrapper-m2m div.loader { + /*display: inline-block !important;*/ + width: 23px; + height: 23px; + background: #fff url('../img/backgrounds/loading-small.gif') 50% 50% no-repeat scroll; +} +/*div.autocomplete-wrapper-m2m.state-focus a.related-remove, +div.autocomplete-wrapper-fk input.ui-autocomplete-input:focus + * + * + a.related-remove, +div.autocomplete-wrapper-m2m.state-focus .loader, +div.autocomplete-wrapper-fk input.ui-autocomplete-input:focus + * + * + * + .loader { + background-color: #e1f0f5; +} +*/ +div.autocomplete-wrapper-m2m a.related-remove, +div.autocomplete-wrapper-m2m a.related-remove + div.loader { + top: -1px; + right: 23px; +/* border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px;*/ +} + + + +/* Autocompletes in Changelists ......................................... */ + +#changelist table div.autocomplete-wrapper-fk a.related-remove, #changelist table div.autocomplete-wrapper-m2m a.related-remove, +#changelist table div.autocomplete-wrapper-fk div.loader, #changelist table div.autocomplete-wrapper-m2m div.loader { + top: -5px; +} + +/* we need to "hide" the input-field without display:none, because with display:none we can´t focus the field anymore */ +div.autocomplete-wrapper-m2m input.vManyToManyRawIdAdminField, div.autocomplete-wrapper-fk input.vForeignKeyRawIdAdminField, div.autocomplete-wrapper-fk input.vIntegerField { + position: absolute; + left: 0; + top: -40px; + width: 10px; + height: 10px; + color: transparent !important; + border: 0 !important; + background: transparent !important; + box-shadow: none !important; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; + cursor: default !important; +} \ No newline at end of file diff --git a/static/grappelli/css/grappelli-skin-basic.css b/static/grappelli/css/grappelli-skin-basic.css new file mode 100644 index 00000000..76d380fb --- /dev/null +++ b/static/grappelli/css/grappelli-skin-basic.css @@ -0,0 +1,1301 @@ + + + +/* TYPOGRAPHY +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + + + +/* Paragraphs +------------------------------------------------------------------------------------------------------ */ + +.module p.help, +p.help { + color: #999; +} + +.fb_show + p.help a { + border: 1px solid #309bbf; +} +.fb_show + p.help a:link, .fb_show + p.help a:visited { + border: 1px solid #309bbf; +} +.fb_show + p.help a:hover, .fb_show + p.help a:active { + border: 1px solid #444; +} + + + +/* Links +------------------------------------------------------------------------------------------------------ */ + +a:link, a:visited { + color: #309bbf; +} +a:hover, a:active, a.selected { + color: #444; +} + +.dashboard h2 a:link, .dashboard h2 a:visited, +.dashboard h3 a:link, .dashboard h3 a:visited { + color: #444; +} +.dashboard h2 a:hover, .dashboard h2 a:active, +.dashboard h3 a:hover, .dashboard h3 a:active { + color: #309bbf; +} + +#header a:link, #header a:visited { + color: #59AFCC; +} +#header a:hover, #header a:active { + color: #444; +} + + + +/* Blockquote, Pre, Code +------------------------------------------------------------------------------------------------------ */ + +blockquote { + color: #777; + border-left: 5px solid #ddd; +} + +code, pre { + color: #666; + background: inherit; +} + +pre.literal-block { + background: #eee; +} + +code strong { + color: #930; +} + +hr { + color: #eee; + border: 0; + background-color: #eee; +} + + + +/* RTE (Rich Text Edited) +------------------------------------------------------------------------------------------------------ */ + +.rte h3 { + border-top: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; +} +.rte .group h3 { + border-top: 0; +} +.rte h3:last-child, +.rte h4:last-child { + border-bottom: 0; +} +.rte td { + border-left: 1px solid #f4f4f4; +} +.rte td:first-of-type { + border-left: 0; +} +.delete-confirmation ul.rte>li { + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; +} +.delete-confirmation ul.rte>li:first-child { + border-top: 0; +} +.delete-confirmation ul.rte>li:last-child { + border-bottom: 0; +} +.delete-confirmation ul.rte>li>ul>li { + border-top: 1px dashed #e0e0e0; +} +.rte blockquote table { + border: 1px solid #d4d4d4; +} + + + +/* Other Styles +------------------------------------------------------------------------------------------------------ */ + +.warning { + color: #bf3030; +} +.quiet { + color: #999; +} + + + +/* STRUCTURES +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +body { + color: #444; + background: #fff; +} + + + +/* Header +------------------------------------------------------------------------------------------------------ */ + +#header { + color: #eee; + background: #333; +} +#header a:hover, #header a:active { + color: #ddd; +} + + + +/* Branding, Bookmarks & User-Tools +------------------------------------------------------------------------------------------------------ */ + +.branding { + border-left: 1px solid #343434; + background-color: #262626; +} +.admin-title { + border-left: 1px solid #404040; + border-right: 1px solid #303030; +} + + +/* User Tools ................................................... */ + +#user-tools { + border-left: 1px solid #303030; +} +#user-tools>li { + border-left: 1px solid #404040; + border-right: 1px solid #303030; +} +li.user-options-container.open a.user-options-handler { + color: #eee !important; +} +li.user-options-container.open ul.user-options { + border-top: 1px solid #262626; + background: #333; +} +ul.user-options li { + border-top: 1px solid #404040; + border-bottom: 1px solid #292929; +} +ul.user-options li:last-child { + border-bottom: 0; +} + + + +/* Breadcrumbs +------------------------------------------------------------------------------------------------------ */ + +div#breadcrumbs { + color: #666; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; + background: #e6e6e6; +} + + + +/* Messages +------------------------------------------------------------------------------------------------------ */ + +ul.messagelist li { + border-bottom: 1px solid #ccc; + background-color: #e8f2da; +} +ul.messagelist.success li { + background-color: #e8f2da; +} +ul.messagelist.error li { + background-color: #f2e6e6; +} + + + +/* Login Form +------------------------------------------------------------------------------------------------------ */ + +.login .module { + border: 0; + background: #333; +} +.login .module .row { + border-top: 1px solid #444; + border-bottom: 1px solid #222; +} +.login .module label { + color: #eee; +} + + + +/* COMPONENTS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + + + +/* Modules +------------------------------------------------------------------------------------------------------ */ + +.module { + border: 1px solid #bdbdbd; + background: #eee; +} +.rte .module { + background: transparent; +} + + +/* Nested Modules Basics ......................................... */ + +.module .module, +.module fielset.module { + border: 0; +} + + + +/* Groups +------------------------------------------------------------------------------------------------------ */ + +.group.collapse.closed { + border: 2px solid #e0e0e0; +} +.group, +.group.collapse.closed:hover { + border: 2px solid #c7c7c7; +} + + + +/* Elements in Modules & Groups +------------------------------------------------------------------------------------------------------ */ + + +/* 1st Level Borders Top (Dark/Bright) ......................................... */ + +.group h2, +.module h2 { + border-bottom: 1px solid #bdbdbd; + background: #d6d6d6; +} +.group h2 { + border: 1px solid #bdbdbd; +} +.module h2+*, +.module h2+.tools+* { + border-top: 1px solid #fff; +} +.module h2+.module, +.module h2+.tools, +.module h2+.tools+.module { + border-top: 0 !important; +} + + +/* 2nd Level Borders Top (Dark/Bright) ......................................... */ + +.module .module { + border-top: 1px solid #c7c7c7; +} +.module .module>*:first-child { + border-top: 1px solid #eee; +} +#changelist .span-flexible .module .module:first-child { + border-top: 0; +} + +.group h3, +.module h3 { + border-bottom: 1px solid #c7c7c7; + background: #e0e0e0; +} +.module h3+*, +.module h3+.tools+* { + border-top: 1px solid #fff; +} +.module h3+.module, +.module h3+.tools, +.module h3+.tools+.module { + border-top: 0 !important; +} + + +/* 3rd Level Borders Top (Dark/Bright) ......................................... */ + +.group .module .module, +.module .module .module { + border-top: 1px solid #d4d4d4; +} +.group .module .module>*:first-child, +.module .module .module>*:first-child { + border-top: 1px solid #f4f4f4; +} + +.group h4, +.module h4 { + border-bottom: 1px solid #d4d4d4; + background: #e8e8e8; +} +.module h4+*, +.module h4+.tools+* { + border-top: 1px solid #fff; +} +.module h4+.tools { + border-top: 0 !important; +} +.module .description { + border-bottom: 1px solid #d4d4d4; +} + + + +/* Collapsible Structures +------------------------------------------------------------------------------------------------------ */ + +.module.collapse.closed h2.collapse-handler, +.module.collapse.closed h3.collapse-handler, +.module.collapse.closed h4.collapse-handler { + border-bottom: 0; +} + + +/* 1st Level Collapsible-Handler ......................................... */ + +.collapse h2.collapse-handler { + background: #a1d4e5; +} +.collapse h2.collapse-handler:hover, +.collapse.open h2.collapse-handler { + background: #bcdfeb; +} + + +/* 2nd Level Collapsible-Handler ......................................... */ + +.group .collapse h3.collapse-handler, +.module .collapse h3.collapse-handler { + background: #cee9f2; +} +.group .collapse h3.collapse-handler:hover, +.module .collapse h3.collapse-handler:hover, +.group .collapse.open h3.collapse-handler, +.module .collapse.open h3.collapse-handler { + background: #e1f0f5; +} +.module .collapse h3.collapse-handler { + border-top: 1px solid #e1f0f5; +} + + +/* 3rd Level Collapsible-Handler ......................................... */ + +.group .module .collapse h4.collapse-handler, +.module .module .collapse h4.collapse-handler { + border-top: 1px solid #f0f7fa; + background: #e1f0f5; +} +.group .collapse h4.collapse-handler:hover, +.module .collapse h4.collapse-handler:hover, +.group .collapse.open h4.collapse-handler, +.module .collapse.open h4.collapse-handler { + background: #ebf2f5; +} + + + +/* Row +------------------------------------------------------------------------------------------------------ */ + +.row { + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; + border-left: 0; + border-right: 0; +} +.row.first, +.row:first-child, +.module input[type=hidden] + .row { + border-top: 0 !important; +} +.row.last, +.row:last-child, +.row:last-of-type, +fieldset.module > .row.last, +fieldset.module > .row:last-child { + border-bottom: 0 !important; +} + + + +/* Cell +------------------------------------------------------------------------------------------------------ */ + +.cell { + border-right: 1px solid #e0e0e0; + border-left: 1px solid #fff; +} + + + +/* Fieldset Cell +------------------------------------------------------------------------------------------------------ */ + +fieldset.module .cell:first-child { + border-left: 0 !important; +} +fieldset.module .cell:last-child, +fieldset.module .cell.last { + border-right: 0 !important; +} +fieldset.module .cell.last + fieldset.module .cell { + border-left: 0 !important; +} + + +/* Tabular Modules +------------------------------------------------------------------------------------------------------ */ + +.module.table { + border: 0; + border-collapse: separate; + border-spacing: 0 2px; + background: transparent; +} +.module.thead, +.module.tfoot { + color: #aaa; + background: transparent; +} +.module.table .tr, +.module.tbody { + background: transparent; +} +.module.table .th, +.module.table .td { + border-left: 1px solid #fff; + border-right: 1px solid #e0e0e0; +} +.module.thead .th:last-of-type, +.module.thead .td:last-of-type, +.module.tfoot .td:last-of-type { + border-right: 0; +} +.module.table .module.thead .th, +.module.table .module.thead .td { + border-top: 0; + border-bottom: 0; + background: none; +} +.module.tbody .th, +.module.tbody .td { + border-top: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; + background: #eee; +} +.module.tbody .th:first-of-type, +.module.tbody .td:first-of-type { + border-left: 1px solid #ccc; +} + + + +/* Add Items +------------------------------------------------------------------------------------------------------ */ + +.module.add-item { + border: 1px solid transparent; + background: #fff; +} + + + +/* Predelete +------------------------------------------------------------------------------------------------------ */ + +.predelete h2, .predelete h2.collapse-handler, +.predelete h3, .predelete h3.collapse-handler, +.predelete h4, .predelete h4.collapse-handler { + background: #f2e6e6 !important; +} +.predelete h2.collapse-handler:hover, +.predelete h3.collapse-handler:hover, +.predelete h4.collapse-handler:hover, +.collapse.open .predelete h2.collapse-handler, +.collapse.open .predelete h3.collapse-handler, +.collapse.open .predelete h4.collapse-handler { + background: #f2e6e6 !important; +} +.predelete, +.predelete .module, +.predelete .th, +.predelete .td { + background: #f2e6e6 !important; +} + + + +/* Selectors +------------------------------------------------------------------------------------------------------ */ + +.selector-available, .selector-chosen { + border: 1px solid #ccc; + background: #ddd; +} +.selector h2, .inline-group .selector h2, +.inline-related fieldset .selector-available h2, .inline-related fieldset .selector-chosen h2 { + border: 0; + border-bottom: 1px solid #d0d0d0; + background: transparent; +} +.selector .selector-filter { + color: #666; + border-top: 1px solid #e4e4e4; + border-bottom: 1px solid #e4e4e4; +} +.selector select[multiple=multiple] { + border-left: 0; + border-top: 1px solid #d0d0d0; + border-bottom: 1px solid #d0d0d0; +} + +a.selector-chooseall, a.selector-clearall { + border-top: 1px solid #e4e4e4; +} + +.selector h2 + select { + border-top: 0; +} + +a.selector-chooseall, a.selector-clearall { + border-top: 1px solid #e4e4e4; +} + + + +/* Link-List, Actions, Feed, Table of Contents +------------------------------------------------------------------------------------------------------ */ + +.module.link-list, +.module.link-list .module, +.module.actions, +.module.actions .module, +.module.feed, +.module.feed .module { + background: #fff; +} +.link-list ul li, +.feed ul li, +.actions ul li, +.table-of-contents ul li { + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; +} +.actions ul li { + color: #999; +} +.actions ul li:first-child, +.link-list ul li:first-child, +.feed ul li:first-child, +.table-of-contents ul li:first-child { + border-top: 0; +} +.actions ul li:last-child, +.link-list ul li:last-child, +.feed ul li:last-child, +.table-of-contents ul li:last-child { + border-bottom: 0; +} +.link-list ul li.selected a, +.table-of-contents ul li.selected a { + color: #444; +} +a.internal:link, a.internal:visited {} +a.internal:hover, a.internal:active, +.actions li.delete-link { + color: #666; +} +a.external:link, a.external:visited { + color: #83c3d9; +} +a.external:hover, a.external:active { + color: #666; +} + + + +/* Module Changelist Filters +------------------------------------------------------------------------------------------------------ */ + +.module.changelist-filters { + color: #666; + border: 1px solid #d4d4d4; +} + + + +/* Module Search & Module Filter +------------------------------------------------------------------------------------------------------ */ + +.module.search, +.module.filter { + border: 0; +} +.module.filter .pulldown-container { + border: 1px solid #fff; +} +.module.filter.open .pulldown-container { + border-color: #ccc; + box-shadow: 0 0 10px #444; -moz-box-shadow: 0 0 10px #444; -webkit-box-shadow: 0 0 10px #444; +} + +.open a.button.toggle-filters, +.open.selected a.button.toggle-filters { + border-color: transparent !important; +} +a.button.toggle-filters:link, a.button.toggle-filters:visited { + color: #309bbf; + border-color: #ddd; +} +.selected a.button.toggle-filters:link, .selected a.button.toggle-filters:visited { + color: #444; + background-color: #e1f0f5; +} +.open a.button.toggle-filters, .selected a.button.toggle-filters, +.selected a.button.toggle-filters:hover, .selected a.button.toggle-filters:active, +a.button.toggle-filters:hover, a.button.toggle-filters:active { + color: #666; + border-color: #ccc; + background-color: #e1f0f5; +} +.selected a.button.toggle-filters:link, .selected a.button.toggle-filters:visited { + color: #666; + border-color: #ddd; + background-color: #e1f0f5; +} +.open a.button.toggle-filters, +.open.selected a.button.toggle-filters, +.selected a.button.toggle-filters:hover, .selected a.button.toggle-filters:active, +a.button.toggle-filters:hover, a.button.toggle-filters:active { + color: #666; + border-color: #ccc; + background-color: #e1f0f5; +} + +.filter-pulldown { + border: 1px solid transparent; + border-top: 0; + background: #e1f0f5; +} +.filter-pulldown label { + color: #999; +} + + + +/* Module Date Hierarchy +------------------------------------------------------------------------------------------------------ */ + +.module.date-hierarchy { + border: 1px solid #d9d9d9; + background: #eee; +} +.module + .module.date-hierarchy .row { + border-top: 1px solid #fff !important; +} +.date-hierarchy a:link, .date-hierarchy a:visited { + color: #59afcc; +} +.date-hierarchy a:hover, .date-hierarchy a:active { + color: #444; +} +.date-hierarchy a.date-hierarchy-back:hover, .date-hierarchy a.date-hierarchy-back:active { + color: #666; +} + + + +/* Pagination +------------------------------------------------------------------------------------------------------ */ + +.module.pagination { + border: 1px solid #d9d9d9; +} +.module .module.pagination { + border: 0; +} +ul.pagination { + border-top: 0 !important; +} +ul.pagination li { + border: 1px solid #fff; +} + +ul.pagination span, +ul.pagination a { + border: 1px solid; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +ul.pagination a:link, .pagination a:visited { + color: #59afcc; + border-color: #d9d9d9; +} +ul.pagination a:hover, .pagination a:active { + color: #444; + border-color: #bdbdbd; + background: #e0e0e0; +} +ul.pagination span { + color: #444; + border-color: #bdbdbd; + background: #e0e0e0; +} +ul.pagination li.separator span { + border-color: transparent; + background: transparent; +} + + + +/* Module Changelist-Results +------------------------------------------------------------------------------------------------------ */ + +.module.changelist-results { + background-color: #eee !important; +} + + + +/* Module Changelist Actions +------------------------------------------------------------------------------------------------------ */ + +.module.changelist-actions { + color: #ccc; + background: #eee; +} +.module.changelist-actions.all-selected, +.module.changelist-actions.all-selected + .module.changelist-results { + background: #ffffe6 !important; +} +.module.changelist-actions ul li { + border: 1px solid #444; +} +.module.changelist-actions ul a, +.module.changelist-actions ul span { + border: 1px solid; +} +.module.changelist-actions ul a:link, .module.changelist-actions ul a:visited { + color: #59afcc; + border-color: #333; + background: #333; +} +.module.changelist-actions ul a:hover, .module.changelist-actions ul a:active { + color: #ccc; + border-color: #333; + background: #555; +} +.module.changelist-actions ul span { + color: #ccc; + border-color: #333; +} +.module.changelist-actions ul span span { + border: 0; +} + + + +/* Module Footer +------------------------------------------------------------------------------------------------------ */ + +.module.footer { + border: 0; + border-top: 1px solid #bdbdbd; + background: #333; +} + + + +/* Submit Row +------------------------------------------------------------------------------------------------------ */ + +.module.submit-row { + border: 0; + background: transparent; +} + + + +/* Tooltips +------------------------------------------------------------------------------------------------------ */ + +.module.search .tooltip .tooltip-content { + border: 1px solid #ccc; + background: #fff; +} + + + +/* TOOLS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +ul.tools li { + border-top: 0 !important; + border-bottom: 0 !important; +} + + + +/* H1 + Tools +------------------------------------------------------------------------------------------------------ */ + +h1 + .tools a { + color: #fff; + border-radius: 15px; -moz-border-radius: 15px; -webkit-border-radius: 15px; +} +h1 + .tools a:link, h1 + .tools a:visited { + background: #444; +} +h1 + .tools a:hover, h1 + .tools a:active { + border-color: transparent; + background: #309bbf; +} +h1 + .tools a.add-handler:link, h1 + .tools a.add-handler:visited { + background-color: #444; +} +h1 + .tools a.add-handler:hover, h1 + .tools a.add-handler:active { + background-color: #309bbf; +} + + + +/* FORMS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + + + +/* Errors +------------------------------------------------------------------------------------------------------ */ + +.errornote { + color: #f7f7f7; + background: #bf3030; +} +ul.errorlist { + color: #bf3030; +} +.error input, .error select, .errors input, .errors select, .errors textarea { + border: 1px solid #bf3030 !important; +} + + + +/* Labels & Other Typographic Elements in Forms +------------------------------------------------------------------------------------------------------ */ + +label { + color: #444; +} + + + +/* Form Elements +------------------------------------------------------------------------------------------------------ */ + +input, textarea, select, button { + color: #666; + border: 1px solid #bbb; + border-color: #ccc #ddd #ddd #ccc; + outline: 0; +} +input, textarea, select { + box-shadow: 0 1px 3px #eaeaea inset; -moz-box-shadow: 0 1px 3px #eaeaea inset; -webkit-box-shadow: 0 1px 3px #eaeaea inset; +} + +*:focus, input:focus, textarea:focus, select:focus { + border-color: #999 #bbb #bbb #999; +} +select:focus * { + border: 0 !important; + outline: 0 !important; +} + + +/* Searchbar ................................................... */ + +form#changelist-search { + border: 1px solid #fff; + border-radius: 15px; -moz-border-radius: 15px; -webkit-border-radius: 15px; +} +input#searchbar { + border-radius: 14px; -moz-border-radius: 14px; -webkit-border-radius: 14px; +} + + +/* Select ................................................... */ + +option, +select[multiple=multiple] option { + border-bottom: 1px dotted #ddd !important; +} +option:last-child { + border-bottom: 0; +} + + +/* Autocomplete Fields ................................................... */ + +.vAutocompleteSearchField, +.vM2MAutocompleteSearchField { + background: #eaf5f8; +} + + +/* Read Only ................................................... */ + +input[readonly], +textarea[readonly], +select[readonly] { + background: #f4f4f4; +} + + + +/* BUTTONS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +input[type=submit], input[type=reset], input[type=button], button { + color: #fff; + border: 0; + background: #acd7e5; +} + + +/* Button Containers ................................................... */ + +.submit-row>*[class*="-container"] { + box-shadow: 0 0 5px #666; -moz-box-shadow: 0 0 5px #666; -webkit-box-shadow: 0 0 5px #666; + background: #d6d6d6; +} +.submit-row>*[class*="-container"]:hover { + box-shadow: 0 0 5px #777; -moz-box-shadow: 0 0 5px #777; -webkit-box-shadow: 0 0 5px #777; + background: #d6d6d6; +} +.submit-row>*[class*="cancel-button-container"] { + box-shadow: 0 0 5px #aaa; -moz-box-shadow: 0 0 5px #aaa; -webkit-box-shadow: 0 0 5px #aaa; +} +.footer .submit-row>*[class*="-container"], +.footer .submit-row>*[class*="cancel-button-container"] { + border: 1px solid #666; + box-shadow: 0 0 5px #666; -moz-box-shadow: 0 0 5px #666; -webkit-box-shadow: 0 0 5px #666; + background: #666; +} +.submit-row>*[class*="cancel-button-container"] { + box-shadow: 0 0 5px #aaa; -moz-box-shadow: 0 0 5px #aaa; -webkit-box-shadow: 0 0 5px #aaa; +} +.footer .submit-row>*[class*="-container"]:hover, +.footer .submit-row>*[class*="cancel-button-container"]:hover { + border: 1px solid #777; + box-shadow: 0 0 5px #777; -moz-box-shadow: 0 0 5px #777; -webkit-box-shadow: 0 0 5px #777; + background: #777; +} + + + +/* Buttons & Buttonlike Links +------------------------------------------------------------------------------------------------------ */ + +.submit-row input[type=submit], +.submit-row a.submit-link:link, .submit-row a.submit-link:visited { + border: 1px solid #267c99; +} + +input[type=submit], +#bookmark-add-cancel, +.submit-row a.delete-link:link, .submit-row a.delete-link:visited, +.submit-row a.cancel-link:link, .submit-row a.cancel-link:visited, +.submit-row input[type=button] { + box-shadow: none !important; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; +} + +.submit-row a.delete-link:link, .submit-row a.delete-link:visited { + color: #fff; + border: 1px solid #992626; + background: #bf3030; +} +#bookmark-add-cancel, +.submit-row a.cancel-link:link, .submit-row a.cancel-link:visited, +.submit-row input.cancel:hover { + color: #fff; + border: 1px solid #444; + background: #666; +} + +input[type=submit], +.submit-row a.submit-link:hover, .submit-row a.submit-link:active { + color: #fff; + background: #309bbf; +} +input[type=submit]:hover, +#bookmark-add-cancel:hover, +.submit-row a.submit-link:hover, .submit-row a.submit-link:active, +.submit-row a.delete-link:hover, .submit-row a.delete-link:active, +.submit-row a.cancel-link:hover, .submit-row a.cancel-link:active, +.submit-row input.cancel { + color: #444; + border: 1px solid #aaa; + background: #d6d6d6; +} +.footer input[type=submit]:hover, +.footer #bookmark-add-cancel:hover, +.footer .submit-row a.delete-link:hover, .footer .submit-row a.delete-link:active, +.footer .submit-row a.cancel-link:hover, .footer .submit-row a.cancel-link:active { + border: 1px solid #666; +} + +button { + background: #309bbf; +} +button:hover { + background: #666; +} + +button.fb_show, +button.ui-gAutocomplete-browse, +button.ui-gFacelist-browse, +button.ui-gAutoSlugField-toggle, +button.ui-datepicker-trigger, +button.ui-timepicker-trigger, +.tinyMCE .browse span { + border: 1px solid #ccc; + background-color: #e1f0f5; +} +button.fb_show:hover, +button.ui-gAutocomplete-browse:hover, +button.ui-gFacelist-browse:hover, +button.ui-gAutoSlugField-toggle:hover, +button.ui-datepicker-trigger:hover, +button.ui-timepicker-trigger:hover, +.tinyMCE .browse span:hover { + background-color: #e1e1e1; +} +button.fb_show[disabled], +button.ui-gAutocomplete-browse[disabled], +button.ui-gFacelist-browse[disabled], +button.ui-gAutoSlugField-toggle[disabled], +button.ui-datepicker-trigger[disabled], +button.ui-timepicker-trigger[disabled], +input[disabled] + a { + background-color: transparent !important; + opacity: 0.3; + cursor: auto !important; +} + + +/* Search Button ......................................... */ + +button.search { + border-color: transparent !important; + background-color: transparent; +} + + + +/* Links as Buttons +------------------------------------------------------------------------------------------------------ */ + +a.button, +.datecrumbs a, +.datecrumbs span { + border: 1px solid #e0e0e0; +} + + +/* Drop-Down Button ......................................... */ + +a.button.drop-down[class*="selected"] { + color: #444 !important; + border-color: #b0b0b0; + border-bottom-width: 0 !important; + box-shadow: 0 -2px 3px #bbb, -2px -2px 3px #bbb, 2px -2px 3px #bbb; + -moz-box-shadow: 0 -2px 3px #bbb, -2px -2px 3px #bbb, 2px -2px 3px #bbb; + -webkit-box-shadow: 0 -2px 3px #bbb, -2px -2px 3px #bbb, 2px -2px 3px #bbb; +} +a.button.drop-down:link, a.button.drop-down:visited { + color: #309bbf; + background-color: #fff; +} +a.button.drop-down[class*="selected"], +a.button.drop-down:hover, a.button.drop-down:active { + color: #666; + background-color: #e1f0f5; +} + + +/* Filebrowser & Related Lookup ......................................... */ + +a.fb_show, +a.related-lookup { + border: 1px solid #ccc; +} +a.fb_show:link, a.fb_show:visited, +a.related-lookup:link, a.related-lookup:visited { + background-color: #e1f0f5; +} +a.fb_show:hover, a.fb_show:active, +a.related-lookup:hover, a.related-lookup:active { + background-color: #e1e1e1; +} +a.related-lookup + strong { + color: #555; +} + + +/* Buttons & Button Links in Errors ......................................... */ + +.error input + button, +.error .vDateField + button, +.error .vTimeField + button, +.error input + a.fb_show, +.error input + a.related-lookup, +.error input + a.add-another, +.errors input + button, +.errors .vDateField + button, +.errors .vTimeField + button, +.errors input + a.fb_show, +.errors input + a.related-lookup, +.errors input + a.add-another { + border-color: #bf3030; +} + + +/* Focused Buttons & Button Links ......................................... */ + +input:focus + button, +.vDateField:focus + span a, +.vTimeField:focus + span a, +input:focus + a.fb_show, +input:focus + a.related-lookup, +input:focus + a.add-another { + border-color: #bbb; + border-left-color: #ccc; +} + + + +/* TABLES +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +tr.alt th, tr.alt td { + background: #f4f4f4; +} +.row1 th, .row1 td { + background: #f4f4f4; +} +.row2 th, .row2 td { + background: #fff; +} +.selected th, .selected td { + background: #ffd; +} + + +/* Thead ................................................... */ + +thead th, +tfoot td { + color: #aaa; + border-left: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; + background: #eee; +} +thead th.sorted { + border-bottom: 1px solid #ccc; + background: #e0e0e0; +} + +thead th a:link, thead th a:visited { + color: #59afcc; + border-top: 1px solid #fff; +} +thead th a:hover, thead th a:active, +thead th.sorted a { + color: #444; +} +thead th.sorted a { + border-top: 1px solid #ececec; +} + + +/* Tbody ................................................... */ + +tbody th, tbody td { + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; +} + +tfoot td { + border-bottom: 0; + border-top: 1px solid #d4d4d4; +} + +thead th:first-child, +tfoot td:first-child { + border-left: 0; +} + +fieldset table { + border-right: 1px solid #eee; +} + +tr.row-label td { + border-bottom: 0; + color: #666; +} + + + +/* Changelist Table +------------------------------------------------------------------------------------------------------ */ + +#changelist table { + border: 1px solid #bdbdbd; +} +#changelist tbody th, #changelist tbody td { + border: 0; + border-top: 1px solid #e8e8e8; + border-left: 1px solid #e0e0e0; +} +#changelist tbody tr:first-child th, #changelist tbody tr:first-child td { + border-top: 1px solid #fff; +} +#changelist tbody tr th:first-child, #changelist tbody tr td:first-child { + border-left: 0; +} +#changelist thead *[style^="display: none"] + *, +#changelist tbody tr *[style^="display: none"] + * { + border-left: 0; +} + + + +/* Overrides +------------------------------------------------------------------------------------------------------ */ + +tbody th:first-child, tbody td:first-child { + border-left: 0; +} +tbody tr:last-child td, tbody tr:last-child th { + border-bottom: 0; +} diff --git a/static/grappelli/css/grappelli-skin-default.css b/static/grappelli/css/grappelli-skin-default.css new file mode 100644 index 00000000..186e8ae6 --- /dev/null +++ b/static/grappelli/css/grappelli-skin-default.css @@ -0,0 +1,1892 @@ + + + +/* TYPOGRAPHY +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + + + +/* Paragraphs +------------------------------------------------------------------------------------------------------ */ + +.module p.help, +p.help { + color: #999; +} + +p.preview a { + display: inline-block; + padding: 3px; + line-height: 1px; + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; +} +p.preview a:link, p.preview a:visited { + border: 1px solid #309bbf; +} +p.preview a:hover, p.preview a:active { + border: 1px solid #444; +} + + + +/* Links +------------------------------------------------------------------------------------------------------ */ + +a:link, a:visited { + color: #309bbf; +} +a:hover, a:active, a.selected { + color: #444; +} + +.dashboard h2 a:link, .dashboard h2 a:visited, +.dashboard h3 a:link, .dashboard h3 a:visited { + color: #444; +} +.dashboard h2 a:hover, .dashboard h2 a:active, +.dashboard h3 a:hover, .dashboard h3 a:active { + color: #309bbf; +} + +.dashboard h4 a:link, .dashboard h4 a:visited { + color: #666; +} +.dashboard h4 a:hover, .dashboard h4 a:active { + color: #309bbf; +} + +#header a:link, #header a:visited { + color: #59AFCC; +} +#header a:hover, #header a:active { + color: #444; +} + + + +/* Blockquote, Pre, Code +------------------------------------------------------------------------------------------------------ */ + +blockquote { + color: #777; + border-left: 5px solid #ddd; +} + +code, pre { + color: #666; + background: inherit; +} + +pre.literal-block { + background: #eee; +} + +code strong { + color: #930; +} + +hr { + color: #eee; + border: 0; + background-color: #eee; +} + + + +/* RTE (Rich Text Edited) +------------------------------------------------------------------------------------------------------ */ + +.rte h3 { + border-top: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; +} +.rte .group h3 { + border-top: 0; +} +.rte h3:last-child, +.rte h4:last-child { + border-bottom: 0; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} +.rte td { + border-left: 1px solid #f4f4f4; +} +.rte td:first-of-type { + border-left: 0; +} +.delete-confirmation ul.rte>li { + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; +} +.delete-confirmation ul.rte>li:first-child { + border-top: 0; +} +.delete-confirmation ul.rte>li:last-child { + border-bottom: 0; +} +.delete-confirmation ul.rte>li>ul>li { + border-top: 1px dashed #e0e0e0; +} +.rte blockquote table { + border: 1px solid #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} + + + +/* Other Styles +------------------------------------------------------------------------------------------------------ */ + +.warning { + color: #bf3030; +} +.quiet { + color: #999; +} + + + +/* STRUCTURES +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +body { + color: #444; + background: #fff; +} + + + +/* Header +------------------------------------------------------------------------------------------------------ */ + +#header { + color: #eee; + background: #333; + background: -moz-linear-gradient(top, #444, #333); + background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#333)); + background: -o-linear-gradient(top, #444, #333); +} +#header a:hover, #header a:active { + color: #ddd; +} + + + +/* Branding, Bookmarks & User-Tools +------------------------------------------------------------------------------------------------------ */ + +.branding { + border-left: 1px solid #343434; + background-color: #262626; +} +.admin-title { + border-left: 1px solid #404040; + border-right: 1px solid #303030; +} + + +/* User Tools ................................................... */ + +#user-tools { + border-left: 1px solid #303030; +} +#user-tools>li { + border-left: 1px solid #404040; + border-right: 1px solid #303030; +} +li.user-options-container.open a.user-options-handler { + color: #eee !important; +} +li.user-options-container.open ul.user-options { + border-top: 1px solid #262626; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + background: #333; +} +ul.user-options li { + border-top: 1px solid #404040; + border-bottom: 1px solid #292929; +} +ul.user-options li:last-child { + border-bottom: 0; +} + + +/* Navigation Menu (UL Navigation-Menu of Admin-Tools) ................................................... */ + +ul.navigation-menu>li>a { + border-left: 1px solid #404040; + border-right: 1px solid #303030; +} +ul.navigation-menu>li.bookmark>a { + border-right: 0; +} +ul.navigation-menu li ul { + border-top: 1px solid #2a2a2a; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; + background: #333; +} +ul.navigation-menu li li { + border-top: 1px solid #404040; + border-bottom: 1px solid #2a2a2a; +} + +ul.navigation-menu li li li { + border-top: 1px solid #303030; + border-bottom: 1px solid #303030; + border-bottom: 0; +} +ul.navigation-menu li li li li { + border-top: 1px solid #383838; + border-bottom: 1px solid #383838; + border-bottom: 0; +} +ul.navigation-menu li li li li li { + border-top: 1px solid #404040; + border-bottom: 1px solid #383838; + border-bottom: 0; +} +ul.navigation-menu>li>ul>li.parent { + border-top: 1px solid #404040; + border-bottom: 1px solid #2a2a2a; +} +ul.navigation-menu li ul ul { + border-top: 0; + border-bottom: 0; + background: transparent; +} +ul.navigation-menu li.menu-item.last { + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; +} + +ul.navigation-menu li ul ul>li:first-child a { + border-bottom: 0; +} +ul.navigation-menu li ul ul ul>li:first-child a { + border-bottom: 0; +} +ul.navigation-menu li ul ul ul ul>li:first-child a { + border-bottom: 0; +} +ul.navigation-menu li ul ul ul ul>li:first-child a { + border-bottom: 0; +} +ul.navigation-menu li.collapse.open>a.collapse-handler, +ul.navigation-menu li.bookmark.disabled>a, +ul.navigation-menu li.collapse.open + li.actions { + color: #eee !important; +} +ul.navigation-menu li.bookmark.disabled>a { + cursor: default !important; +} + +form#bookmark-form { + border-right: 1px solid #303030; +} +form#bookmark-form button { +/* border: 1px solid #2e2e2e;*/ +/* border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px;*/ + background-position: 50% 3px; + background-repeat: no-repeat; + background-color: transparent !important; +} +form#bookmark-form button { + background-image: url('../img/icons/icon-bookmark_add.png'); +} +form#bookmark-form button:hover { +/* border: 1px solid #ccc;*/ + background-image: url('../img/icons/icon-bookmark_add-hover.png'); +/* background-color: #e6e6e6 !important;*/ +} +form#bookmark-form button.bookmarked { + background-image: url('../img/icons/icon-bookmark_remove.png'); +} +form#bookmark-form button.bookmarked:hover { + background-image: url('../img/icons/icon-bookmark_remove-hover.png'); +} + + + +/* Breadcrumbs +------------------------------------------------------------------------------------------------------ */ + +div#breadcrumbs { + color: #666; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; + background: #e6e6e6; +} + + + +/* Messages +------------------------------------------------------------------------------------------------------ */ + +ul.messagelist li { + color: #fff; + border-top: 1px solid #949494; + border-bottom: 1px solid #949494; + background-color: #a6a6a6; +} +ul.messagelist li.success { + border-top-color: #72a629; + border-bottom-color: #72a629; + background-color: #83bf30; +} +ul.messagelist li.error, +ul.messagelist li.warning { + border-top-color: #a62929; + border-bottom-color: #a62929; + background-color: #bf3030; +} +ul.messagelist li + li { + border-top: 0; +} + + + +/* Login Form +------------------------------------------------------------------------------------------------------ */ + +.login .module { + border: 0; + border-top-left-radius: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; + border-top-right-radius: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; + background: #333; +} +.login .module .row { + border-top: 1px solid #444; + border-bottom: 1px solid #222; +} +.login .module .row:after { + clear: both; + content: " "; + display: block; + font-size: 0; + height: 0; + visibility: hidden; +} +.login .module label { + color: #eee; +} + + + +/* COMPONENTS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + + + +/* Modules +------------------------------------------------------------------------------------------------------ */ + +.module { + border: 1px solid #bdbdbd; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #eee; +} +.rte .module { + background: transparent; +} + + +/* Nested Modules Basics ......................................... */ + +.module .module, +.module fielset.module { + border: 0; + border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; +} +.module .module:first-child { + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} + + + +/* Groups +------------------------------------------------------------------------------------------------------ */ + +.group { + border-radius: 7px; -moz-border-radius: 7px; -webkit-border-radius: 7px; +} + +.group.collapse.closed { + border: 2px solid #e0e0e0; +} +.group, +.group.collapse.closed:hover { + border: 2px solid #c7c7c7; +} + + + +/* Elements in Modules & Groups +------------------------------------------------------------------------------------------------------ */ + + +/* 1st Level Borders Top (Dark/Bright) ......................................... */ + +.group h2, +.module h2 { + border-bottom: 1px solid #bdbdbd; + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + background: #d6d6d6; + background: -moz-linear-gradient(top, #e3e3e3, #d6d6d6); + background: -webkit-gradient(linear, left top, left bottom, from(#e3e3e3), to(#d6d6d6)); + background: -o-linear-gradient(top, #e3e3e3, #d6d6d6); +} +.group h2 { + border: 1px solid #bdbdbd; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.module h2+*, +.module h2+.tools+* { + border-top: 1px solid #fff; +} +.module h2+.module, +.module h2+.tools, +.module h2+.tools+.module { + border-top: 0 !important; +} + + +/* 2nd Level Borders Top (Dark/Bright) ......................................... */ + +.module .module { + border-top: 1px solid #c7c7c7; +} +.module .module>*:first-child { + border-top: 1px solid #eee; +} +#changelist .span-flexible .module .module:first-child { + border-top: 0; +} + +.group h3, +.module h3 { + border-bottom: 1px solid #c7c7c7; + background: #e0e0e0; + background: -moz-linear-gradient(top, #e9e9e9, #e0e0e0); + background: -webkit-gradient(linear, left top, left bottom, from(#e9e9e9), to(#e0e0e0)); + background: -o-linear-gradient(top, #e9e9e9, #e0e0e0); +} +.group h3 { + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} +.module h3+*, +.module h3+.tools+* { + border-top: 1px solid #fff; +} +.module h3+.module, +.module h3+.tools, +.module h3+.tools+.module { + border-top: 0 !important; +} + + +/* 3rd Level Borders Top (Dark/Bright) ......................................... */ + +.group .module .module, +.module .module .module { + border-top: 1px solid #d4d4d4; +} +.group .module .module>*:first-child, +.module .module .module>*:first-child { + border-top: 1px solid #f4f4f4; +} + +.group h4, +.module h4 { + border-bottom: 1px solid #d4d4d4; + background: #e8e8e8; + background: -moz-linear-gradient(top, #ededed, #e8e8e8); + background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#e8e8e8)); + background: -o-linear-gradient(top, #ededed, #e8e8e8); +} +.module h4+*, +.module h4+.tools+* { + border-top: 1px solid #fff; +} +.module h4+.tools { + border-top: 0 !important; +} +.module .description { + border-bottom: 1px solid #d4d4d4; +} +.module .row.description, +.module.table .description { + border-bottom: 0; +} + + + +/* Modules & Groups Overrides +------------------------------------------------------------------------------------------------------ */ + +.module .module:last-of-type { + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} + + + +/* Collapsible Structures +------------------------------------------------------------------------------------------------------ */ + +.group .module.collapse.closed h3.collapse-handler, +.group .module.collapse.closed h4.collapse-handler, +.collapse.closed h2.collapse-handler, +.module .module.collapse.closed.last .collapse-handler, +.module .module.collapse.closed:last-child .collapse-handler { + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} +.module.collapse.closed h2.collapse-handler, +.module.collapse.closed h3.collapse-handler, +.module.collapse.closed h4.collapse-handler { + border-bottom: 0; +} + + +/* 1st Level Collapsible-Handler ......................................... */ + +.collapse h2.collapse-handler { + background: #a1d4e5; + background: -moz-linear-gradient(top, #bcdfeb, #a1d4e5); + background: -webkit-gradient(linear, left top, left bottom, from(#bcdfeb), to(#a1d4e5)); + background: -o-linear-gradient(top, #bcdfeb, #a1d4e5); +} +.collapse h2.collapse-handler:hover, +.collapse.open h2.collapse-handler { + background: #bcdfeb; + background: -moz-linear-gradient(top, #a1d4e5, #bcdfeb); + background: -webkit-gradient(linear, left top, left bottom, from(#a1d4e5), to(#bcdfeb)); + background: -o-linear-gradient(top, #a1d4e5, #bcdfeb); +} + + +/* 2nd Level Collapsible-Handler ......................................... */ + +.group .collapse h3.collapse-handler, +.module .collapse h3.collapse-handler { + background: #cee9f2; + background: -moz-linear-gradient(top, #e1f0f5, #cee9f2); + background: -webkit-gradient(linear, left top, left bottom, from(#e1f0f5), to(#cee9f2)); + background: -o-linear-gradient(top, #e1f0f5, #cee9f2); +} +.group .collapse h3.collapse-handler:hover, +.module .collapse h3.collapse-handler:hover, +.group .collapse.open h3.collapse-handler, +.module .collapse.open h3.collapse-handler { + background: #e1f0f5; + background: -moz-linear-gradient(top, #cee9f2, #e1f0f5); + background: -webkit-gradient(linear, left top, left bottom, from(#cee9f2), to(#e1f0f5)); + background: -o-linear-gradient(top, #cee9f2, #e1f0f5); +} +.module .collapse h3.collapse-handler { + border-top: 1px solid #e1f0f5; +} + + +/* 3rd Level Collapsible-Handler ......................................... */ + +.group .module .collapse > h4.collapse-handler, +.module .module .collapse > h4.collapse-handler { + border-top: 1px solid #f0f7fa; + background: #e1f0f5; + background: -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background: -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background: -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +.group .collapse > h4.collapse-handler:hover, +.module .collapse > h4.collapse-handler:hover, +.group .collapse.open > h4.collapse-handler, +.module .collapse.open > h4.collapse-handler { + background: #ebf2f5; + background: -moz-linear-gradient(top, #e1f0f5, #ebf2f5); + background: -webkit-gradient(linear, left top, left bottom, from(#e1f0f5), to(#ebf2f5)); + background: -o-linear-gradient(top, #e1f0f5, #ebf2f5); +} + + + +/* Row +------------------------------------------------------------------------------------------------------ */ + +.row { + margin: 0; + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; + border-left: 0; + border-right: 0; +} +.row.first, +.row:first-child, +.module input[type=hidden] + .row { + border-top: 0 !important; + border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; +} +.row.last, +.row:last-child, +.row:last-of-type, +fieldset.module > .row.last, +fieldset.module > .row:last-child { + border-bottom: 0 !important; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; +} + + + +/* Cell +------------------------------------------------------------------------------------------------------ */ + +.cell { + border-right: 1px solid #e0e0e0; + border-left: 1px solid #fff; +} + + + +/* Fieldset Cell +------------------------------------------------------------------------------------------------------ */ + +fieldset.module .cell:first-child { + border-left: 0 !important; +} +fieldset.module .cell:last-child, +fieldset.module .cell.last { + border-right: 0 !important; +} +fieldset.module .cell.last + fieldset.module .cell { + border-left: 0 !important; +} + + + +/* Tabular Modules +------------------------------------------------------------------------------------------------------ */ + +.module.table { + border: 0; + border-collapse: separate; + border-spacing: 0 2px; + background: transparent; +} +.module.thead, +.module.tfoot { + color: #aaa; + background: transparent; +} +.module.table .tr, +.module.tbody { + background: transparent; +} +.module.table .th, +.module.table .td { + border-left: 1px solid #fff; + border-right: 1px solid #e0e0e0; +} +.module.thead .th:last-of-type, +.module.thead .td:last-of-type, +.module.tfoot .td:last-of-type { + border-right: 0; +} +.module.table .module.thead .th, +.module.table .module.thead .td { + border-top: 0; + border-bottom: 0; + background: none; +} +.module.tbody .th, +.module.tbody .td { + border-top: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; + background: #eee; +} +.module.tbody .th:first-of-type, +.module.tbody .td:first-of-type { + border-left: 1px solid #ccc; + border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; + border-top-right-radius: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; +} +.module.tbody .th:last-of-type, +.module.tbody .td:last-of-type { + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; +} + + + +/* Add Items +------------------------------------------------------------------------------------------------------ */ + +.module.add-item { + border: 1px solid transparent; + background: #fff; +} + + + +/* Predelete +------------------------------------------------------------------------------------------------------ */ + +.predelete h2, .collapse.predelete > h2.collapse-handler, +.predelete h3, .collapse.predelete > h3.collapse-handler, +.predelete h4, .collapse.predelete .collapse > h4.collapse-handler { + background: #f2e6e6; + background: -moz-linear-gradient(top, #fff2f2, #f2e6e6); + background: -webkit-gradient(linear, left top, left bottom, from(#fff2f2), to(#f2e6e6)); + background: -o-linear-gradient(top, #fff2f2, #f2e6e6); +} +.collapse.predelete > h2.collapse-handler:hover, +.collapse.predelete > h3.collapse-handler:hover, +.predelete .collapse > h4.collapse-handler:hover, +.collapse.open.predelete > h2.collapse-handler, +.collapse.open.predelete > h3.collapse-handler, +.predelete .collapse.open > h4.collapse-handler { + background: #f2e6e6 !important; + background: -moz-linear-gradient(top, #f2e6e6, #fff2f2) !important; + background: -webkit-gradient(linear, left top, left bottom, from(#f2e6e6), to(#fff2f2)) !important; + background: -o-linear-gradient(top, #f2e6e6, #fff2f2) !important; +} +.predelete, +.predelete .module, +.predelete .th, +.predelete .td { + background: #f2e6e6 !important; +} + + + +/* Selectors +------------------------------------------------------------------------------------------------------ */ + +.selector-available, .selector-chosen { + border: 1px solid #ccc; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #ddd; +} +.selector h2, .inline-group .selector h2, +.inline-related fieldset .selector-available h2, .inline-related fieldset .selector-chosen h2 { + border: 0; + border-bottom: 1px solid #d0d0d0; + background: transparent; +} +.selector .selector-filter { + color: #666; + border-top: 1px solid #e4e4e4; + border-bottom: 1px solid #e4e4e4; + border-top-left-radius: 5px;-moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; +} +.selector h2 + .selector-filter { + border-radius-topleft: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; + border-radius-topright: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; +} +.selector select[multiple=multiple] { + border-left: 0; + border-top: 1px solid #d0d0d0; + border-bottom: 1px solid #d0d0d0; + border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; +} + +a.selector-chooseall, a.selector-clearall { + border-top: 1px solid #e4e4e4; +} + +.selector h2 + select { + border-top: 0; +} + +a.selector-chooseall, a.selector-clearall { + border-top: 1px solid #e4e4e4; +} + + + +/* Link-List, Actions, Feed, Table of Contents +------------------------------------------------------------------------------------------------------ */ + +.module.link-list, +.module.link-list .module, +.module.actions, +.module.actions .module, +.module.feed, +.module.feed .module { + background: #fff; +} +.link-list ul li, +.feed ul li, +.actions ul li, +.table-of-contents ul li { + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; +} +.actions ul li { + color: #999; +} +.actions ul li:first-child, +.link-list ul li:first-child, +.feed ul li:first-child, +.table-of-contents ul li:first-child { + border-top: 0; +} +.actions ul li:last-child, +.link-list ul li:last-child, +.feed ul li:last-child, +.table-of-contents ul li:last-child { + border-bottom: 0; +} +.link-list ul li.selected a, +.table-of-contents ul li.selected a { + color: #444; +} +a.internal:link, a.internal:visited {} +a.internal:hover, a.internal:active, +.actions li.delete-link { + color: #666; +} +a.external:link, a.external:visited { + color: #83c3d9; +} +a.external:hover, a.external:active { + color: #666; +} + + + +/* Module Changelist Filters +------------------------------------------------------------------------------------------------------ */ + +.module.changelist-filters { + color: #666; + border: 1px solid #d4d4d4; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; +} +.module.changelist-filters:last-of-type, +body.filebrowser .module.changelist-filters { + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; +} + + + +/* Module Search & Module Filter +------------------------------------------------------------------------------------------------------ */ + +.module.search, +.module.filter { + border: 0; + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; +} +.module.filter .pulldown-container { + border: 1px solid #fff; + border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; +} +.module.filter.open .pulldown-container { + border-color: #ccc; + box-shadow: 0 0 10px #444; -moz-box-shadow: 0 0 10px #444; -webkit-box-shadow: 0 0 10px #444; +} + +.open a.button.toggle-filters, +.open.selected a.button.toggle-filters { + border-color: transparent !important; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0 !important; -webkit-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0 !important; -webkit-border-bottom-right-radius: 0; +} +a.button.toggle-filters:link, a.button.toggle-filters:visited { + color: #309bbf; + border-color: #ddd; +} +.selected a.button.toggle-filters:link, .selected a.button.toggle-filters:visited { + color: #444; + background-color: #e1f0f5; + background: #e1f0f5 url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -moz-linear-gradient(top, #eee, #e0e0e0); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -webkit-gradient(linear, left top, left bottom, from(#eee), to(#e0e0e0)); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -o-linear-gradient(top, #eee, #e0e0e0); +} +.open a.button.toggle-filters, .selected a.button.toggle-filters, +.selected a.button.toggle-filters:hover, .selected a.button.toggle-filters:active, +a.button.toggle-filters:hover, a.button.toggle-filters:active { + color: #666; + border-color: #ccc; + background-color: #e1f0f5; + background: #e1f0f5 url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -moz-linear-gradient(top, #f0f7fa, #e1f0f5); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -webkit-gradient(linear, left top, left bottom, from(#f0f7fa), to(#e1f0f5)); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -o-linear-gradient(top, #f0f7fa, #e1f0f5); +} +.selected a.button.toggle-filters:link, .selected a.button.toggle-filters:visited { + color: #666; + border-color: #ddd; + background-color: #e1f0f5; + background: #e1f0f5 url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -moz-linear-gradient(top, #f0f7fa, #e1f0f5); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -webkit-gradient(linear, left top, left bottom, from(#f0f7fa), to(#e1f0f5)); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -o-linear-gradient(top, #f0f7fa, #e1f0f5); +} +.open a.button.toggle-filters, +.open.selected a.button.toggle-filters, +.selected a.button.toggle-filters:hover, .selected a.button.toggle-filters:active, +a.button.toggle-filters:hover, a.button.toggle-filters:active { + color: #666; + border-color: #ccc; + background-color: #e1f0f5; + background: #e1f0f5 url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat; + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -moz-linear-gradient(top, #f0f7fa, #e1f0f5); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -webkit-gradient(linear, left top, left bottom, from(#f0f7fa), to(#e1f0f5)); + background: url('../img/icons/icon-dropdown-hover.png') 100% 3px no-repeat, -o-linear-gradient(top, #f0f7fa, #e1f0f5); +} + +.filter-pulldown { + border: 1px solid transparent; + border-top: 0; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + background: #e1f0f5; +} +.filter-pulldown label { + color: #999; +} + + + +/* Module Date Hierarchy +------------------------------------------------------------------------------------------------------ */ + +.module.date-hierarchy { + border: 1px solid #d9d9d9; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + background: #eee; + background: -moz-linear-gradient(top, #eee, #e7e7e7); + background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#e7e7e7)); + background: -o-linear-gradient(top, #eee, #e7e7e7); +} +.module + .module.date-hierarchy { + border-top-left-radius: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; + border-top-right-radius: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; +} +.module + .module.date-hierarchy .row { + border-top: 1px solid #fff !important; + border-top-left-radius: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; + border-top-right-radius: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; +} +.date-hierarchy a:link, .date-hierarchy a:visited { + color: #59afcc; +} +.date-hierarchy a:hover, .date-hierarchy a:active { + color: #444; +} +.date-hierarchy a.date-hierarchy-back:hover, .date-hierarchy a.date-hierarchy-back:active { + color: #666; +} + + + +/* Pagination +------------------------------------------------------------------------------------------------------ */ + +.module.pagination { + border: 1px solid #d9d9d9; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; +} +.module .module.pagination { + border: 0; +} +ul.pagination { + border-top: 0 !important; +} +ul.pagination li { + border: 1px solid #fff; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} + +ul.pagination span, +ul.pagination a { + border: 1px solid; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +ul.pagination a:link, .pagination a:visited { + color: #59afcc; + border-color: #d9d9d9; +} +ul.pagination a:hover, .pagination a:active { + color: #444; + border-color: #bdbdbd; + background: #e0e0e0; + background: -moz-linear-gradient(top, #eee, #e0e0e0); + background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#e0e0e0)); + background: -o-linear-gradient(top, #eee, #e0e0e0); +} +ul.pagination span { + color: #444; + border-color: #bdbdbd; + background: #e0e0e0; + background: -moz-linear-gradient(top, #eee, #e0e0e0); + background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#e0e0e0)); + background: -o-linear-gradient(top, #eee, #e0e0e0); +} +ul.pagination li.separator span { + border-color: transparent; + background: transparent; +} + + + +/* Module Changelist-Results +------------------------------------------------------------------------------------------------------ */ + +.module.changelist-results { + border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; + background-color: #eee !important; +} + + + +/* Module Changelist Actions +------------------------------------------------------------------------------------------------------ */ + +.changelist-actions { + color: #ccc; +} +.changelist-actions.all-selected, +.changelist-actions.all-selected + .changelist-results { + background: #ffffe6 !important; +} +.changelist-actions ul li { + border: 1px solid #444; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.changelist-actions ul a, +.changelist-actions ul span { + border: 1px solid; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.changelist-actions ul a:link, .changelist-actions ul a:visited { + color: #59afcc; + border-color: #333; + background: #333; + background: -moz-linear-gradient(top, #444, #333); + background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#333)); + background: -o-linear-gradient(top, #444, #333); +} +.changelist-actions ul a:hover, .changelist-actions ul a:active { + color: #ccc; + border-color: #333; + background: #555; + background: -moz-linear-gradient(top, #666, #555); + background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#555)); + background: -o-linear-gradient(top, #666, #555); +} +.changelist-actions ul span { + color: #ccc; + border-color: #333; +} +.changelist-actions ul span span { + border: 0; +} + + + +/* Module Footer +------------------------------------------------------------------------------------------------------ */ + +.module.footer { + border: 0; + border-top: 1px solid #bdbdbd; + border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; + background: #333; + background: -moz-linear-gradient(top, #444, #333); + background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#333)); + background: -o-linear-gradient(top, #444, #333); +} + + + +/* Submit Row +------------------------------------------------------------------------------------------------------ */ + +.module.submit-row { + border: 0; + background: transparent; +} + + + +/* Tooltips +------------------------------------------------------------------------------------------------------ */ + +.module.search .tooltip .tooltip-content { + border: 1px solid #ccc; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #fff; + box-shadow: 0 10px 50px #333; -moz-box-shadow: 0 10px 50px #333; -webkit-box-shadow: 0 10px 50px #333; +} + + + +/* TOOLS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +ul.tools > li { + border-top: 0 !important; + border-bottom: 0 !important; +} + + + +/* H1 + Tools +------------------------------------------------------------------------------------------------------ */ + +h1 + .tools a { + color: #fff; + border-radius: 15px; -moz-border-radius: 15px; -webkit-border-radius: 15px; +} +h1 + .tools a:link, h1 + .tools a:visited { + background: #444; + background: -moz-linear-gradient(top, #666, #444); + background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#444)); + background: -o-linear-gradient(top, #666, #444); +} +h1 + .tools a:hover, h1 + .tools a:active { + border-color: transparent; + background: #309bbf; + background: -moz-linear-gradient(top, #39bae5, #309bbf); + background: -webkit-gradient(linear, left top, left bottom, from(#39bae5), to(#309bbf)); + background: -o-linear-gradient(top, #39bae5, #309bbf); +} + +.tools-active { + border-color: transparent !important; + background: #309bbf !important; + background: -moz-linear-gradient(top, #39bae5, #309bbf) !important; + background: -webkit-gradient(linear, left top, left bottom, from(#39bae5), to(#309bbf)) !important; + background: -o-linear-gradient(top, #39bae5, #309bbf) !important; +} + +h1 + .tools a.add-handler:link, h1 + .tools a.add-handler:visited { + background-color: #444; + background: #444 0 50% no-repeat scroll; + background-image: url('../img/icons/icon-object-tools-add-handler.png'), -moz-linear-gradient(top, #666, #444); + background-image: url('../img/icons/icon-object-tools-add-handler.png'), -webkit-gradient(linear, left top, left bottom, from(#666), to(#444)); + background-image: url('../img/icons/icon-object-tools-add-handler.png'), -o-linear-gradient(top, #666, #444); +} +h1 + .tools a.add-handler:hover, h1 + .tools a.add-handler:active { + background-color: #309bbf; + background: #309bbf 0 50% no-repeat scroll; + background-image: url('../img/icons/icon-object-tools-add-handler.png'), -moz-linear-gradient(top, #39bae5, #309bbf); + background-image: url('../img/icons/icon-object-tools-add-handler.png'), -webkit-gradient(linear, left top, left bottom, from(#39bae5), to(#309bbf)); + background-image: url('../img/icons/icon-object-tools-add-handler.png'), -o-linear-gradient(top, #39bae5, #309bbf); +} + + +/* 1st Level H2 + Tools ......................................... */ + +.group h2+.tools, +.module h2+.tools { + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} + +.module h2+.tools li { + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} +.group h2+.tools, +.module.collapse.closed h2+.tools { + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} + + +/* 2nd Level H3 + Tools ......................................... */ + +.group .module.collapse.closed h3+.tools, +.group .module.collapse.closed h3+.tools li, +.module.collapse.closed:last-child h3+.tools, +.module.collapse.closed:last-child h3+.tools li { + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} +.group h3+.tools, +.group h3+.tools li { + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} + + +/* 3rd Level H4 + Tools ......................................... */ + +.module.collapse.closed:last-child h4+.tools, +.module.collapse.closed:last-child h4+.tools li { + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} + + + +/* FORMS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + + + +/* Errors +------------------------------------------------------------------------------------------------------ */ + +.errornote { + color: #f7f7f7; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #bf3030; +} +/* little fix to accomodate the top aligned login form .. */ +.login .errornote, +.errornote.login-errors { + margin-bottom: 0 !important; + padding: 8px 10px 6px !important; + border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; +} +ul.errorlist { + color: #bf3030; +} +.error input, .error select, .errors input, .errors select, .errors textarea { + border: 1px solid #bf3030 !important; +} +.login ul.errorlist { + color: #d93636; +} + + + +/* Labels & Other Typographic Elements in Forms +------------------------------------------------------------------------------------------------------ */ + +label { + color: #444; +} + + + +/* Form Elements +------------------------------------------------------------------------------------------------------ */ + +input, textarea, select, button { + color: #666; + border: 1px solid #ccc; +/* border-color: #ccc #ddd #ddd #ccc;*/ + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; + outline: 0; +} +input, textarea, select { + box-shadow: 0 1px 3px #eaeaea inset; -moz-box-shadow: 0 1px 3px #eaeaea inset; -webkit-box-shadow: 0 1px 3px #eaeaea inset; + background-color: #fff; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + input[type=file] { + background-color: transparent; + } +} + +*:focus, input:focus, textarea:focus, select:focus { + border-color: #999; +} +select:focus * { + border: 0 !important; + outline: 0 !important; +} + + +/* Searchbar ................................................... */ + +form#changelist-search { + border: 1px solid #fff; + border-radius: 15px; -moz-border-radius: 15px; -webkit-border-radius: 15px; +} +input#searchbar { + border-radius: 14px; -moz-border-radius: 14px; -webkit-border-radius: 14px; +} + + +/* Select ................................................... */ + +option, +select[multiple=multiple] option { + border-bottom: 1px dotted #ddd !important; +} +option:last-child { + border-bottom: 0; +} + + +/* Autocomplete Fields ................................................... */ + +.vAutocompleteSearchField, +.vM2MAutocompleteSearchField { + background: #eaf5f8; +} + + +/* Read Only ................................................... */ + +input[readonly], +textarea[readonly], +select[readonly] { + background: #f4f4f4; +} + + + +/* BUTTONS +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +input[type=submit], input[type=reset], input[type=button], button { + color: #fff; + border: 0; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #acd7e5; +} + + +/* Button Containers ................................................... */ + +.submit-row>*[class*="-container"] { + border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; + box-shadow: 0 0 5px #666; -moz-box-shadow: 0 0 5px #666; -webkit-box-shadow: 0 0 5px #666; + background: #d6d6d6; +} +.submit-row>*[class*="-container"]:hover { + box-shadow: 0 0 5px #777; -moz-box-shadow: 0 0 5px #777; -webkit-box-shadow: 0 0 5px #777; + background: #d6d6d6; +} +.submit-row>*[class*="cancel-button-container"] { + box-shadow: 0 0 5px #aaa; -moz-box-shadow: 0 0 5px #aaa; -webkit-box-shadow: 0 0 5px #aaa; +} +.footer .submit-row>*[class*="-container"], +.footer .submit-row>*[class*="cancel-button-container"] { + border: 1px solid #666; + box-shadow: 0 0 5px #666; -moz-box-shadow: 0 0 5px #666; -webkit-box-shadow: 0 0 5px #666; + background: #666; +} +.submit-row>*[class*="cancel-button-container"] { + box-shadow: 0 0 5px #aaa; -moz-box-shadow: 0 0 5px #aaa; -webkit-box-shadow: 0 0 5px #aaa; +} +.footer .submit-row>*[class*="-container"]:hover, +.footer .submit-row>*[class*="cancel-button-container"]:hover { + border: 1px solid #777; + box-shadow: 0 0 5px #777; -moz-box-shadow: 0 0 5px #777; -webkit-box-shadow: 0 0 5px #777; + background: #777; +} + + +/* Buttons & Buttonlike Links +------------------------------------------------------------------------------------------------------ */ + +.submit-row a.submit-link, +.submit-row a.delete-link, +.submit-row a.cancel-link { + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.submit-row a.submit-link, +.submit-row input[type=submit] { + border: 1px solid #267c99; +} + +input[type=submit], +#bookmark-add-cancel, +.submit-row a.delete-link:link, .submit-row a.delete-link:visited, +.submit-row a.cancel-link:link, .submit-row a.cancel-link:visited, +.submit-row input[type=button] { + box-shadow: none !important; -moz-box-shadow: none !important; -webkit-box-shadow: none !important; +} + +.submit-row a.delete-link:link, .submit-row a.delete-link:visited { + color: #fff; + border: 1px solid #992626; + background: #bf3030; + background: -moz-linear-gradient(top, #d93636, #bf3030); + background: -webkit-gradient(linear, left top, left bottom, from(#d93636), to(#bf3030)); + background: -o-linear-gradient(top, #d93636, #bf3030); +} +#bookmark-add-cancel, +.submit-row a.cancel-link:link, .submit-row a.cancel-link:visited, +.submit-row input.cancel:hover { + color: #fff; + border: 1px solid #444; + background: #666; + background: -moz-linear-gradient(top, #666, #444); + background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#444)); + background: -o-linear-gradient(top, #666, #444); +} + +input[type=submit], +.submit-row a.submit-link:link, .submit-row a.submit-link:visited { + color: #fff; + background: #309bbf; + background: -moz-linear-gradient(top, #39bae5, #309bbf); + background: -webkit-gradient(linear, left top, left bottom, from(#39bae5), to(#309bbf)); + background: -o-linear-gradient(top, #39bae5, #309bbf); +} +input[type=submit]:hover, +#bookmark-add-cancel:hover, +.submit-row a.submit-link:hover, .submit-row a.submit-link:active, +.submit-row a.delete-link:hover, .submit-row a.delete-link:active, +.submit-row a.cancel-link:hover, .submit-row a.cancel-link:active, +.submit-row input.cancel { + color: #444; + border: 1px solid #aaa; + background: #d6d6d6; + background: -moz-linear-gradient(top, #e3e3e3, #d6d6d6); + background: -webkit-gradient(linear, left top, left bottom, from(#e3e3e3), to(#d6d6d6)); + background: -o-linear-gradient(top, #e3e3e3, #d6d6d6); +} +.footer input[type=submit]:hover, +.footer #bookmark-add-cancel:hover, +.footer .submit-row a.delete-link:hover, .footer .submit-row a.delete-link:active, +.footer .submit-row a.cancel-link:hover, .footer .submit-row a.cancel-link:active { + border: 1px solid #666; +} + +button.fb_show, +button.ui-datepicker-trigger, +button.ui-timepicker-trigger, +button.ui-gAutocomplete-browse, +button.ui-gAutoSlugField-toggle, +button.ui-gFacelist-browse, +a.button, +.vDateField + span a, +.vTimeField + span a, +a.fb_show, +a.related-lookup, +a.add-another, +.tinyMCE .browse span { + border-top-left-radius: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} + +button { + background: #309bbf; + background-image: -moz-linear-gradient(top, #33a6cc, #309bbf); + background-image: -webkit-gradient(linear, left top, left bottom, from(#33a6cc), to(#309bbf)); + background-image: -o-linear-gradient(top, #33a6cc, #309bbf); +} +button:hover { + background: #666; + background-image: -moz-linear-gradient(top, #555, #444); + background-image: -webkit-gradient(linear, left top, left bottom, from(#555), to(#444)); + background-image: -o-linear-gradient(top, #555, #444); +} + +button.fb_show, +button.ui-gAutocomplete-browse, +button.ui-gFacelist-browse, +button.ui-gAutoSlugField-toggle, +button.ui-datepicker-trigger, +button.ui-timepicker-trigger, +.tinyMCE .browse span { + border: 1px solid #ccc; + background-color: #e1f0f5; +} +button.fb_show:hover, +button.ui-gAutocomplete-browse:hover, +button.ui-gFacelist-browse:hover, +button.ui-gAutoSlugField-toggle:hover, +button.ui-datepicker-trigger:hover, +button.ui-timepicker-trigger:hover, +.tinyMCE .browse span:hover { + background-color: #e1e1e1; +} +button.fb_show[disabled], +button.ui-gAutocomplete-browse[disabled], +button.ui-gFacelist-browse[disabled], +button.ui-gAutoSlugField-toggle[disabled], +button.ui-datepicker-trigger[disabled], +button.ui-timepicker-trigger[disabled], +input[disabled] + a { + background-color: transparent !important; + opacity: 0.3; + cursor: auto !important; +} + + +/* Autocomplete Button ......................................... */ + +button.ui-gAutocomplete-browse, +button.ui-gFacelist-browse { + background-image: url('../img/icons/icon-related-lookup.png'), -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background-image: url('../img/icons/icon-related-lookup.png'), -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background-image: url('../img/icons/icon-related-lookup.png'), -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +button.ui-gAutocomplete-browse:hover, +button.ui-gFacelist-browse:hover { + background-image: url('../img/icons/icon-related-lookup-hover.png'), -moz-linear-gradient(top, #e1e1e1, #eee); + background-image: url('../img/icons/icon-related-lookup-hover.png'), -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#eee)); + background-image: url('../img/icons/icon-related-lookup-hover.png'), -o-linear-gradient(top, #e1e1e1, #eee); +} + +.errors button.ui-gAutocomplete-browse, +.errors button.ui-gFacelist-browse { + border-color: #bf3030 #bf3030 #bf3030 #ccc; +} + + +/* AutoSlugField Button ......................................... */ + +/* TODO: lock/unlock icons .. */ + +button.ui-gAutoSlugField-toggle { + background-image: url('../img/icons/icon-related-lookup.png'), -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background-image: url('../img/icons/icon-related-lookup.png'), -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background-image: url('../img/icons/icon-related-lookup.png'), -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +button.ui-gAutoSlugField-toggle:hover { + background-image: url('../img/icons/icon-related-lookup-hover.png'), -moz-linear-gradient(top, #e1e1e1, #eee); + background-image: url('../img/icons/icon-related-lookup-hover.png'), -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#eee)); + background-image: url('../img/icons/icon-related-lookup-hover.png'), -o-linear-gradient(top, #e1e1e1, #eee); +} +.errors button.ui-gAutoSlugField-toggle { + border-color: #bf3030 #bf3030 #bf3030 #ccc; +} + + +/* Datepicker Button ......................................... */ + +button.ui-datepicker-trigger { + background-image: url('../img/icons/icon-datepicker.png'), -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background-image: url('../img/icons/icon-datepicker.png'), -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background-image: url('../img/icons/icon-datepicker.png'), -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +button.ui-datepicker-trigger:hover { + background-image: url('../img/icons/icon-datepicker-hover.png'), -moz-linear-gradient(top, #e1e1e1, #eee); + background-image: url('../img/icons/icon-datepicker-hover.png'), -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#eee)); + background-image: url('../img/icons/icon-datepicker-hover.png'), -o-linear-gradient(top, #e1e1e1, #eee); +} + + +/* Timepicker Button ......................................... */ + +button.ui-timepicker-trigger { + background-image: url('../img/icons/icon-timepicker.png'), -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background-image: url('../img/icons/icon-timepicker.png'), -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background-image: url('../img/icons/icon-timepicker.png'), -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +button.ui-timepicker-trigger:hover { + background-image: url('../img/icons/icon-timepicker-hover.png'), -moz-linear-gradient(top, #e1e1e1, #eee); + background-image: url('../img/icons/icon-timepicker-hover.png'), -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#eee)); + background-image: url('../img/icons/icon-timepicker-hover.png'), -o-linear-gradient(top, #e1e1e1, #eee); +} + + +/* Search Button ......................................... */ + +button.search { + border-color: transparent !important; + background-color: transparent; +} + + + +/* Links as Buttons +------------------------------------------------------------------------------------------------------ */ + +a.button, +.datecrumbs a, +.datecrumbs span { + border: 1px solid #e0e0e0; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} + + +/* Drop-Down Button ......................................... */ + +a.button.drop-down[class*="selected"] { + color: #444 !important; + border-color: #b0b0b0; + border-bottom-width: 0 !important; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0 !important; -webkit-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0 !important; -webkit-border-bottom-right-radius: 0; + box-shadow: 0 -2px 3px #bbb, -2px -2px 3px #bbb, 2px -2px 3px #bbb; + -moz-box-shadow: 0 -2px 3px #bbb, -2px -2px 3px #bbb, 2px -2px 3px #bbb; + -webkit-box-shadow: 0 -2px 3px #bbb, -2px -2px 3px #bbb, 2px -2px 3px #bbb; +} +a.button.drop-down:link, a.button.drop-down:visited { + color: #309bbf; + background-color: #fff; +} +a.button.drop-down[class*="selected"], +a.button.drop-down:hover, a.button.drop-down:active { + color: #666; + background-color: #e1f0f5; + background: #e1f0f5 url('../img/icons/icon-dropdown-hover.png') 3px 3px no-repeat; + background: url('../img/icons/icon-dropdown-hover.png') 3px 3px no-repeat, -moz-linear-gradient(top, #f0f7fa, #e1f0f5) !important; + background: url('../img/icons/icon-dropdown-hover.png') 3px 3px no-repeat, -webkit-gradient(linear, left top, left bottom, from(#f0f7fa), to(#e1f0f5)); + background: url('../img/icons/icon-dropdown-hover.png') 3px 3px no-repeat, -o-linear-gradient(top, #f0f7fa, #e1f0f5) !important; +} + + +/* Filebrowser & Related Lookup ......................................... */ + +a.fb_show, +a.related-lookup { + border: 1px solid #ccc; +} +a.fb_show:link, a.fb_show:visited, +a.related-lookup:link, a.related-lookup:visited { + background-color: #e1f0f5; +} +a.fb_show:hover, a.fb_show:active, +a.related-lookup:hover, a.related-lookup:active { + background-color: #e1e1e1; +} + +a.fb_show:link, a.fb_show:visited, +.tinyMCE .browse span { + background-image: url('../img/icons/icon-fb-show.png'), -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background-image: url('../img/icons/icon-fb-show.png'), -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background-image: url('../img/icons/icon-fb-show.png'), -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +a.fb_show:hover, a.fb_show:active, +.tinyMCE .browse span:hover { + background-image: url('../img/icons/icon-fb-show-hover.png'), -moz-linear-gradient(top, #e1e1e1, #eee); + background-image: url('../img/icons/icon-fb-show-hover.png'), -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#eee)); + background-image: url('../img/icons/icon-fb-show-hover.png'), -o-linear-gradient(top, #e1e1e1, #eee); +} +a.related-lookup:link, a.related-lookup:visited { + background-image: url('../img/icons/icon-related-lookup.png'), -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background-image: url('../img/icons/icon-related-lookup.png'), -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background-image: url('../img/icons/icon-related-lookup.png'), -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +a.related-lookup:hover, a.related-lookup:active { + background-image: url('../img/icons/icon-related-lookup-hover.png'), -moz-linear-gradient(top, #e1e1e1, #eee); + background-image: url('../img/icons/icon-related-lookup-hover.png'), -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#eee)); + background-image: url('../img/icons/icon-related-lookup-hover.png'), -o-linear-gradient(top, #e1e1e1, #eee); +} + + +/* Related Lookup M2M ......................................... */ + +a.related-lookup.m2m:link, a.related-lookup.m2m:visited, +div.autocomplete-wrapper-m2m a.related-lookup:link, div.autocomplete-wrapper-m2m a.related-lookup:visited { + background-image: url('../img/icons/icon-related-lookup-m2m.png'), -moz-linear-gradient(top, #ebf2f5, #e1f0f5); + background-image: url('../img/icons/icon-related-lookup-m2m.png'), -webkit-gradient(linear, left top, left bottom, from(#ebf2f5), to(#e1f0f5)); + background-image: url('../img/icons/icon-related-lookup-m2m.png'), -o-linear-gradient(top, #ebf2f5, #e1f0f5); +} +a.related-lookup.m2m:hover, a.related-lookup.m2m:active, +div.autocomplete-wrapper-m2m a.related-lookup:hover, div.autocomplete-wrapper-m2m a.related-lookup:active { + background-image: url('../img/icons/icon-related-lookup-m2m-hover.png'), -moz-linear-gradient(top, #e1e1e1, #eee); + background-image: url('../img/icons/icon-related-lookup-m2m-hover.png'), -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#eee)); + background-image: url('../img/icons/icon-related-lookup-m2m-hover.png'), -o-linear-gradient(top, #e1e1e1, #eee); +} + +a.related-lookup + strong { + color: #555; +} + + +/* Add Another ......................................... */ + +a.add-another { + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; +} + + +/* Buttons & Button Links in Errors ......................................... */ + +.error input + button, +.error .vDateField + button, +.error .vTimeField + button, +.error input + a.fb_show, +.error input + a.related-lookup, +.error input + a.add-another, +.errors input + button, +.errors .vDateField + button, +.errors .vTimeField + button, +.errors input + a.fb_show, +.errors input + a.related-lookup, +.errors input + a.add-another, +.errors .autocomplete-wrapper-m2m { + border-color: #bf3030; +} + + +/* Focused Buttons & Button Links ......................................... */ + +input:focus + button, +.vDateField:focus + span a, +.vTimeField:focus + span a, +input:focus + a.fb_show, +input:focus + a.related-lookup, +input:focus + a.add-another { + border-color: #999; + /*border-left-color: #ccc;*/ +} +/* Reset the style for focused links in autocompletes as there is an automatically + focused (invisible) input which causes the a.related-lookup to be "focused" though it's not */ +div.autocomplete-wrapper-fk input:focus + a.related-lookup, +div.autocomplete-wrapper-m2m input:focus + a.related-lookup { + border-color: #ccc !important; +} + + +/* TABLES +–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */ + +tr.alt th, tr.alt td { + background: #f4f4f4; +} +.row1 th, .row1 td { + background: #f4f4f4; +} +.row2 th, .row2 td { + background: #fff; +} +.selected th, .selected td { + background: #ffd; +} + + +/* Thead ................................................... */ + +thead th, +tfoot td { + color: #aaa; + border-left: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; + background: #eee; + background: -moz-linear-gradient(top, #eee, #e0e0e0); + background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#e0e0e0)); + background: -o-linear-gradient(top, #eee, #e0e0e0); +} +thead th:first-of-type { + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; +} +thead th:last-of-type { + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} +thead th.sorted { + border-bottom: 1px solid #ccc; + background: #e0e0e0; + background: -moz-linear-gradient(top, #e0e0e0, #eee); + background: -webkit-gradient(linear, left top, left bottom, from(#e0e0e0), to(#eee)); + background: -o-linear-gradient(top, #e0e0e0, #eee); +} + +thead th a:link, thead th a:visited { + color: #59afcc; + border-top: 1px solid #fff; +} +thead th a:hover, thead th a:active, +thead th.sorted a { + color: #444; +} +thead th.sorted a { + border-top: 1px solid #ececec; +} + + +/* Tbody ................................................... */ + +tbody th, tbody td { + border-top: 1px solid #fff; + border-bottom: 1px solid #e0e0e0; +} + +tfoot td { + border-bottom: 0; + border-top: 1px solid #d4d4d4; +} + +thead th:first-child, +tfoot td:first-child { + border-left: 0; +} + +fieldset table { + border-right: 1px solid #eee; +} + +tr.row-label td { + border-bottom: 0; + color: #666; +} + + + +/* Changelist Table +------------------------------------------------------------------------------------------------------ */ + +#changelist table { + border: 1px solid #bdbdbd; +} +#changelist tbody th, #changelist tbody td { + border: 0; + border-top: 1px solid #e8e8e8; + border-left: 1px solid #e0e0e0; +} +#changelist tbody tr:first-child th, #changelist tbody tr:first-child td { + border-top: 1px solid #fff; +} +#changelist tbody tr th:first-child, #changelist tbody tr td:first-child { + border-left: 0; +} + +#changelist .changelist-results, +#changelist table { + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} + +#changelist thead th:first-of-type, +#changelist thead th:first-of-type a, +#changelist thead *:first-child[style^="display: none"] + *, +#changelist thead *:first-child[style^="display: none"] + * a { + border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; +} +#changelist thead th:last-of-type, +#changelist thead th:last-of-type a { + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; +} +#changelist tbody tr:last-of-type>*:first-child, +#changelist tbody tr:last-of-type>*:first-child[style^="display: none"] + * { + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; +} +#changelist tbody tr:last-of-type>*:last-child, +#changelist.editable tbody tr:last-of-type td:nth-last-child(-n+2) { + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; +} + +#changelist thead *[style^="display: none"] + *, +#changelist tbody tr *[style^="display: none"] + * { + border-left: 0; +} + + + +/* Change History +------------------------------------------------------------------------------------------------------ */ + +table#change-history thead th:first-child { + border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; +} +table#change-history thead th:last-child { + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; +} + + + +/* Overrides +------------------------------------------------------------------------------------------------------ */ + +tbody th:first-child, tbody td:first-child { + border-left: 0; +} +tbody tr:last-child td, tbody tr:last-child th { + border-bottom: 0; +} diff --git a/static/grappelli/css/jquery-ui-grappelli-extensions.css b/static/grappelli/css/jquery-ui-grappelli-extensions.css new file mode 100644 index 00000000..ff519a64 --- /dev/null +++ b/static/grappelli/css/jquery-ui-grappelli-extensions.css @@ -0,0 +1,611 @@ + + + +/* Widget Basics +------------------------------------------------------------------------------------------------------ */ + +.module.ui-widget { + border: none; + background: #fff; +} +.ui-widget-content { + border: 1px solid #ccc; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + background: #eee; +} + + + +/* Sortable +------------------------------------------------------------------------------------------------------ */ + +.ui-sortable-helper, +.ui-sortable-placeholder { + opacity: .8; +} + +.ui-sortable-placeholder, +.ui-sortable .module.ui-sortable-placeholder { + border: 1px solid #bdbdbd; + border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; + background: transparent url('../img/backgrounds/ui-sortable-placeholder.png') 0 0 repeat scroll !important; +} +.group.stacked div.ui-sortable-placeholder { + display: block; + margin-top: 2px !important; +} +.group.tabular div.ui-sortable-placeholder { + border: 0 !important; + overflow: hidden; +} +.group.tabular .ui-sortable .module.ui-sortable-placeholder .td { + background: transparent; +} +.group.tabular .ui-sortable .module.ui-sortable-placeholder .th, +.group.tabular .ui-sortable .module.ui-sortable-placeholder .td { + padding-top: 0 !important; + padding-bottom: 0 !important; +} +.group.tabular .module.ui-sortable-helper { + border-top: 0 !important; +} +.group.tabular .ui-sortable-helper .th, .group.tabular .ui-sortable-helper .td { + background: #ffffcc !important; +} +.group.stacked .ui-sortable-helper, .group.stacked .ui-sortable-helper .module, .group.stacked .ui-sortable-helper h2, .group.stacked .ui-sortable-helper h3, .group.stacked .ui-sortable-helper h4, +.group.stacked .collapse.predelete.ui-sortable-helper > h3.collapse-handler, +.group.stacked .collapse.open.predelete.ui-sortable-helper > h3.collapse-handler, +.group.stacked .collapse.predelete.ui-sortable-helper h4.collapse-handler, +.group.stacked .collapse.open.predelete.ui-sortable-helper h4.collapse-handler { + background: #ffffcc !important; +} + + + +/* Accordion +------------------------------------------------------------------------------------------------------ */ + + +/* Overlays */ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { + display: block; + font-size: 1em; + padding: 0 0 0 12px; +} +.ui-accordion .ui-accordion-header .ui-icon { display: none; } +.ui-accordion .ui-accordion-content { + top: 0; + margin-top: 0; + margin-bottom: 0; + padding: 0; +/* border-top: 1px solid #fff;*/ +} +.ui-accordion .ui-accordion-content-active { display: block; } + + + +/* Datepicker +----------------------------------*/ +.datetime br { + display: none; +} +.datetimeshortcuts { + width: 40px; + position: relative; + margin-left: 10px; +} +.datetimeshortcuts a { + margin-left: 0 !important; +} + +.ui-accordion-header { + margin-top: 2px !important; + cursor: pointer; + outline: none; +} +.ui-accordion .ui-accordion-header a { + padding: 0 0 0 12px; + color: #444; + outline: none; +} +.ui-accordion .ui-accordion-header { + display: block; + margin: 0; + padding: 6px 0; + outline: none; + font-size: 12px; + border: 1px solid #bdbdbd !important; + background: #cee9f2; + background: -moz-linear-gradient(top, #e1f0f5, #cee9f2); + background: -webkit-gradient(linear, left top, left bottom, from(#e1f0f5), to(#cee9f2)); + background: -o-linear-gradient(top, #e1f0f5, #cee9f2); +} + +.ui-accordion-header.ui-state-default { + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.ui-accordion-header.ui-state-hover { + background: #cee9f2; + background: -moz-linear-gradient(top, #cee9f2, #e1f0f5); + background: -webkit-gradient(linear, left top, left bottom, from(#cee9f2), to(#e1f0f5)); + background: -o-linear-gradient(top, #cee9f2, #e1f0f5); +} +.ui-accordion-header.ui-state-active { + border-bottom: 1px solid #c7c7c7 !important; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; + background: #cee9f2; + background: -moz-linear-gradient(top, #cee9f2, #e1f0f5); + background: -webkit-gradient(linear, left top, left bottom, from(#cee9f2), to(#e1f0f5)); + background: -o-linear-gradient(top, #cee9f2, #e1f0f5); +} + +.ui-accordion-content { + border-top: 0 !important; + border-top-left-radius: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; + border-top-right-radius: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; +} +.ui-accordion-content h3 { + display: none; +} +.ui-accordion-content .module:first-child { + margin-top: 0 !important; + border-top-color: #f4f4f4 !important; +} +.module.accordion>.module { + margin-bottom: 2px; + border-top: 0 !important; +} +.module.accordion>.module:last-of-type { + margin-bottom: 0; +} + + +/* Accordion Module ......................................... */ + +.ui-accordion-header.ui-state-default, +.module .ui-accordion-header.ui-state-default { + border: 1px solid #bdbdbd; + background-color: #a1d4e5; +} +.ui-accordion-header.ui-state-default:hover, +.module .ui-accordion-header.ui-state-default:hover { + background-color: #d6d6d6; +} +.ui-accordion-header.ui-state-active, +.module .ui-accordion-header.ui-state-active { + border: 1px solid #bdbdbd; + background-color: #d6d6d6; +} + + + +/* Accordion Module in Group......................................... */ + +/*.group .module .ui-accordion-header.ui-state-default { + border: 1px solid #c7c7c7; + background-color: #cee9f2; +} +.group .module .ui-accordion-header.ui-state-default:hover { + background-color: #e0e0e0; +} +.group .module .ui-accordion-header.ui-state-active { + border: 1px solid #c7c7c7; + background-color: #e0e0e0; +} +.group .module .ui-accordion-header { + border-top: 1px solid #4ef; +} +*/ + + +/* Datepicker +------------------------------------------------------------------------------------------------------ */ + +.ui-datepicker { + position: absolute; + display: none; + padding: 3px 3px 0; + width: auto !important; + border-color: #bdbdbd; + box-shadow: 0 10px 50px #333; -moz-box-shadow: 0 10px 50px #333; -webkit-box-shadow: 0 10px 50px #333; +} +.ui-datepicker .ui-datepicker-header { + padding: 2px 0; + height: 25px; +} +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next, +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { + position: absolute; + top: 4px; + width: 20px; + height: 30px; + background-color: transparent; + background-position: 50% 50%; + background-repeat: no-repeat; + cursor: pointer; +} +.ui-datepicker .ui-datepicker-prev { + left: 3px; + background-image: url('../img/icons/ui-datepicker-prev.png'); +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 3px; + border: none; + background-image: url('../img/icons/ui-datepicker-prev-hover.png'); +} +.ui-datepicker .ui-datepicker-next { + right: 3px; + background-image: url('../img/icons/ui-datepicker-next.png'); +} +.ui-datepicker .ui-datepicker-next-hover { + right: 3px; + border: none; + background-image: url('../img/icons/ui-datepicker-next-hover.png'); +} +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { + display: none !important; +} + + +.ui-datepicker .ui-datepicker-title { + margin: 3px 25px 2px; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + float:left; + font-size:1em; + margin: -3px 0 -1px !important; + min-width: 30px; +} +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { + float: right; +} +.ui-datepicker table { + width: 100%; + font-size: 12px; + margin: 0 0 2px; +} +.ui-datepicker th { + padding: 5px 0; + text-align: center; + font-weight: bold; + border: 0; + background: transparent; +} +.ui-datepicker td { + min-width: 25px; + border: 0; padding: 1px; +} +.ui-datepicker td span, .ui-datepicker td a { + padding: 4px 0 3px; + margin:0!important; + text-align: center; + display:block; + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; +} +.ui-datepicker td a.ui-state-hover { + color: #fff !important; + border-color: transparent !important; + background: #444 !important; +} +.ui-datepicker td a.ui-state-active { + background: #fff; +} +.ui-datepicker td a.ui-state-highlight { + border-color: #bababa; + background: #d6d6d6; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: 5px 0 0; + padding: 0; + border: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: 3px 0; + padding: 4px 5px 5px; + height: 25px; + color: #aaa; font-size: 11px; + border: 1px solid #c7c7c7; + background: transparent; + cursor: pointer; +} +@media screen and (-webkit-min-device-pixel-ratio:0) { + .ui-datepicker .ui-datepicker-buttonpane button { + padding: 5px 8px 4px; + } +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + opacity: 1 !important; + color: #444; font-weight: bold; + background: #cee9f2; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-state-hover { + color: #fff !important; + border-color: #444 !important; + background: #444 !important; +} + +.ui-datepicker-multi .ui-datepicker-group-first .ui-datepicker-title, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title { + margin-right: 5px !important; +} +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title, +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-title { + margin-left: 5px !important; +} + +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; +} +.ui-datepicker-multi .ui-datepicker-group-first table, +.ui-datepicker-multi .ui-datepicker-group-middle table { + margin-right: 5px !important; +} +.ui-datepicker-multi .ui-datepicker-group-middle table, +.ui-datepicker-multi .ui-datepicker-group-last table { + margin-left: 5px !important; +} +.ui-datepicker-multi .ui-datepicker-group-middle table { + margin-left: 3px !important; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + border: none; +} + +.ui-datepicker-append { + margin-left: 6px; color: #999; font-size: 10px; +} + +.ui-datepicker td.ui-state-disabled { + padding:1px; + text-align: center; +} +.ui-datepicker td.ui-state-disabled span { + background: #ccc; + color: #555 !important; + font-weight: bold; + font-size: 11px; + border-radius: 3px; -moz-border-radius: 3px; -webkit-borderradius: 3px; +} +button.ui-datepicker-close { + float: left !important; + margin-right: 4px !important; +} + + + +/* Timepicker +------------------------------------------------------------------------------------------------------ */ + +#ui-timepicker { + position: absolute; + display: none; + padding: 5px 3px 3px 5px; + width: 216px; + border: 1px solid #bdbdbd; + box-shadow: 0 10px 50px #333; -moz-box-shadow: 0 10px 50px #333; -webkit-box-shadow: 0 10px 50px #333; +} +#ui-timepicker ul { + position: relative; + float: left; + clear: both; + width: auto; +} +#ui-timepicker ul li.row { + position: relative; + float: left; + display: block; + margin: 0 2px 2px 0; + padding: 2px 10px 1px; + width: 30px; + font-size: 11px; + text-align: center; + border: 0; + border-radius: 3px; -moz-border-radius: 3px; -webkit-borderradius: 3px; + cursor: pointer; +} +#ui-timepicker .row.ui-state-default { + border: 1px solid #c7c7c7 !important; + background: #e1f0f5; +} +#ui-timepicker .row.ui-state-active { + border: 1px solid #bababa !important; + background: #d6d6d6; +} +#ui-timepicker .row.ui-state-default:hover { + color: #fff; + border: 1px solid #666 !important; + background: #444; +} + + + +/* Tabs +------------------------------------------------------------------------------------------------------ */ + +.ui-tabs { + zoom: 1; + border: 0 !important; + background: transparent; +} +.ui-tabs .ui-tabs-nav { + margin-top: 2px; + padding: 0; + color: #444; + font-size: 12px; + border: none; + border-bottom: 1px solid #bdbdbd; + border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; + background: none; +} +.ui-tabs:first-child .ui-tabs-nav { + margin-top: 0; +} +.ui-tabs .ui-tabs-nav li { + position: relative; float: left; + border-bottom-width: 1px !important; + margin: 0 2px -1px 0; + padding: 0; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + text-decoration: none; + padding: 6px 10px 6px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { + padding-bottom: 0px; border-bottom-width: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { + cursor: pointer; +} /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.tab-handler.ui-state-default { + background: #e1f0f5; + background: -moz-linear-gradient(top, #cee9f2, #e1f0f5); + background: -webkit-gradient(linear, left top, left bottom, from(#cee9f2), to(#e1f0f5)); + background: -o-linear-gradient(top, #cee9f2, #e1f0f5); +} +.tab-handler.ui-state-default:hover { + color: #444 !important; + border: 1px solid #c7c7c7; + background: #cee9f2; + background: -moz-linear-gradient(top, #e1f0f5, #cee9f2); + background: -webkit-gradient(linear, left top, left bottom, from(#e1f0f5), to(#cee9f2)); + background: -o-linear-gradient(top, #e1f0f5, #cee9f2); +} +.tab-handler.ui-state-default.ui-tabs-selected { + border: 1px solid #c7c7c7; + border-bottom-color: #d4d4d4; + background: #e9e9e9; + background: -moz-linear-gradient(top, #e0e0e0, #e9e9e9); + background: -webkit-gradient(linear, left top, left bottom, from(#e0e0e0), to(#e9e9e9)); + background: -o-linear-gradient(top, #e0e0e0, #e9e9e9); +} + + +.ui-tabs-nav li a:hover { + color: #444 !important; +} +.ui-tabs-nav li.ui-tabs-selected a { + color: #444 !important; +} +.ui-tabs .ui-tabs-panel { + margin-top: 0 !important; + padding: 0; + display: block; + border: 1px solid #ccc; + border-top-left-radius: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + background: #eee; +} +.ui-tabs-panel h3 { display: none; } +.ui-tabs-panel > h3 + .module { + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; +} +.ui-tabs-panel > h3 + .module > h4:first-child { + margin-top: -1px; +/* border-top: 0 !important;*/ + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} +.ui-tabs .ui-tabs-hide { display: none !important; } + +/*.group-accordion-container h3 { display: none; }*/ + + + + + +/* Menu +----------------------------------*/ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 5px 5px 4px; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { +/* margin: -1px;*/ + border: 0 !important; +} + + +/* Autocomplete +------------------------------------------------------------------------------------------------------ */ + +.ui-autocomplete { + position: absolute; + cursor: default; + padding: 3px; + border: 1px solid #ccc; + border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; + background: #eee; + box-shadow: 0 10px 50px #333; -moz-box-shadow: 0 10px 50px #333; -webkit-box-shadow: 0 10px 50px #333; +} +* html .ui-autocomplete { + width: 1px; +} +.ui-autocomplete-category { + font-weight: bold; + line-height: 1.5; + font-style: italic; + margin: 0; + padding: 5px; +} +.ui-autocomplete li:first-child span { + display: block; + padding: 1px 4px; + color: #999; + font-weight: bold; +} +.ui-autocomplete .ui-menu-item + .ui-menu-item { + margin-top: 2px; + border-top: 0 !important; +} +.ui-autocomplete li:first-child + li { + margin-top: 4px; +} +.ui-autocomplete .ui-menu-item a { + margin: 0; + padding: 3px 4px; + color: #444; + font-weight: bold; + border: 1px solid #c7c7c7; + border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; + background: #cee9f2; +} +.ui-autocomplete .ui-menu-item a.ui-state-hover, +.ui-autocomplete .ui-menu-item a:hover, .ui-autocomplete .ui-menu-item a:active { + margin: 0 !important; + padding: 3px 4px !important; + color: #fff !important; + border: 1px solid transparent !important; + border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; + background: #444 !important; +} diff --git a/static/grappelli/css/reset.css b/static/grappelli/css/reset.css new file mode 100644 index 00000000..ec2ec5cd --- /dev/null +++ b/static/grappelli/css/reset.css @@ -0,0 +1,40 @@ +/* -------------------------------------------------------------- + + reset.css + * Resets default browser CSS. + +-------------------------------------------------------------- */ + +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, code, +del, dfn, em, img, q, dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +body { + line-height: 1.5; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { border-collapse: separate; border-spacing: 0; } +caption, th, td { text-align: left; font-weight: normal; } +table, td, th { vertical-align: middle; } + +/* Remove possible quote marks (") from ,
      . */ +blockquote:before, blockquote:after, q:before, q:after { content: ""; } +blockquote, q { quotes: "" ""; } + +/* Remove annoying border on linked images. */ +a img { border: none; } + + diff --git a/static/grappelli/css/structures.css b/static/grappelli/css/structures.css new file mode 100644 index 00000000..baaea07d --- /dev/null +++ b/static/grappelli/css/structures.css @@ -0,0 +1,661 @@ + + + +/* Body +------------------------------------------------------------------------------------------------------ */ + +body { + padding: 58px 20px 0; + font-family: Arial, sans-serif; + font-size: 12px; + line-height: 16px; +} +body.popup { + padding-top: 0; +} + + + +/* Container +------------------------------------------------------------------------------------------------------ */ + +#container { + z-index: 0; + position: relative; + float: left; + clear: both; + margin: 0; + padding: 0; + width: 100%; +} + + + +/* Header +------------------------------------------------------------------------------------------------------ */ + +#header { + position: fixed; + top: 0; + left: 0; + z-index: 1100; + padding: 0 20px; + width: 100%; + height: 30px; + font-size: 11px; + line-height: 14px; + font-weight: bold; +} +body.filebrowser.popup #header { + display: none; +} + + + +/* Branding, Bookmarks & User-Tools +------------------------------------------------------------------------------------------------------ */ + +.branding, .admin-title, +#bookmarks li, #user-tools li { + margin: 0; + padding: 8px 10px; +} +.branding { + display: none; + position: relative; + float: right; + width: 10px; + background: url('../img/grappelli-icon.png') 50% 50% no-repeat; +} +.admin-title { + position: relative; + float: left; + margin: 0 0 0 -20px; + padding-left: 20px; + padding-right: 20px; +} +#header ul li { + position: relative; + float: left; +} + + +/* Navigation Menu (UL Navigation-Menu of Admin-Tools) ................................................... */ + +ul.navigation-menu { + position: relative; + float: left; +} +ul.navigation-menu li { + float: none !important; +} +ul.navigation-menu>li { + position: relative; + float: none !important; + display: block; + margin: 0; +} +ul.navigation-menu>li>a { + display: block; + padding: 8px 10px; + font-size: 11px !important; +} +ul.navigation-menu li.bookmark, +ul.navigation-menu li.actions { + float: left !important; +} +ul.navigation-menu li ul { + position: absolute; + z-index: 1 !important; + float: none !important; + margin-top: -1px; + padding: 0; + min-width: 220px; + white-space: nowrap; + +/* box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;*/ +} +ul.navigation-menu>li>a+ul { + overflow-x: hidden !important; +/* padding-right: 20px;*/ +/* width: 500px;*/ + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + box-shadow: 0 0 20px #333; -moz-box-shadow: 0 0 20px #333; -webkit-box-shadow: 0 0 20px #333; +} +ul.navigation-menu>li>ul>li.parent { + overflow-x: hidden !important; +} + +ul.navigation-menu li ul ul { + position: relative; + float: none; + margin-top: 0; + margin: 0; + padding: 0; + width: 100%; + overflow: inherit; +} + +ul.navigation-menu li li.item-collapse.item-open { + background: #3a3a3a; +} +ul.navigation-menu li li li.item-collapse.item-open { +/* border: 1px solid #383838;*/ + -moz-border-radius: 4px; + background: #424242; +} +ul.navigation-menu li li li.item-collapse.item-open + li { +/* border: 0 !important;*/ +} +ul.navigation-menu li li li li.item-collapse.item-open { +/* border: 1px solid #404040;*/ + background: #4a4a4a; +} +ul.navigation-menu li li li li.item-collapse.oitem-pen + li { +/* border: 0 !important;*/ +} +ul.navigation-menu li li li li li.item-collapse.item-open { +/* border: 1px solid #484848;*/ + background: #525252; +} + + +ul.navigation-menu li li { +/* padding: 0 10px;*/ +} +ul.navigation-menu li li li { +/* margin: 0 -20px 0 -10px;*/ +/* padding: 0 10px 0 20px;*/ + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +ul.navigation-menu li li li li { +/* margin: 0 -10px 0 -20px;*/ +/* padding: 0 10px 0 30px;*/ +/* box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;*/ +} +ul.navigation-menu li li li li li { +/* margin: 0 -10px 0 -30px;*/ +/* padding: 0 10px 0 40px;*/ + overflow: hidden; +/* box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;*/ +} +ul.navigation-menu li li li li li li { +/* margin: 0 0 0 -40px;*/ +/* padding: 0 10px 0 50px;*/ + overflow: hidden; +/* box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;*/ +} + + +ul.navigation-menu li li.last { + border-bottom: 0 !important; +} + +ul.navigation-menu li ul ul>li:first-child a { +/* margin-left: -10px;*/ +/* padding-left: 10px;*/ +} +ul.navigation-menu li li a { + display: block; + padding: 8px 10px; + font-size: 11px; +} +ul.navigation-menu li li li a { + padding: 4px 10px 4px 20px; + font-size: 11px; + white-space: normal; +} +ul.navigation-menu li li li li a { + padding-left: 30px; +} +ul.navigation-menu li li li li li a { + padding-left: 40px; +} +ul.navigation-menu li li li li li li a { + padding-left: 50px; +} +ul.navigation-menu li.parent>a { + font-size: 11px; +} +ul.navigation-menu li li.parent>a { + font-size: 11px; +} + +ul.navigation-menu li.item-collapse.item-closed>* { + display: none !important; +} +ul.navigation-menu li.item-collapse.item-open>* { + display: block !important; +} + +ul.navigation-menu li.item-collapse a.item-collapse-handler-container { + display: block !important; +/* padding: 10px 0 !important;*/ +} + +form#bookmark-form { + position: relative; + float: left; + padding: 3px 10px 1px 0; + height: 26px; +} +form#bookmark-form button { + position: relative; display: block; + margin: 3px 0 0; + width: 20px; + height: 20px; +} + +ul.navigation-menu li.item-collapse a.item-collapse-handler { + position: relative; + float: right; + display: inline-block !important; + right: 0; + margin: -30px 0 -30px 0; + padding: 0; + width: 28px; + height: 30px; + cursor: pointer; +} +ul.navigation-menu li li li.item-collapse a.item-collapse-handler { + margin: -22px 0; + width: 28px; + height: 22px; +} +a.item-collapse-handler-container { + padding-right: 38px !important; +} +ul.navigation-menu li li.item-collapse.item-closed>a+a.item-collapse-handler:link, +ul.navigation-menu li li.item-collapse.item-closed>a+a.item-collapse-handler:visited { + background: transparent url("../img/icons/icon-admin_tools-dropdown.png") no-repeat scroll 50% 50%; +} +ul.navigation-menu li li.item-collapse.item-closed>a+a.item-collapse-handler:hover, +ul.navigation-menu li li.item-collapse.item-closed>a+a.item-collapse-handler:active { + background: transparent url("../img/icons/icon-admin_tools-dropdown-hover.png") no-repeat scroll 50% 50%; +} +ul.navigation-menu li li.item-collapse.item-open>a+a.item-collapse-handler:link, +ul.navigation-menu li li.item-collapse.item-open>a+a.item-collapse-handler:visited { + background: transparent url("../img/icons/icon-admin_tools-dropdown-active.png") no-repeat scroll 50% 50%; +} +ul.navigation-menu li li.item-collapse.item-open>a+a.item-collapse-handler:hover, +ul.navigation-menu li li.item-collapse.item-open>a+a.item-collapse-handler:active { + background: transparent url("../img/icons/icon-admin_tools-dropdown-active-hover.png") no-repeat scroll 50% 50%; +} + + +/* User Tools ................................................... */ + +#user-tools { + position: absolute; + right: 40px; +} +#user-tools>li:last-child { + padding-right: 20px; +} + +#user-tools li.user-options-container { + position: relative; + width: 200px; +} + +li.user-options-container.open a.user-options-handler { + display: block; +} +ul.user-options { + display: none; +} +li.user-options-container.open ul.user-options { + display: block; + position: absolute; + float: none; + clear: both; + z-index: 1000; + margin: 7px -10px 0; + width: 221px; +} +ul.user-options li { + float: none !important; + clear: both; +} +ul.user-options li a { + display: block; +} + + + +/* Breadcrumbs +------------------------------------------------------------------------------------------------------ */ + +div#breadcrumbs { + position: fixed; + top: 30px; + left: 0; + z-index: 1000; + padding: 5px 10px 5px 20px; + width: 100%; + font-size: 11px; +/* font-weight: bold;*/ + text-align: left; +} +div#breadcrumbs > a { + padding: 10px 2px; +} +body.popup div#breadcrumbs { + top: 0; +} + + + +/* Messages +------------------------------------------------------------------------------------------------------ */ + +ul.messagelist { + position: relative; + top: 0; + z-index: 990; + margin: 0 -20px; +} +ul.messagelist li { + display: block; + padding: 5px 10px 5px 20px; + font-size: 11px; + font-weight: bold; +} +body.popup .breadcrumbs + ul.messagelist { + top: 24px; +} +body.filebrowser.popup ul.messagelist { + top: 28px; +} +body.login ul.messagelist { + top: -28px; +} + + +/* Masthead +------------------------------------------------------------------------------------------------------ */ + +#masthead { + position: relative; + float: left; + clear: both; + z-index: 900; + padding: 60px 0 10px; + width: 100%; +} + + + +/* Login Form +------------------------------------------------------------------------------------------------------ */ + +div.login { + top: -30px; +} +#login-form { + margin: 0 auto; +} + + + +/* Content +------------------------------------------------------------------------------------------------------ */ + +#content { + position: relative; + float: left; + clear: both; + margin: 0 0 80px; + padding: 0; + width: auto; +} +#content.content-flexible { + width: 100%; +} +body.filebrowser.popup #content { + top: 28px; +} + + + +/* Container +------------------------------------------------------------------------------------------------------ */ + +.container, +.container-grid { + position: relative; + float: left; + clear: both; + width: 940px; +} +.container-flexible { + position: relative; + float: none; + clear: both; + width: auto; + height: 100%; +} + + + +/* Blueprint Grid Columns & Spans +------------------------------------------------------------------------------------------------------ */ + +.column { + position: relative; + float: left; +} +.column.centered { + position: relative; + float: none !important; + margin: 0 auto !important; +} +.span-flexible { + position: relative; + width: 100%; +} +.container-flexible.layout-flexible-grid .span-flexible { + float: left; + margin-right: 20px; + width: 100%; +} +.container-flexible.layout-flexible-grid .span-flexible + .column { + float: left !important; +} +.container-flexible.layout-grid-flexible .column { + float: left; +} +.container-flexible.layout-grid-flexible .span-flexible { + float: left; + width: 100%; +} +fieldset.module .row .column:first-child { + margin-left: 0 !important; +} +fieldset.module .row .column:last-child { + margin-right: -20px !important; +} +fieldset.module .row .column.span-flexible:last-child { + margin-right: 0 !important; +} +.row .span-flexible, +.row .span-flexible:last-child { + float: none; + width: auto; + margin-right: 0 !important; +} + + +/* Basic Float & Margin ......................................... */ + +.span-1, .span-2, .span-3, .span-4, .span-5, .span-6, +.span-7, .span-8, .span-9, .span-10, .span-11, .span-12, +.span-13, .span-14, .span-15, .span-16, .span-17, .span-18, +.span-19, .span-20, .span-21, .span-22, .span-23, .span-24 { +/* float: left;*/ + margin-right: 20px; +} +.column.last { margin-right: 0; } + + +/* Column Widths ......................................... */ + +.span-1 { width: 20px; } +.span-2 { width: 60px; } +.span-3 { width: 100px; } +.span-4 { width: 140px; } +.span-5 { width: 180px; } +.span-6 { width: 220px; } +.span-7 { width: 260px; } +.span-8 { width: 300px; } +.span-9 { width: 340px; } +.span-10 { width: 380px; } +.span-11 { width: 420px; } +.span-12 { width: 460px; } +.span-13 { width: 500px; } +.span-14 { width: 540px; } +.span-15 { width: 580px; } +.span-16 { width: 620px; } +.span-17 { width: 660px; } +.span-18 { width: 700px; } +.span-19 { width: 740px; } +.span-20 { width: 780px; } +.span-21 { width: 820px; } +.span-22 { width: 860px; } +.span-23 { width: 900px; } +.span-24 { width: 940px; margin: 0; } + + +/* Append empty columns ......................................... */ + +.append-1 { padding-right: 40px; } +.append-2 { padding-right: 80px; } +.append-3 { padding-right: 120px; } +.append-4 { padding-right: 160px; } +.append-5 { padding-right: 200px; } +.append-6 { padding-right: 240px; } +.append-7 { padding-right: 280px; } +.append-8 { padding-right: 320px; } +.append-9 { padding-right: 360px; } +.append-10 { padding-right: 400px; } +.append-11 { padding-right: 440px; } +.append-12 { padding-right: 480px; } +.append-13 { padding-right: 520px; } +.append-14 { padding-right: 560px; } +.append-15 { padding-right: 600px; } +.append-16 { padding-right: 640px; } +.append-17 { padding-right: 680px; } +.append-18 { padding-right: 720px; } +.append-19 { padding-right: 760px; } +.append-20 { padding-right: 800px; } +.append-21 { padding-right: 840px; } +.append-22 { padding-right: 880px; } +.append-23 { padding-right: 920px; } + + +/* Prepend empty columns ......................................... */ + +.prepend-1 { padding-left: 40px; } +.prepend-2 { padding-left: 80px; } +.prepend-3 { padding-left: 120px; } +.prepend-4 { padding-left: 160px; } +.prepend-5 { padding-left: 200px; } +.prepend-6 { padding-left: 240px; } +.prepend-7 { padding-left: 280px; } +.prepend-8 { padding-left: 320px; } +.prepend-9 { padding-left: 360px; } +.prepend-10 { padding-left: 400px; } +.prepend-11 { padding-left: 440px; } +.prepend-12 { padding-left: 480px; } +.prepend-13 { padding-left: 520px; } +.prepend-14 { padding-left: 560px; } +.prepend-15 { padding-left: 600px; } +.prepend-16 { padding-left: 640px; } +.prepend-17 { padding-left: 680px; } +.prepend-18 { padding-left: 720px; } +.prepend-19 { padding-left: 760px; } +.prepend-20 { padding-left: 800px; } +.prepend-21 { padding-left: 840px; } +.prepend-22 { padding-left: 880px; } +.prepend-23 { padding-left: 920px; } + + +/* Span-X + Span-Flexible ......................................... */ + +.span-1 + .span-flexible { margin-left: 40px; } +.span-2 + .span-flexible { margin-left: 80px; } +.span-3 + .span-flexible { margin-left: 120px; } +.span-4 + .span-flexible { margin-left: 160px; Xmin-width: 758px; } +.span-5 + .span-flexible { margin-left: 200px; } +.span-6 + .span-flexible { margin-left: 240px; } +.span-7 + .span-flexible { margin-left: 280px; } +.span-8 + .span-flexible { margin-left: 320px; } +.span-9 + .span-flexible { margin-left: 360px; } +.span-10 + .span-flexible { margin-left: 400px; } +.span-11 + .span-flexible { margin-left: 440px; } +.span-12 + .span-flexible { margin-left: 480px; } +.span-13 + .span-flexible { margin-left: 520px; } +.span-14 + .span-flexible { margin-left: 560px; } +.span-15 + .span-flexible { margin-left: 600px; } +.span-16 + .span-flexible { margin-left: 640px; } +.span-17 + .span-flexible { margin-left: 680px; } +.span-18 + .span-flexible { margin-left: 720px; } +.span-19 + .span-flexible { margin-left: 760px; } +.span-20 + .span-flexible { margin-left: 800px; } +.span-21 + .span-flexible { margin-left: 840px; } +.span-22 + .span-flexible { margin-left: 880px; } +.span-23 + .span-flexible { margin-left: 920px; } +.span-24 + .span-flexible { margin-left: 960px; } + + +/* Columns in Cells ......................................... */ + +.cell.span-1 { width: 0px; } +.cell.span-2 { width: 40px; } +.cell.span-3 { width: 80px; } +.cell.span-4 { width: 120px; } +.cell.span-5 { width: 160px; } +.cell.span-6 { width: 200px; } +.cell.span-7 { width: 240px; } +.cell.span-8 { width: 280px; } +.cell.span-9 { width: 330px; } +.cell.span-10 { width: 360px; } +.cell.span-11 { width: 400px; } +.cell.span-12 { width: 440px; } +.cell.span-13 { width: 480px; } +.cell.span-14 { width: 520px; } +.cell.span-15 { width: 560px; } +.cell.span-16 { width: 600px; } +.cell.span-17 { width: 640px; } +.cell.span-18 { width: 680px; } +.cell.span-19 { width: 720px; } +.cell.span-20 { width: 760px; } +.cell.span-21 { width: 800px; } +.cell.span-22 { width: 840px; } +.cell.span-23 { width: 880px; } +.cell.span-24 { width: 920px; margin: 0; } + + +/* Clearing floats without extra markup + Based on How To Clear Floats Without Structural Markup by PiE + [http://www.positioniseverything.net/easyclearing.html] */ + +.clearfix:after, .container:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clearfix, .container { display: inline-block; } +* html .clearfix, +* html .container { height: 1%; } +.clearfix, .container { display: block; } + +/* Regular clearing + apply to column that should drop below previous ones. */ + +.clear { clear: both; } + + + diff --git a/static/grappelli/css/tables.css b/static/grappelli/css/tables.css new file mode 100644 index 00000000..7a79ade0 --- /dev/null +++ b/static/grappelli/css/tables.css @@ -0,0 +1,138 @@ + + + +/* Basic Table Settings +------------------------------------------------------------------------------------------------------ */ + +table { + margin: 0; + padding: 0; + border-spacing: none; +} +td, th { + vertical-align: top; + padding: 10px 10px 9px; + font-size: 11px; + line-height: 15px; +} +th { + text-align: left; + font-size: 12px; + font-weight: bold; +} + + +/* Thead ................................................... */ + +thead th, +tfoot td { + padding: 5px 10px; + font-size: 11px; + line-height: 12px; + font-weight: normal; +} +thead th.sorted { + font-weight: bold; +} +thead th a { + position: relative; + display: block; + margin: -5px -10px -4px; + padding: 4px 10px 4px; + height: 100% !important; + white-space: nowrap; +} +thead th.ascending a:after { + content: url('../img/icons/icon-th-ascending.png'); +} +thead th.descending a:after { + content: url('../img/icons/icon-th-descending.png'); +} + + +/* Tbody ................................................... */ + +thead th.optional { + font-weight: normal !important; +} +tr.row-label td { + margin-top: -1px; + padding-top: 2px; + padding-bottom: 0; + font-size: 9px; +} + + + +/* Table XFull +------------------------------------------------------------------------------------------------------ */ + +table.xfull { + width: 100%; +} + + + +/* Changelist Table +------------------------------------------------------------------------------------------------------ */ + +#changelist table { + position: relative; + margin: -1px !important; +} + +#changelist form table tbody td, #changelist form table tbody th { + padding-top: 10px; + padding-bottom: 9px; + line-height: 16px; +} + + + +/* Orderable Tables +------------------------------------------------------------------------------------------------------ */ + +table.orderable tbody tr td:hover { + cursor: move; +} + +table.orderable tbody tr td:first-child { + padding-left: 14px; +} + +table.orderable-initalized .order-cell, body>tr>td.order-cell { + display: none; +} + + + +/* Change History +------------------------------------------------------------------------------------------------------ */ + +table#change-history { + width: 100%; +} +table#change-history tbody th { + width: 150px; +} + + + +/* Documentation +------------------------------------------------------------------------------------------------------ */ + +.model-index table { + width: 100%; +} +.model-index table th { + padding: 7px 10px 8px; +} + + + +/* Other Classes +------------------------------------------------------------------------------------------------------ */ + +table .nowrap { + white-space: nowrap; +} diff --git a/static/grappelli/css/tools.css b/static/grappelli/css/tools.css new file mode 100644 index 00000000..0069667a --- /dev/null +++ b/static/grappelli/css/tools.css @@ -0,0 +1,306 @@ + + + +/* Tools Basics +------------------------------------------------------------------------------------------------------ */ + +.tools { + position: relative; + float: right; + clear: both; + padding: 6px 10px; + font-size: 11px; + font-weight: bold; +} +ul.tools { + padding: 0; + list-style-type: none; + white-space: nowrap; +} +/* Empty breaks in Chrome 11+: Elements are not displayed initially even if they are not empty */ +/*ul.tools:empty { + display: none; +}*/ +ul.tools li { + position: relative; + float: left; + display: block; + overflow: hidden; + margin-left: 5px; + padding: 6px 0; + min-width: 12px; +} +ul.tools li:last-child { + margin-right: 5px; +} + + + +/* H1 + Tools +------------------------------------------------------------------------------------------------------ */ + +h1 + .tools, +.grappelli-h1 + .tools { + position: relative; + float: right; + clear: right; + z-index: 900; + margin-top: -34px; + margin-bottom: -34px; + display: inline-block; +} + +h1 + .tools li, +h1 + .tools li:last-child { + float: left; + margin: 0 0 0 3px; + padding: 0; +} +h1 + .tools a { + display: block; + margin: 0; + padding: 4px 15px; + width: auto; + height: 17px; + font-size: 11px; + opacity: .6; +} +h1 + .tools a:hover, h1 + .tools a:active { + opacity: 1; +} + +h1 + .tools a.add-handler:link, h1 + .tools a.add-handler:visited { + padding-left: 30px; + background: url('../img/icons/icon-object-tools-add-handler.png') 0 50% no-repeat scroll; +} +h1 + .tools a.add-handler:hover, h1 + .tools a.add-handler:active { + background: url('../img/icons/icon-object-tools-add-handler.png') 0 50% no-repeat scroll; +} + + +/* Focused Buttons ................................................... */ + +h1 + .tools a.focus { + opacity: 1; +} + + + + +/* Tools +------------------------------------------------------------------------------------------------------ */ + +.group .tools, +.module .tools { + position: relative; + float: right; + clear: both; + padding: 6px 10px; + font-size: 11px; + font-weight: bold; +} +.group ul.tools, +.module ul.tools { + padding: 0 2px; + list-style-type: none; +} +.group ul.tools li, +.module ul.tools li { + position: relative; + float: left; + display: block; + overflow: hidden; + margin-left: 5px; + padding: 6px 2px; +} +.group ul.tools li:last-child, +.module ul.tools li:last-child { + margin-right: 5px; +} + + +/* 1st Level H2 + Tools ......................................... */ + +.group h2+.tools, +.module h2+.tools { + top: -29px; + right: 0; + margin-bottom: -29px; +} +.group h2+.tools { + right: 1px; +} +.module.collapse.closed h2+.tools { + top: -28px; +} + + +/* 2nd Level H3 + Tools ......................................... */ + +.module h3+.tools { + top: -27px; + right: 0; + margin-bottom: -27px; +} +.module h3+ul.tools li { + padding-top: 5px; + padding-bottom: 5px; +} + + +/* 3rd Level H4 + Tools ......................................... */ + +.module h4+.tools { + top: -24px; + right: 0; + margin-bottom: -24px; +} +.module h4+ul.tools li { + padding-top: 3px; + padding-bottom: 4px; +} + + +/* Tools in Tabular Groups ......................................... */ + +.module.table .th .tools, +.module.table .td .tools { + top: -5px; + right: -20px; + margin-left: -20px; + margin-bottom: -15px; +} +.module.table .th .tools li, +.module.table .td .tools li { + padding-top: 10px; + padding-bottom: 9px; +} + + +/* Links ................................................... */ + +.tools a { + position: relative; + display: block; + margin: -6px 0; + padding: 6px 0px; + width: 100%; + height: 100%; + background-position: 50% 50%; + background-repeat: no-repeat; +} + +.tools a.icon { + margin: -6px 0; + padding: 6px 0px; + width: 12px; + height: 16px; +} + +.module.table .th .tools a, +.module.table .td .tools a { + margin: -9px 0; + padding: 9px 0px; +} +.module.table .th .tools a.icon, +.module.table .td .tools a.icon { + margin: -9px 0; + padding: 9px 0px; +} + + +/* Icons ................................................... */ + +.tools a.drag-handler:link, .tools a.drag-handler:visited { + background-image: url('../img/icons/icon-tools-drag-handler.png'); +} +.tools a.drag-handler:hover, .tools a.drag-handler:active { + background-image: url('../img/icons/icon-tools-drag-handler-hover.png'); +} +.predelete-items a.drag-handler, .predelete-item a.drag-handler { + display: none; +} + +.tools a.viewsite-link:link, .tools a.viewsite-link:visited { + background-image: url('../img/icons/icon-tools-viewsite-link.png'); + opacity: .4; +} +.tools a.viewsite-link:hover, .tools a.viewsite-link:active { + background-image: url('../img/icons/icon-tools-viewsite-link-hover.png'); +} + +.tools a.delete-handler:link, .tools a.delete-handler:visited, +.predelete .tools a.delete-handler:hover, .predelete .tools a.delete-handler:active { + background-image: url('../img/icons/icon-tools-delete-handler.png'); +} +.tools a.delete-handler:hover, .tools a.delete-handler:active, +.predelete .tools a.delete-handler:link, .predelete .tools a.delete-handler:visited { + background-image: url('../img/icons/icon-tools-delete-handler-hover.png'); +} + +.tools a.remove-handler:link, .tools a.remove-handler:visited { + background-image: url('../img/icons/icon-tools-remove-handler.png'); +} +.tools a.remove-handler:hover, .tools a.remove-handler:active { + background-image: url('../img/icons/icon-tools-remove-handler-hover.png'); +} + +.tools a.add-handler:link, .tools a.add-handler:visited { + background-image: url('../img/icons/icon-tools-add-handler.png'); +} +.tools a.add-handler:hover, .tools a.add-handler:active { + background-image: url('../img/icons/icon-tools-add-handler-hover.png'); +} + +.tools a.open-handler:link, .tools a.open-handler:visited { + background-image: url('../img/icons/icon-tools-open-handler.png'); +} +.tools a.open-handler:hover, .tools a.open-handler:active { + background-image: url('../img/icons/icon-tools-open-handler-hover.png'); +} + +.tools a.close-handler:link, .tools a.close-handler:visited { + background-image: url('../img/icons/icon-tools-close-handler.png'); +} +.tools a.close-handler:hover, .tools a.close-handler:active { + background-image: url('../img/icons/icon-tools-close-handler-hover.png'); +} + +.tools a.keep-open-handler:link, .tools a.keep-open-handler:visited { + background-image: url('../img/icons/icon-tools-close-handler.png'); +} +.tools a.keep-open-handler:hover, .tools a.keep-open-handler:active { + background-image: url('../img/icons/icon-tools-close-handler-hover.png'); +} + +.tools a.keep-closed-handler:link, .tools a.keep-closed-handler:visited { + background-image: url('../img/icons/icon-tools-open-handler.png'); +} +.tools a.keep-closed-handler:hover, .tools a.keep-closed-handler:active { + background-image: url('../img/icons/icon-tools-open-handler-hover.png'); +} + +.tools a.arrow-up-handler:link, .tools a.arrow-up-handler:visited { + background-image: url('../img/icons/icon-tools-arrow-up-handler.png'); +} +.tools a.arrow-up-handler:hover, .tools a.arrow-up-handler:active { + background-image: url('../img/icons/icon-tools-arrow-up-handler-hover.png'); +} + +.tools a.arrow-down-handler:link, .tools a.arrow-down-handler:visited { + background-image: url('../img/icons/icon-tools-arrow-down-handler.png'); +} +.tools a.arrow-down-handler:hover, .tools a.arrow-down-handler:active { + background-image: url('../img/icons/icon-tools-arrow-down-handler-hover.png'); +} + + +.group.open h2 + .tools li.keep-closed-handler-container, +.module.open h2 + .tools li.keep-closed-handler-container, +.group.closed h2 + .tools li.keep-open-handler-container, +.module.closed h2 + .tools li.keep-open-handler-container { + display: none !important; +} +.dashboard-module.open h2 + .tools { + margin-right: 5px; +} diff --git a/static/grappelli/css/typography.css b/static/grappelli/css/typography.css new file mode 100644 index 00000000..b821d7c4 --- /dev/null +++ b/static/grappelli/css/typography.css @@ -0,0 +1,274 @@ + +/* typography.css: + 2009 / vonautomatisch werkstaetten / vonautomatisch.at +------------------------------------------------------------------------------------------------------ */ + + + +/* Headings +------------------------------------------------------------------------------------------------------ */ + +h1, h2, h3, h4 { + font-weight: bold; +} + +h1 { + position: relative; + z-index: 800; + margin: 26px 0 10px; + font-size: 16px; + line-height: 20px; +} +.pretitle + h1 { + margin-top: 0; +} +h2 { + font-size: 13px; +} +h3 { + font-size: 12px; +} +h4, h5 { + font-size: 11px; +} + + + +/* Paragraphs & Images +------------------------------------------------------------------------------------------------------ */ + +.module p.help, +p.help { + padding: 5px 0; + font-size: 10px !important; + line-height: 12px; +} + +p.readonly { + margin: 0 !important; + padding: 3px 0 !important; + color: #666; + font-size: 12px; + font-weight: bold; +} + +.row img { + font-size: 1px; + line-height: 1px; + vertical-align: middle; +} + +.fb_show + p.help a { + display: inline-block; + padding: 3px; + font-size: 0; + line-height: 0; +} +.fb_show + p.help a img { + margin: 0; + font-size: 0; + line-height: 0; +} +.container-grid > p:first-child, .container-flexible > p:first-child, +.container-grid .column > p:first-child, .container-flexible .column > p:first-child { + margin: 0 0 10px; +} + + + +/* Links +------------------------------------------------------------------------------------------------------ */ + +a { + text-decoration: none; + outline: none; + cursor: pointer; +} +a.back { + font-weight: bold; +} + + + +/* Listings +------------------------------------------------------------------------------------------------------ */ + +ul, li { + list-style-type: none; +} + + + +/* Blockquote, Pre, Code +------------------------------------------------------------------------------------------------------ */ + +blockquote { + margin-left: 2px; + padding-left: 4px; + font-size: 11px; +} + +code, pre { + font-size: 11px; + font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; +} + +pre.literal-block { + margin: 10px; + padding: 6px 8px; +} + +hr { + clear: both; + margin: 0; + padding: 0; + height: 1px; + font-size: 1px; + line-height: 1px; +} + + + +/* Table Typography +------------------------------------------------------------------------------------------------------ */ + +th.focus, +td.focus { + font-weight: bold; +} + + + +/* RTE (Rich Text Edited) +------------------------------------------------------------------------------------------------------ */ + +.rte h2.subhead { + margin: 0; + font-size: 12px; +} +.rte h3 { + margin: 10px -10px 10px; + padding: 7px 10px 6px; + font-size: 12px !important; +} +.rte h2 + h3 { + margin-top: -11px !important; +} +.rte h4 { + margin: 10px 0 0; + font-size: 12px; +} + +.rte p { + margin: 10px 0; +} +.rte .module p { + margin: 10px 0; + padding: 0 10px; +} +.rte > p:first-child { + margin-top: 0; +} + +.rte .group h2 + p, +.rte .module h2 + p { + margin: 5px 0; + padding: 0 10px; + font-size: 11px; +} + +.rte table p { + margin: 0 !important; + padding: 0 !important; +} + +/* Workaround for problem reported in django-ticket #11817 */ +.rte h2 p, +.rte h4 p { + margin: 0 !important; + padding: 0 !important; + font-weight: normal; +} +.rte h2 p { + font-weight: bold !important; +} +.rte h4:empty, +.rte p:empty, +.rte hr, +.rte br:first-child { + display: none !important; +} + +.rte ul, .rte ol { + margin: 10px 0 0 20px; + padding: 0 0 0 10px; + font-weight: normal !important; +} +ul.rte ul, ul.rte ol, +ol.rte ul, ol.rte ol { + margin: 0 0 0 20px; + font-size: 12px; + line-height: 14px; +} +.rte ul li, .rte ol li { + margin: 0; + padding: 0; +} +.rte ul li { + list-style-type: disc; +} +.rte ol li { + list-style-type: decimal; +} + +.delete-confirmation ul.rte>li { + padding-bottom: 9px; + font-weight: bold; +} +.delete-confirmation ul.rte>li:last-child { + padding-bottom: 0; +} +.delete-confirmation ul.rte>li+li { + padding-top: 8px !important; +} +.delete-confirmation ul.rte>li>ul { + margin-top: 2px; +} +.delete-confirmation ul.rte>li>ul>li { + list-style-type: none; + margin: 0 0 0 -30px !important; + padding: 5px 0; +} +.delete-confirmation ul.rte>li>ul>li:last-child { + padding-bottom: 0; +} +.delete-confirmation ul.rte>li>ul>li>ul>li { + font-size: 11px; +} + +.rte dd ul, .rte dd ol { + margin-top: 0; +} +.rte blockquote { + margin: 10px; +} +.rte dl, .rte dt, .rte dd { + margin: 0; +} +.rte dl { + padding: 5px 10px; +} +.rte dt { + font-weight: bold; +} +.rte dd + dt { + margin-top: 5px; +} + + + +/* Other Styles +------------------------------------------------------------------------------------------------------ */ + +.small { font-size: 10px; } +.fw-normal { font-weight: normal; } diff --git a/static/grappelli/images/backgrounds/changelist-results.png b/static/grappelli/images/backgrounds/changelist-results.png new file mode 100644 index 00000000..265beacd Binary files /dev/null and b/static/grappelli/images/backgrounds/changelist-results.png differ diff --git a/static/grappelli/images/backgrounds/loading-small.gif b/static/grappelli/images/backgrounds/loading-small.gif new file mode 100644 index 00000000..929a5622 Binary files /dev/null and b/static/grappelli/images/backgrounds/loading-small.gif differ diff --git a/static/grappelli/images/backgrounds/messagelist.png b/static/grappelli/images/backgrounds/messagelist.png new file mode 100644 index 00000000..b6193216 Binary files /dev/null and b/static/grappelli/images/backgrounds/messagelist.png differ diff --git a/static/grappelli/images/backgrounds/nav-grabber.gif b/static/grappelli/images/backgrounds/nav-grabber.gif new file mode 100644 index 00000000..0a784fa7 Binary files /dev/null and b/static/grappelli/images/backgrounds/nav-grabber.gif differ diff --git a/static/grappelli/images/backgrounds/ui-sortable-placeholder.png b/static/grappelli/images/backgrounds/ui-sortable-placeholder.png new file mode 100644 index 00000000..f9b2ce9e Binary files /dev/null and b/static/grappelli/images/backgrounds/ui-sortable-placeholder.png differ diff --git a/static/grappelli/images/icons-s0e29227ce9.png b/static/grappelli/images/icons-s0e29227ce9.png new file mode 100644 index 00000000..f934ce86 Binary files /dev/null and b/static/grappelli/images/icons-s0e29227ce9.png differ diff --git a/static/grappelli/images/icons-s2649da6b63.png b/static/grappelli/images/icons-s2649da6b63.png new file mode 100644 index 00000000..e8f05b0e Binary files /dev/null and b/static/grappelli/images/icons-s2649da6b63.png differ diff --git a/static/grappelli/images/icons-s4a437305c0.png b/static/grappelli/images/icons-s4a437305c0.png new file mode 100644 index 00000000..1b0e6bb7 Binary files /dev/null and b/static/grappelli/images/icons-s4a437305c0.png differ diff --git a/static/grappelli/images/icons-s96d5c23000.png b/static/grappelli/images/icons-s96d5c23000.png new file mode 100644 index 00000000..b0e13f71 Binary files /dev/null and b/static/grappelli/images/icons-s96d5c23000.png differ diff --git a/static/grappelli/images/icons-small-s4291b06aac.png b/static/grappelli/images/icons-small-s4291b06aac.png new file mode 100644 index 00000000..5061ca87 Binary files /dev/null and b/static/grappelli/images/icons-small-s4291b06aac.png differ diff --git a/static/grappelli/images/icons-small-s7d28d7943b.png b/static/grappelli/images/icons-small-s7d28d7943b.png new file mode 100644 index 00000000..c90e0fbe Binary files /dev/null and b/static/grappelli/images/icons-small-s7d28d7943b.png differ diff --git a/static/grappelli/images/icons-small-s9045a82f03.png b/static/grappelli/images/icons-small-s9045a82f03.png new file mode 100644 index 00000000..d1783cf2 Binary files /dev/null and b/static/grappelli/images/icons-small-s9045a82f03.png differ diff --git a/static/grappelli/images/icons-small/add-link.png b/static/grappelli/images/icons-small/add-link.png new file mode 100644 index 00000000..d3bdbd70 Binary files /dev/null and b/static/grappelli/images/icons-small/add-link.png differ diff --git a/static/grappelli/images/icons-small/add-link_hover.png b/static/grappelli/images/icons-small/add-link_hover.png new file mode 100644 index 00000000..821a3ff9 Binary files /dev/null and b/static/grappelli/images/icons-small/add-link_hover.png differ diff --git a/static/grappelli/images/icons-small/change-link.png b/static/grappelli/images/icons-small/change-link.png new file mode 100644 index 00000000..e5471533 Binary files /dev/null and b/static/grappelli/images/icons-small/change-link.png differ diff --git a/static/grappelli/images/icons-small/change-link_hover.png b/static/grappelli/images/icons-small/change-link_hover.png new file mode 100644 index 00000000..7581aae9 Binary files /dev/null and b/static/grappelli/images/icons-small/change-link_hover.png differ diff --git a/static/grappelli/images/icons-small/delete-link.png b/static/grappelli/images/icons-small/delete-link.png new file mode 100644 index 00000000..783460d5 Binary files /dev/null and b/static/grappelli/images/icons-small/delete-link.png differ diff --git a/static/grappelli/images/icons-small/filter-choice-selected.png b/static/grappelli/images/icons-small/filter-choice-selected.png new file mode 100644 index 00000000..309a8fd2 Binary files /dev/null and b/static/grappelli/images/icons-small/filter-choice-selected.png differ diff --git a/static/grappelli/images/icons-small/link-external.png b/static/grappelli/images/icons-small/link-external.png new file mode 100644 index 00000000..a3c6acb2 Binary files /dev/null and b/static/grappelli/images/icons-small/link-external.png differ diff --git a/static/grappelli/images/icons-small/link-external_hover.png b/static/grappelli/images/icons-small/link-external_hover.png new file mode 100644 index 00000000..ae5652de Binary files /dev/null and b/static/grappelli/images/icons-small/link-external_hover.png differ diff --git a/static/grappelli/images/icons-small/link-internal.png b/static/grappelli/images/icons-small/link-internal.png new file mode 100644 index 00000000..254a9ff6 Binary files /dev/null and b/static/grappelli/images/icons-small/link-internal.png differ diff --git a/static/grappelli/images/icons-small/link-internal_hover.png b/static/grappelli/images/icons-small/link-internal_hover.png new file mode 100644 index 00000000..e8785e98 Binary files /dev/null and b/static/grappelli/images/icons-small/link-internal_hover.png differ diff --git a/static/grappelli/images/icons-small/sort-remove.png b/static/grappelli/images/icons-small/sort-remove.png new file mode 100644 index 00000000..5f80f247 Binary files /dev/null and b/static/grappelli/images/icons-small/sort-remove.png differ diff --git a/static/grappelli/images/icons/add-another.png b/static/grappelli/images/icons/add-another.png new file mode 100644 index 00000000..f731681b Binary files /dev/null and b/static/grappelli/images/icons/add-another.png differ diff --git a/static/grappelli/images/icons/add-another_hover.png b/static/grappelli/images/icons/add-another_hover.png new file mode 100644 index 00000000..b4050212 Binary files /dev/null and b/static/grappelli/images/icons/add-another_hover.png differ diff --git a/static/grappelli/images/icons/back-link.png b/static/grappelli/images/icons/back-link.png new file mode 100644 index 00000000..ab226db0 Binary files /dev/null and b/static/grappelli/images/icons/back-link.png differ diff --git a/static/grappelli/images/icons/back-link_hover.png b/static/grappelli/images/icons/back-link_hover.png new file mode 100644 index 00000000..0377e634 Binary files /dev/null and b/static/grappelli/images/icons/back-link_hover.png differ diff --git a/static/grappelli/images/icons/breadcrumbs-rtl.png b/static/grappelli/images/icons/breadcrumbs-rtl.png new file mode 100644 index 00000000..85f3c576 Binary files /dev/null and b/static/grappelli/images/icons/breadcrumbs-rtl.png differ diff --git a/static/grappelli/images/icons/breadcrumbs-rtl_hover.png b/static/grappelli/images/icons/breadcrumbs-rtl_hover.png new file mode 100644 index 00000000..9d52dc13 Binary files /dev/null and b/static/grappelli/images/icons/breadcrumbs-rtl_hover.png differ diff --git a/static/grappelli/images/icons/breadcrumbs.png b/static/grappelli/images/icons/breadcrumbs.png new file mode 100644 index 00000000..ae474bef Binary files /dev/null and b/static/grappelli/images/icons/breadcrumbs.png differ diff --git a/static/grappelli/images/icons/breadcrumbs_hover.png b/static/grappelli/images/icons/breadcrumbs_hover.png new file mode 100644 index 00000000..933d1673 Binary files /dev/null and b/static/grappelli/images/icons/breadcrumbs_hover.png differ diff --git a/static/grappelli/images/icons/date-hierarchy-back-rtl.png b/static/grappelli/images/icons/date-hierarchy-back-rtl.png new file mode 100644 index 00000000..a4a42a59 Binary files /dev/null and b/static/grappelli/images/icons/date-hierarchy-back-rtl.png differ diff --git a/static/grappelli/images/icons/date-hierarchy-back-rtl_hover.png b/static/grappelli/images/icons/date-hierarchy-back-rtl_hover.png new file mode 100644 index 00000000..ade98947 Binary files /dev/null and b/static/grappelli/images/icons/date-hierarchy-back-rtl_hover.png differ diff --git a/static/grappelli/images/icons/date-hierarchy-back.png b/static/grappelli/images/icons/date-hierarchy-back.png new file mode 100644 index 00000000..3a75f5a3 Binary files /dev/null and b/static/grappelli/images/icons/date-hierarchy-back.png differ diff --git a/static/grappelli/images/icons/date-hierarchy-back_hover.png b/static/grappelli/images/icons/date-hierarchy-back_hover.png new file mode 100644 index 00000000..2b26f44d Binary files /dev/null and b/static/grappelli/images/icons/date-hierarchy-back_hover.png differ diff --git a/static/grappelli/images/icons/datepicker.png b/static/grappelli/images/icons/datepicker.png new file mode 100644 index 00000000..f1eff98f Binary files /dev/null and b/static/grappelli/images/icons/datepicker.png differ diff --git a/static/grappelli/images/icons/datepicker_hover.png b/static/grappelli/images/icons/datepicker_hover.png new file mode 100644 index 00000000..31108f93 Binary files /dev/null and b/static/grappelli/images/icons/datepicker_hover.png differ diff --git a/static/grappelli/images/icons/datetime-now.png b/static/grappelli/images/icons/datetime-now.png new file mode 100644 index 00000000..60ba928d Binary files /dev/null and b/static/grappelli/images/icons/datetime-now.png differ diff --git a/static/grappelli/images/icons/datetime-now_hover.png b/static/grappelli/images/icons/datetime-now_hover.png new file mode 100644 index 00000000..19eb904e Binary files /dev/null and b/static/grappelli/images/icons/datetime-now_hover.png differ diff --git a/static/grappelli/images/icons/form-select.png b/static/grappelli/images/icons/form-select.png new file mode 100644 index 00000000..3591d503 Binary files /dev/null and b/static/grappelli/images/icons/form-select.png differ diff --git a/static/grappelli/images/icons/object-tools-add-link.png b/static/grappelli/images/icons/object-tools-add-link.png new file mode 100644 index 00000000..192b45f0 Binary files /dev/null and b/static/grappelli/images/icons/object-tools-add-link.png differ diff --git a/static/grappelli/images/icons/object-tools-viewsite-link.png b/static/grappelli/images/icons/object-tools-viewsite-link.png new file mode 100644 index 00000000..cc6f3188 Binary files /dev/null and b/static/grappelli/images/icons/object-tools-viewsite-link.png differ diff --git a/static/grappelli/images/icons/pulldown-handler.png b/static/grappelli/images/icons/pulldown-handler.png new file mode 100644 index 00000000..449b3cbb Binary files /dev/null and b/static/grappelli/images/icons/pulldown-handler.png differ diff --git a/static/grappelli/images/icons/pulldown-handler_hover.png b/static/grappelli/images/icons/pulldown-handler_hover.png new file mode 100644 index 00000000..472c5ba8 Binary files /dev/null and b/static/grappelli/images/icons/pulldown-handler_hover.png differ diff --git a/static/grappelli/images/icons/pulldown-handler_selected.png b/static/grappelli/images/icons/pulldown-handler_selected.png new file mode 100644 index 00000000..472c5ba8 Binary files /dev/null and b/static/grappelli/images/icons/pulldown-handler_selected.png differ diff --git a/static/grappelli/images/icons/related-lookup-m2m.png b/static/grappelli/images/icons/related-lookup-m2m.png new file mode 100644 index 00000000..fb8e23dc Binary files /dev/null and b/static/grappelli/images/icons/related-lookup-m2m.png differ diff --git a/static/grappelli/images/icons/related-lookup-m2m_hover.png b/static/grappelli/images/icons/related-lookup-m2m_hover.png new file mode 100644 index 00000000..ec3e90ba Binary files /dev/null and b/static/grappelli/images/icons/related-lookup-m2m_hover.png differ diff --git a/static/grappelli/images/icons/related-lookup.png b/static/grappelli/images/icons/related-lookup.png new file mode 100644 index 00000000..8ab430cb Binary files /dev/null and b/static/grappelli/images/icons/related-lookup.png differ diff --git a/static/grappelli/images/icons/related-lookup_hover.png b/static/grappelli/images/icons/related-lookup_hover.png new file mode 100644 index 00000000..2aad6cc1 Binary files /dev/null and b/static/grappelli/images/icons/related-lookup_hover.png differ diff --git a/static/grappelli/images/icons/related-remove.png b/static/grappelli/images/icons/related-remove.png new file mode 100644 index 00000000..329f7266 Binary files /dev/null and b/static/grappelli/images/icons/related-remove.png differ diff --git a/static/grappelli/images/icons/related-remove_hover.png b/static/grappelli/images/icons/related-remove_hover.png new file mode 100644 index 00000000..de944f2a Binary files /dev/null and b/static/grappelli/images/icons/related-remove_hover.png differ diff --git a/static/grappelli/images/icons/searchbox.png b/static/grappelli/images/icons/searchbox.png new file mode 100644 index 00000000..9a9090de Binary files /dev/null and b/static/grappelli/images/icons/searchbox.png differ diff --git a/static/grappelli/images/icons/selector-add-m2m-horizontal.png b/static/grappelli/images/icons/selector-add-m2m-horizontal.png new file mode 100644 index 00000000..7ba54992 Binary files /dev/null and b/static/grappelli/images/icons/selector-add-m2m-horizontal.png differ diff --git a/static/grappelli/images/icons/selector-add-m2m-horizontal_hover.png b/static/grappelli/images/icons/selector-add-m2m-horizontal_hover.png new file mode 100644 index 00000000..f19a6c88 Binary files /dev/null and b/static/grappelli/images/icons/selector-add-m2m-horizontal_hover.png differ diff --git a/static/grappelli/images/icons/selector-add-m2m-vertical.png b/static/grappelli/images/icons/selector-add-m2m-vertical.png new file mode 100644 index 00000000..0f53ca3b Binary files /dev/null and b/static/grappelli/images/icons/selector-add-m2m-vertical.png differ diff --git a/static/grappelli/images/icons/selector-add-m2m-vertical_hover.png b/static/grappelli/images/icons/selector-add-m2m-vertical_hover.png new file mode 100644 index 00000000..6be1d750 Binary files /dev/null and b/static/grappelli/images/icons/selector-add-m2m-vertical_hover.png differ diff --git a/static/grappelli/images/icons/selector-filter.png b/static/grappelli/images/icons/selector-filter.png new file mode 100644 index 00000000..9c39774d Binary files /dev/null and b/static/grappelli/images/icons/selector-filter.png differ diff --git a/static/grappelli/images/icons/selector-remove-m2m-horizontal.png b/static/grappelli/images/icons/selector-remove-m2m-horizontal.png new file mode 100644 index 00000000..a6bdc7c0 Binary files /dev/null and b/static/grappelli/images/icons/selector-remove-m2m-horizontal.png differ diff --git a/static/grappelli/images/icons/selector-remove-m2m-horizontal_hover.png b/static/grappelli/images/icons/selector-remove-m2m-horizontal_hover.png new file mode 100644 index 00000000..9bfb7424 Binary files /dev/null and b/static/grappelli/images/icons/selector-remove-m2m-horizontal_hover.png differ diff --git a/static/grappelli/images/icons/selector-remove-m2m-vertical.png b/static/grappelli/images/icons/selector-remove-m2m-vertical.png new file mode 100644 index 00000000..ee330c98 Binary files /dev/null and b/static/grappelli/images/icons/selector-remove-m2m-vertical.png differ diff --git a/static/grappelli/images/icons/selector-remove-m2m-vertical_hover.png b/static/grappelli/images/icons/selector-remove-m2m-vertical_hover.png new file mode 100644 index 00000000..943945ce Binary files /dev/null and b/static/grappelli/images/icons/selector-remove-m2m-vertical_hover.png differ diff --git a/static/grappelli/images/icons/sort-remove.png b/static/grappelli/images/icons/sort-remove.png new file mode 100644 index 00000000..bafe85cd Binary files /dev/null and b/static/grappelli/images/icons/sort-remove.png differ diff --git a/static/grappelli/images/icons/sort-remove_hover.png b/static/grappelli/images/icons/sort-remove_hover.png new file mode 100644 index 00000000..9df5960f Binary files /dev/null and b/static/grappelli/images/icons/sort-remove_hover.png differ diff --git a/static/grappelli/images/icons/sorted-ascending.png b/static/grappelli/images/icons/sorted-ascending.png new file mode 100644 index 00000000..0ac367bd Binary files /dev/null and b/static/grappelli/images/icons/sorted-ascending.png differ diff --git a/static/grappelli/images/icons/sorted-descending.png b/static/grappelli/images/icons/sorted-descending.png new file mode 100644 index 00000000..e520a75d Binary files /dev/null and b/static/grappelli/images/icons/sorted-descending.png differ diff --git a/static/grappelli/images/icons/status-no.png b/static/grappelli/images/icons/status-no.png new file mode 100644 index 00000000..91fac439 Binary files /dev/null and b/static/grappelli/images/icons/status-no.png differ diff --git a/static/grappelli/images/icons/status-unknown.png b/static/grappelli/images/icons/status-unknown.png new file mode 100644 index 00000000..0b7d1809 Binary files /dev/null and b/static/grappelli/images/icons/status-unknown.png differ diff --git a/static/grappelli/images/icons/status-yes.png b/static/grappelli/images/icons/status-yes.png new file mode 100644 index 00000000..2f140794 Binary files /dev/null and b/static/grappelli/images/icons/status-yes.png differ diff --git a/static/grappelli/images/icons/th-ascending.png b/static/grappelli/images/icons/th-ascending.png new file mode 100644 index 00000000..24dda0af Binary files /dev/null and b/static/grappelli/images/icons/th-ascending.png differ diff --git a/static/grappelli/images/icons/th-descending.png b/static/grappelli/images/icons/th-descending.png new file mode 100644 index 00000000..32fb3fb8 Binary files /dev/null and b/static/grappelli/images/icons/th-descending.png differ diff --git a/static/grappelli/images/icons/timepicker.png b/static/grappelli/images/icons/timepicker.png new file mode 100644 index 00000000..c0e18cfd Binary files /dev/null and b/static/grappelli/images/icons/timepicker.png differ diff --git a/static/grappelli/images/icons/timepicker_hover.png b/static/grappelli/images/icons/timepicker_hover.png new file mode 100644 index 00000000..bd47588f Binary files /dev/null and b/static/grappelli/images/icons/timepicker_hover.png differ diff --git a/static/grappelli/images/icons/tools-add-handler.png b/static/grappelli/images/icons/tools-add-handler.png new file mode 100644 index 00000000..1a11fc26 Binary files /dev/null and b/static/grappelli/images/icons/tools-add-handler.png differ diff --git a/static/grappelli/images/icons/tools-add-handler_hover.png b/static/grappelli/images/icons/tools-add-handler_hover.png new file mode 100644 index 00000000..91e2401a Binary files /dev/null and b/static/grappelli/images/icons/tools-add-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-arrow-down-handler.png b/static/grappelli/images/icons/tools-arrow-down-handler.png new file mode 100644 index 00000000..472c5ba8 Binary files /dev/null and b/static/grappelli/images/icons/tools-arrow-down-handler.png differ diff --git a/static/grappelli/images/icons/tools-arrow-down-handler_hover.png b/static/grappelli/images/icons/tools-arrow-down-handler_hover.png new file mode 100644 index 00000000..449b3cbb Binary files /dev/null and b/static/grappelli/images/icons/tools-arrow-down-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-arrow-up-handler.png b/static/grappelli/images/icons/tools-arrow-up-handler.png new file mode 100644 index 00000000..da9b532e Binary files /dev/null and b/static/grappelli/images/icons/tools-arrow-up-handler.png differ diff --git a/static/grappelli/images/icons/tools-arrow-up-handler_hover.png b/static/grappelli/images/icons/tools-arrow-up-handler_hover.png new file mode 100644 index 00000000..25155455 Binary files /dev/null and b/static/grappelli/images/icons/tools-arrow-up-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-close-handler.png b/static/grappelli/images/icons/tools-close-handler.png new file mode 100644 index 00000000..039b24ba Binary files /dev/null and b/static/grappelli/images/icons/tools-close-handler.png differ diff --git a/static/grappelli/images/icons/tools-close-handler_hover.png b/static/grappelli/images/icons/tools-close-handler_hover.png new file mode 100644 index 00000000..71529835 Binary files /dev/null and b/static/grappelli/images/icons/tools-close-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-delete-handler-predelete.png b/static/grappelli/images/icons/tools-delete-handler-predelete.png new file mode 100644 index 00000000..fcb37993 Binary files /dev/null and b/static/grappelli/images/icons/tools-delete-handler-predelete.png differ diff --git a/static/grappelli/images/icons/tools-delete-handler.png b/static/grappelli/images/icons/tools-delete-handler.png new file mode 100644 index 00000000..c8caa2cd Binary files /dev/null and b/static/grappelli/images/icons/tools-delete-handler.png differ diff --git a/static/grappelli/images/icons/tools-delete-handler_hover.png b/static/grappelli/images/icons/tools-delete-handler_hover.png new file mode 100644 index 00000000..06f46d24 Binary files /dev/null and b/static/grappelli/images/icons/tools-delete-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-drag-handler.png b/static/grappelli/images/icons/tools-drag-handler.png new file mode 100644 index 00000000..90abf5ef Binary files /dev/null and b/static/grappelli/images/icons/tools-drag-handler.png differ diff --git a/static/grappelli/images/icons/tools-drag-handler_hover.png b/static/grappelli/images/icons/tools-drag-handler_hover.png new file mode 100644 index 00000000..6f9c4392 Binary files /dev/null and b/static/grappelli/images/icons/tools-drag-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-open-handler.png b/static/grappelli/images/icons/tools-open-handler.png new file mode 100644 index 00000000..ce1a3b6c Binary files /dev/null and b/static/grappelli/images/icons/tools-open-handler.png differ diff --git a/static/grappelli/images/icons/tools-open-handler_hover.png b/static/grappelli/images/icons/tools-open-handler_hover.png new file mode 100644 index 00000000..e6909e94 Binary files /dev/null and b/static/grappelli/images/icons/tools-open-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-remove-handler.png b/static/grappelli/images/icons/tools-remove-handler.png new file mode 100644 index 00000000..1f00f020 Binary files /dev/null and b/static/grappelli/images/icons/tools-remove-handler.png differ diff --git a/static/grappelli/images/icons/tools-remove-handler_hover.png b/static/grappelli/images/icons/tools-remove-handler_hover.png new file mode 100644 index 00000000..c109e853 Binary files /dev/null and b/static/grappelli/images/icons/tools-remove-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-trash-handler.png b/static/grappelli/images/icons/tools-trash-handler.png new file mode 100644 index 00000000..ae12bbfb Binary files /dev/null and b/static/grappelli/images/icons/tools-trash-handler.png differ diff --git a/static/grappelli/images/icons/tools-trash-handler_hover.png b/static/grappelli/images/icons/tools-trash-handler_hover.png new file mode 100644 index 00000000..97ce780c Binary files /dev/null and b/static/grappelli/images/icons/tools-trash-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-trash-list-toggle-handler.png b/static/grappelli/images/icons/tools-trash-list-toggle-handler.png new file mode 100644 index 00000000..d9679215 Binary files /dev/null and b/static/grappelli/images/icons/tools-trash-list-toggle-handler.png differ diff --git a/static/grappelli/images/icons/tools-trash-list-toggle-handler_hover.png b/static/grappelli/images/icons/tools-trash-list-toggle-handler_hover.png new file mode 100644 index 00000000..d28de365 Binary files /dev/null and b/static/grappelli/images/icons/tools-trash-list-toggle-handler_hover.png differ diff --git a/static/grappelli/images/icons/tools-viewsite-link.png b/static/grappelli/images/icons/tools-viewsite-link.png new file mode 100644 index 00000000..a067c00f Binary files /dev/null and b/static/grappelli/images/icons/tools-viewsite-link.png differ diff --git a/static/grappelli/images/icons/tools-viewsite-link_hover.png b/static/grappelli/images/icons/tools-viewsite-link_hover.png new file mode 100644 index 00000000..f12e2315 Binary files /dev/null and b/static/grappelli/images/icons/tools-viewsite-link_hover.png differ diff --git a/static/grappelli/images/icons/ui-datepicker-next.png b/static/grappelli/images/icons/ui-datepicker-next.png new file mode 100644 index 00000000..6f5a81f2 Binary files /dev/null and b/static/grappelli/images/icons/ui-datepicker-next.png differ diff --git a/static/grappelli/images/icons/ui-datepicker-next_hover.png b/static/grappelli/images/icons/ui-datepicker-next_hover.png new file mode 100644 index 00000000..a592c099 Binary files /dev/null and b/static/grappelli/images/icons/ui-datepicker-next_hover.png differ diff --git a/static/grappelli/images/icons/ui-datepicker-prev.png b/static/grappelli/images/icons/ui-datepicker-prev.png new file mode 100644 index 00000000..6edc4770 Binary files /dev/null and b/static/grappelli/images/icons/ui-datepicker-prev.png differ diff --git a/static/grappelli/images/icons/ui-datepicker-prev_hover.png b/static/grappelli/images/icons/ui-datepicker-prev_hover.png new file mode 100644 index 00000000..b80532a9 Binary files /dev/null and b/static/grappelli/images/icons/ui-datepicker-prev_hover.png differ diff --git a/static/grappelli/img/admin/arrow-down.gif b/static/grappelli/img/admin/arrow-down.gif new file mode 100644 index 00000000..a967b9fd Binary files /dev/null and b/static/grappelli/img/admin/arrow-down.gif differ diff --git a/static/grappelli/img/admin/arrow-up.gif b/static/grappelli/img/admin/arrow-up.gif new file mode 100644 index 00000000..3fe48513 Binary files /dev/null and b/static/grappelli/img/admin/arrow-up.gif differ diff --git a/static/grappelli/img/admin/icon-no.gif b/static/grappelli/img/admin/icon-no.gif new file mode 100644 index 00000000..099c95f3 Binary files /dev/null and b/static/grappelli/img/admin/icon-no.gif differ diff --git a/static/grappelli/img/admin/icon-unknown.gif b/static/grappelli/img/admin/icon-unknown.gif new file mode 100644 index 00000000..099c95f3 Binary files /dev/null and b/static/grappelli/img/admin/icon-unknown.gif differ diff --git a/static/grappelli/img/admin/icon-yes.gif b/static/grappelli/img/admin/icon-yes.gif new file mode 100644 index 00000000..099c95f3 Binary files /dev/null and b/static/grappelli/img/admin/icon-yes.gif differ diff --git a/static/grappelli/img/admin/icon_addlink.gif b/static/grappelli/img/admin/icon_addlink.gif new file mode 100644 index 00000000..099c95f3 Binary files /dev/null and b/static/grappelli/img/admin/icon_addlink.gif differ diff --git a/static/grappelli/img/admin/selector-add.gif b/static/grappelli/img/admin/selector-add.gif new file mode 100644 index 00000000..45b75943 Binary files /dev/null and b/static/grappelli/img/admin/selector-add.gif differ diff --git a/static/grappelli/img/admin/selector-search.gif b/static/grappelli/img/admin/selector-search.gif new file mode 100644 index 00000000..45b75943 Binary files /dev/null and b/static/grappelli/img/admin/selector-search.gif differ diff --git a/static/grappelli/img/backgrounds/autocomplete.png b/static/grappelli/img/backgrounds/autocomplete.png new file mode 100644 index 00000000..313112ad Binary files /dev/null and b/static/grappelli/img/backgrounds/autocomplete.png differ diff --git a/static/grappelli/img/backgrounds/changelist-results.png b/static/grappelli/img/backgrounds/changelist-results.png new file mode 100644 index 00000000..265beacd Binary files /dev/null and b/static/grappelli/img/backgrounds/changelist-results.png differ diff --git a/static/grappelli/img/backgrounds/loading-small.gif b/static/grappelli/img/backgrounds/loading-small.gif new file mode 100644 index 00000000..929a5622 Binary files /dev/null and b/static/grappelli/img/backgrounds/loading-small.gif differ diff --git a/static/grappelli/img/backgrounds/tooltip-pointer.png b/static/grappelli/img/backgrounds/tooltip-pointer.png new file mode 100644 index 00000000..f23b1889 Binary files /dev/null and b/static/grappelli/img/backgrounds/tooltip-pointer.png differ diff --git a/static/grappelli/img/backgrounds/ui-sortable-placeholder.png b/static/grappelli/img/backgrounds/ui-sortable-placeholder.png new file mode 100644 index 00000000..f9b2ce9e Binary files /dev/null and b/static/grappelli/img/backgrounds/ui-sortable-placeholder.png differ diff --git a/static/grappelli/img/grappelli-icon.png b/static/grappelli/img/grappelli-icon.png new file mode 100644 index 00000000..c4fb10e0 Binary files /dev/null and b/static/grappelli/img/grappelli-icon.png differ diff --git a/static/grappelli/img/icons/icon-actionlist_addlink-hover.png b/static/grappelli/img/icons/icon-actionlist_addlink-hover.png new file mode 100644 index 00000000..20c740bf Binary files /dev/null and b/static/grappelli/img/icons/icon-actionlist_addlink-hover.png differ diff --git a/static/grappelli/img/icons/icon-actionlist_addlink.png b/static/grappelli/img/icons/icon-actionlist_addlink.png new file mode 100644 index 00000000..6e2ed2a8 Binary files /dev/null and b/static/grappelli/img/icons/icon-actionlist_addlink.png differ diff --git a/static/grappelli/img/icons/icon-actionlist_changelink-hover.png b/static/grappelli/img/icons/icon-actionlist_changelink-hover.png new file mode 100644 index 00000000..d4880935 Binary files /dev/null and b/static/grappelli/img/icons/icon-actionlist_changelink-hover.png differ diff --git a/static/grappelli/img/icons/icon-actionlist_changelink.png b/static/grappelli/img/icons/icon-actionlist_changelink.png new file mode 100644 index 00000000..2a6f2930 Binary files /dev/null and b/static/grappelli/img/icons/icon-actionlist_changelink.png differ diff --git a/static/grappelli/img/icons/icon-actionlist_deletelink.png b/static/grappelli/img/icons/icon-actionlist_deletelink.png new file mode 100644 index 00000000..7931f671 Binary files /dev/null and b/static/grappelli/img/icons/icon-actionlist_deletelink.png differ diff --git a/static/grappelli/img/icons/icon-actions-add-link-hover.png b/static/grappelli/img/icons/icon-actions-add-link-hover.png new file mode 100644 index 00000000..20c740bf Binary files /dev/null and b/static/grappelli/img/icons/icon-actions-add-link-hover.png differ diff --git a/static/grappelli/img/icons/icon-actions-add-link.png b/static/grappelli/img/icons/icon-actions-add-link.png new file mode 100644 index 00000000..6e2ed2a8 Binary files /dev/null and b/static/grappelli/img/icons/icon-actions-add-link.png differ diff --git a/static/grappelli/img/icons/icon-actions-change-link-hover.png b/static/grappelli/img/icons/icon-actions-change-link-hover.png new file mode 100644 index 00000000..d4880935 Binary files /dev/null and b/static/grappelli/img/icons/icon-actions-change-link-hover.png differ diff --git a/static/grappelli/img/icons/icon-actions-change-link.png b/static/grappelli/img/icons/icon-actions-change-link.png new file mode 100644 index 00000000..2a6f2930 Binary files /dev/null and b/static/grappelli/img/icons/icon-actions-change-link.png differ diff --git a/static/grappelli/img/icons/icon-actions-delete-link.png b/static/grappelli/img/icons/icon-actions-delete-link.png new file mode 100644 index 00000000..7931f671 Binary files /dev/null and b/static/grappelli/img/icons/icon-actions-delete-link.png differ diff --git a/static/grappelli/img/icons/icon-actions_changelist.png b/static/grappelli/img/icons/icon-actions_changelist.png new file mode 100644 index 00000000..3f297aff Binary files /dev/null and b/static/grappelli/img/icons/icon-actions_changelist.png differ diff --git a/static/grappelli/img/icons/icon-add_another-hover.png b/static/grappelli/img/icons/icon-add_another-hover.png new file mode 100644 index 00000000..c017a95b Binary files /dev/null and b/static/grappelli/img/icons/icon-add_another-hover.png differ diff --git a/static/grappelli/img/icons/icon-add_another.png b/static/grappelli/img/icons/icon-add_another.png new file mode 100644 index 00000000..dd649051 Binary files /dev/null and b/static/grappelli/img/icons/icon-add_another.png differ diff --git a/static/grappelli/img/icons/icon-addlink-hover.png b/static/grappelli/img/icons/icon-addlink-hover.png new file mode 100644 index 00000000..c017a95b Binary files /dev/null and b/static/grappelli/img/icons/icon-addlink-hover.png differ diff --git a/static/grappelli/img/icons/icon-addlink.png b/static/grappelli/img/icons/icon-addlink.png new file mode 100644 index 00000000..dd649051 Binary files /dev/null and b/static/grappelli/img/icons/icon-addlink.png differ diff --git a/static/grappelli/img/icons/icon-admin_tools-dropdown-active-hover.png b/static/grappelli/img/icons/icon-admin_tools-dropdown-active-hover.png new file mode 100644 index 00000000..2b5d50ed Binary files /dev/null and b/static/grappelli/img/icons/icon-admin_tools-dropdown-active-hover.png differ diff --git a/static/grappelli/img/icons/icon-admin_tools-dropdown-active.png b/static/grappelli/img/icons/icon-admin_tools-dropdown-active.png new file mode 100644 index 00000000..2f84846b Binary files /dev/null and b/static/grappelli/img/icons/icon-admin_tools-dropdown-active.png differ diff --git a/static/grappelli/img/icons/icon-admin_tools-dropdown-hover.png b/static/grappelli/img/icons/icon-admin_tools-dropdown-hover.png new file mode 100644 index 00000000..2f84846b Binary files /dev/null and b/static/grappelli/img/icons/icon-admin_tools-dropdown-hover.png differ diff --git a/static/grappelli/img/icons/icon-admin_tools-dropdown.png b/static/grappelli/img/icons/icon-admin_tools-dropdown.png new file mode 100644 index 00000000..f0f9906b Binary files /dev/null and b/static/grappelli/img/icons/icon-admin_tools-dropdown.png differ diff --git a/static/grappelli/img/icons/icon-autocomplete-fk-remove-hover.png b/static/grappelli/img/icons/icon-autocomplete-fk-remove-hover.png new file mode 100644 index 00000000..e34d1725 Binary files /dev/null and b/static/grappelli/img/icons/icon-autocomplete-fk-remove-hover.png differ diff --git a/static/grappelli/img/icons/icon-autocomplete-fk-remove.png b/static/grappelli/img/icons/icon-autocomplete-fk-remove.png new file mode 100644 index 00000000..5e23eb67 Binary files /dev/null and b/static/grappelli/img/icons/icon-autocomplete-fk-remove.png differ diff --git a/static/grappelli/img/icons/icon-autocomplete-m2m-remove-hover.png b/static/grappelli/img/icons/icon-autocomplete-m2m-remove-hover.png new file mode 100644 index 00000000..e34d1725 Binary files /dev/null and b/static/grappelli/img/icons/icon-autocomplete-m2m-remove-hover.png differ diff --git a/static/grappelli/img/icons/icon-autocomplete-m2m-remove.png b/static/grappelli/img/icons/icon-autocomplete-m2m-remove.png new file mode 100644 index 00000000..5e23eb67 Binary files /dev/null and b/static/grappelli/img/icons/icon-autocomplete-m2m-remove.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_add-hover.png b/static/grappelli/img/icons/icon-bookmark_add-hover.png new file mode 100644 index 00000000..992bd739 Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_add-hover.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_add-inactive.png b/static/grappelli/img/icons/icon-bookmark_add-inactive.png new file mode 100644 index 00000000..ca9eb1d7 Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_add-inactive.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_add.png b/static/grappelli/img/icons/icon-bookmark_add.png new file mode 100644 index 00000000..3d869503 Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_add.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_manage-hover.png b/static/grappelli/img/icons/icon-bookmark_manage-hover.png new file mode 100644 index 00000000..b7efbf8c Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_manage-hover.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_manage.png b/static/grappelli/img/icons/icon-bookmark_manage.png new file mode 100644 index 00000000..17e453be Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_manage.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_remove-hover.png b/static/grappelli/img/icons/icon-bookmark_remove-hover.png new file mode 100644 index 00000000..25c908de Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_remove-hover.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_remove-inactive.png b/static/grappelli/img/icons/icon-bookmark_remove-inactive.png new file mode 100644 index 00000000..c0f8a6b7 Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_remove-inactive.png differ diff --git a/static/grappelli/img/icons/icon-bookmark_remove.png b/static/grappelli/img/icons/icon-bookmark_remove.png new file mode 100644 index 00000000..84cb3cf8 Binary files /dev/null and b/static/grappelli/img/icons/icon-bookmark_remove.png differ diff --git a/static/grappelli/img/icons/icon-calendar-hover.png b/static/grappelli/img/icons/icon-calendar-hover.png new file mode 100644 index 00000000..de2b6cd1 Binary files /dev/null and b/static/grappelli/img/icons/icon-calendar-hover.png differ diff --git a/static/grappelli/img/icons/icon-calendar.png b/static/grappelli/img/icons/icon-calendar.png new file mode 100644 index 00000000..33793529 Binary files /dev/null and b/static/grappelli/img/icons/icon-calendar.png differ diff --git a/static/grappelli/img/icons/icon-calendarnav_next.png b/static/grappelli/img/icons/icon-calendarnav_next.png new file mode 100644 index 00000000..ab52bf82 Binary files /dev/null and b/static/grappelli/img/icons/icon-calendarnav_next.png differ diff --git a/static/grappelli/img/icons/icon-calendarnav_previous.png b/static/grappelli/img/icons/icon-calendarnav_previous.png new file mode 100644 index 00000000..47147a53 Binary files /dev/null and b/static/grappelli/img/icons/icon-calendarnav_previous.png differ diff --git a/static/grappelli/img/icons/icon-changelink-hover.png b/static/grappelli/img/icons/icon-changelink-hover.png new file mode 100644 index 00000000..52972274 Binary files /dev/null and b/static/grappelli/img/icons/icon-changelink-hover.png differ diff --git a/static/grappelli/img/icons/icon-changelink.png b/static/grappelli/img/icons/icon-changelink.png new file mode 100644 index 00000000..8f710299 Binary files /dev/null and b/static/grappelli/img/icons/icon-changelink.png differ diff --git a/static/grappelli/img/icons/icon-changelist-actions.png b/static/grappelli/img/icons/icon-changelist-actions.png new file mode 100644 index 00000000..3f297aff Binary files /dev/null and b/static/grappelli/img/icons/icon-changelist-actions.png differ diff --git a/static/grappelli/img/icons/icon-clock-hover.png b/static/grappelli/img/icons/icon-clock-hover.png new file mode 100644 index 00000000..a0610633 Binary files /dev/null and b/static/grappelli/img/icons/icon-clock-hover.png differ diff --git a/static/grappelli/img/icons/icon-clock.png b/static/grappelli/img/icons/icon-clock.png new file mode 100644 index 00000000..e39798bc Binary files /dev/null and b/static/grappelli/img/icons/icon-clock.png differ diff --git a/static/grappelli/img/icons/icon-date-hierarchy-back-hover.png b/static/grappelli/img/icons/icon-date-hierarchy-back-hover.png new file mode 100644 index 00000000..e28bc836 Binary files /dev/null and b/static/grappelli/img/icons/icon-date-hierarchy-back-hover.png differ diff --git a/static/grappelli/img/icons/icon-date-hierarchy-back.png b/static/grappelli/img/icons/icon-date-hierarchy-back.png new file mode 100644 index 00000000..665724b8 Binary files /dev/null and b/static/grappelli/img/icons/icon-date-hierarchy-back.png differ diff --git a/static/grappelli/img/icons/icon-datepicker-hover.png b/static/grappelli/img/icons/icon-datepicker-hover.png new file mode 100644 index 00000000..064ef4eb Binary files /dev/null and b/static/grappelli/img/icons/icon-datepicker-hover.png differ diff --git a/static/grappelli/img/icons/icon-datepicker.png b/static/grappelli/img/icons/icon-datepicker.png new file mode 100644 index 00000000..33793529 Binary files /dev/null and b/static/grappelli/img/icons/icon-datepicker.png differ diff --git a/static/grappelli/img/icons/icon-dropdown-hover.png b/static/grappelli/img/icons/icon-dropdown-hover.png new file mode 100644 index 00000000..10fedc76 Binary files /dev/null and b/static/grappelli/img/icons/icon-dropdown-hover.png differ diff --git a/static/grappelli/img/icons/icon-dropdown.png b/static/grappelli/img/icons/icon-dropdown.png new file mode 100644 index 00000000..7331ed53 Binary files /dev/null and b/static/grappelli/img/icons/icon-dropdown.png differ diff --git a/static/grappelli/img/icons/icon-edit-dashboard-toggle-handler-hover.png b/static/grappelli/img/icons/icon-edit-dashboard-toggle-handler-hover.png new file mode 100644 index 00000000..2b985c54 Binary files /dev/null and b/static/grappelli/img/icons/icon-edit-dashboard-toggle-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-edit-dashboard-toggle-handler.png b/static/grappelli/img/icons/icon-edit-dashboard-toggle-handler.png new file mode 100644 index 00000000..83008e45 Binary files /dev/null and b/static/grappelli/img/icons/icon-edit-dashboard-toggle-handler.png differ diff --git a/static/grappelli/img/icons/icon-fb-show-hover.png b/static/grappelli/img/icons/icon-fb-show-hover.png new file mode 100644 index 00000000..549e2619 Binary files /dev/null and b/static/grappelli/img/icons/icon-fb-show-hover.png differ diff --git a/static/grappelli/img/icons/icon-fb-show.png b/static/grappelli/img/icons/icon-fb-show.png new file mode 100644 index 00000000..886c05c3 Binary files /dev/null and b/static/grappelli/img/icons/icon-fb-show.png differ diff --git a/static/grappelli/img/icons/icon-fb_show-hover.png b/static/grappelli/img/icons/icon-fb_show-hover.png new file mode 100644 index 00000000..0b20b492 Binary files /dev/null and b/static/grappelli/img/icons/icon-fb_show-hover.png differ diff --git a/static/grappelli/img/icons/icon-fb_show.png b/static/grappelli/img/icons/icon-fb_show.png new file mode 100644 index 00000000..c5e796c0 Binary files /dev/null and b/static/grappelli/img/icons/icon-fb_show.png differ diff --git a/static/grappelli/img/icons/icon-form-select.png b/static/grappelli/img/icons/icon-form-select.png new file mode 100644 index 00000000..3591d503 Binary files /dev/null and b/static/grappelli/img/icons/icon-form-select.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-addhandler-hover.png b/static/grappelli/img/icons/icon-inline_item_tools-addhandler-hover.png new file mode 100644 index 00000000..33574179 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-addhandler-hover.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-addhandler.png b/static/grappelli/img/icons/icon-inline_item_tools-addhandler.png new file mode 100644 index 00000000..ef3c2494 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-addhandler.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-closehandler-hover.png b/static/grappelli/img/icons/icon-inline_item_tools-closehandler-hover.png new file mode 100644 index 00000000..cd186c85 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-closehandler-hover.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-closehandler.png b/static/grappelli/img/icons/icon-inline_item_tools-closehandler.png new file mode 100644 index 00000000..00edf99a Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-closehandler.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-deletelink-hover.png b/static/grappelli/img/icons/icon-inline_item_tools-deletelink-hover.png new file mode 100644 index 00000000..9834a873 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-deletelink-hover.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-deletelink.png b/static/grappelli/img/icons/icon-inline_item_tools-deletelink.png new file mode 100644 index 00000000..3bf18612 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-deletelink.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-draghandler-hover.png b/static/grappelli/img/icons/icon-inline_item_tools-draghandler-hover.png new file mode 100644 index 00000000..57f40775 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-draghandler-hover.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-draghandler.png b/static/grappelli/img/icons/icon-inline_item_tools-draghandler.png new file mode 100644 index 00000000..477e26ea Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-draghandler.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-openhandler-hover.png b/static/grappelli/img/icons/icon-inline_item_tools-openhandler-hover.png new file mode 100644 index 00000000..d82b6401 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-openhandler-hover.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-openhandler.png b/static/grappelli/img/icons/icon-inline_item_tools-openhandler.png new file mode 100644 index 00000000..a250eed5 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-openhandler.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-viewsitelink-hover.png b/static/grappelli/img/icons/icon-inline_item_tools-viewsitelink-hover.png new file mode 100644 index 00000000..a4d35717 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-viewsitelink-hover.png differ diff --git a/static/grappelli/img/icons/icon-inline_item_tools-viewsitelink.png b/static/grappelli/img/icons/icon-inline_item_tools-viewsitelink.png new file mode 100644 index 00000000..06f38e32 Binary files /dev/null and b/static/grappelli/img/icons/icon-inline_item_tools-viewsitelink.png differ diff --git a/static/grappelli/img/icons/icon-menulist_external-hover.png b/static/grappelli/img/icons/icon-menulist_external-hover.png new file mode 100644 index 00000000..30b34906 Binary files /dev/null and b/static/grappelli/img/icons/icon-menulist_external-hover.png differ diff --git a/static/grappelli/img/icons/icon-menulist_external.png b/static/grappelli/img/icons/icon-menulist_external.png new file mode 100644 index 00000000..0cc28832 Binary files /dev/null and b/static/grappelli/img/icons/icon-menulist_external.png differ diff --git a/static/grappelli/img/icons/icon-menulist_internal-hover.png b/static/grappelli/img/icons/icon-menulist_internal-hover.png new file mode 100644 index 00000000..a99d4a1e Binary files /dev/null and b/static/grappelli/img/icons/icon-menulist_internal-hover.png differ diff --git a/static/grappelli/img/icons/icon-menulist_internal.png b/static/grappelli/img/icons/icon-menulist_internal.png new file mode 100644 index 00000000..30356322 Binary files /dev/null and b/static/grappelli/img/icons/icon-menulist_internal.png differ diff --git a/static/grappelli/img/icons/icon-navigation-external-hover.png b/static/grappelli/img/icons/icon-navigation-external-hover.png new file mode 100644 index 00000000..30b34906 Binary files /dev/null and b/static/grappelli/img/icons/icon-navigation-external-hover.png differ diff --git a/static/grappelli/img/icons/icon-navigation-external.png b/static/grappelli/img/icons/icon-navigation-external.png new file mode 100644 index 00000000..0cc28832 Binary files /dev/null and b/static/grappelli/img/icons/icon-navigation-external.png differ diff --git a/static/grappelli/img/icons/icon-navigation-internal-hover.png b/static/grappelli/img/icons/icon-navigation-internal-hover.png new file mode 100644 index 00000000..a99d4a1e Binary files /dev/null and b/static/grappelli/img/icons/icon-navigation-internal-hover.png differ diff --git a/static/grappelli/img/icons/icon-navigation-internal.png b/static/grappelli/img/icons/icon-navigation-internal.png new file mode 100644 index 00000000..30356322 Binary files /dev/null and b/static/grappelli/img/icons/icon-navigation-internal.png differ diff --git a/static/grappelli/img/icons/icon-no.png b/static/grappelli/img/icons/icon-no.png new file mode 100644 index 00000000..91fac439 Binary files /dev/null and b/static/grappelli/img/icons/icon-no.png differ diff --git a/static/grappelli/img/icons/icon-object-tools-add-handler.png b/static/grappelli/img/icons/icon-object-tools-add-handler.png new file mode 100644 index 00000000..a3621b5e Binary files /dev/null and b/static/grappelli/img/icons/icon-object-tools-add-handler.png differ diff --git a/static/grappelli/img/icons/icon-related-lookup-hover.png b/static/grappelli/img/icons/icon-related-lookup-hover.png new file mode 100644 index 00000000..549e2619 Binary files /dev/null and b/static/grappelli/img/icons/icon-related-lookup-hover.png differ diff --git a/static/grappelli/img/icons/icon-related-lookup-m2m-hover.png b/static/grappelli/img/icons/icon-related-lookup-m2m-hover.png new file mode 100644 index 00000000..6f816a4f Binary files /dev/null and b/static/grappelli/img/icons/icon-related-lookup-m2m-hover.png differ diff --git a/static/grappelli/img/icons/icon-related-lookup-m2m.png b/static/grappelli/img/icons/icon-related-lookup-m2m.png new file mode 100644 index 00000000..1062a58a Binary files /dev/null and b/static/grappelli/img/icons/icon-related-lookup-m2m.png differ diff --git a/static/grappelli/img/icons/icon-related-lookup.png b/static/grappelli/img/icons/icon-related-lookup.png new file mode 100644 index 00000000..b14a9cd3 Binary files /dev/null and b/static/grappelli/img/icons/icon-related-lookup.png differ diff --git a/static/grappelli/img/icons/icon-related_lookup-hover.png b/static/grappelli/img/icons/icon-related_lookup-hover.png new file mode 100644 index 00000000..549e2619 Binary files /dev/null and b/static/grappelli/img/icons/icon-related_lookup-hover.png differ diff --git a/static/grappelli/img/icons/icon-related_lookup.png b/static/grappelli/img/icons/icon-related_lookup.png new file mode 100644 index 00000000..b14a9cd3 Binary files /dev/null and b/static/grappelli/img/icons/icon-related_lookup.png differ diff --git a/static/grappelli/img/icons/icon-remove-related-hover.png b/static/grappelli/img/icons/icon-remove-related-hover.png new file mode 100644 index 00000000..0de8ec19 Binary files /dev/null and b/static/grappelli/img/icons/icon-remove-related-hover.png differ diff --git a/static/grappelli/img/icons/icon-remove-related.png b/static/grappelli/img/icons/icon-remove-related.png new file mode 100644 index 00000000..308fb6c5 Binary files /dev/null and b/static/grappelli/img/icons/icon-remove-related.png differ diff --git a/static/grappelli/img/icons/icon-search-hover.png b/static/grappelli/img/icons/icon-search-hover.png new file mode 100644 index 00000000..549e2619 Binary files /dev/null and b/static/grappelli/img/icons/icon-search-hover.png differ diff --git a/static/grappelli/img/icons/icon-search.png b/static/grappelli/img/icons/icon-search.png new file mode 100644 index 00000000..b14a9cd3 Binary files /dev/null and b/static/grappelli/img/icons/icon-search.png differ diff --git a/static/grappelli/img/icons/icon-searchbox.png b/static/grappelli/img/icons/icon-searchbox.png new file mode 100644 index 00000000..9a9090de Binary files /dev/null and b/static/grappelli/img/icons/icon-searchbox.png differ diff --git a/static/grappelli/img/icons/icon-selector_add-m2m_horizontal-hover.png b/static/grappelli/img/icons/icon-selector_add-m2m_horizontal-hover.png new file mode 100644 index 00000000..f19a6c88 Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_add-m2m_horizontal-hover.png differ diff --git a/static/grappelli/img/icons/icon-selector_add-m2m_horizontal.png b/static/grappelli/img/icons/icon-selector_add-m2m_horizontal.png new file mode 100644 index 00000000..7ba54992 Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_add-m2m_horizontal.png differ diff --git a/static/grappelli/img/icons/icon-selector_add-m2m_vertical-hover.png b/static/grappelli/img/icons/icon-selector_add-m2m_vertical-hover.png new file mode 100644 index 00000000..6be1d750 Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_add-m2m_vertical-hover.png differ diff --git a/static/grappelli/img/icons/icon-selector_add-m2m_vertical.png b/static/grappelli/img/icons/icon-selector_add-m2m_vertical.png new file mode 100644 index 00000000..0f53ca3b Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_add-m2m_vertical.png differ diff --git a/static/grappelli/img/icons/icon-selector_filter.png b/static/grappelli/img/icons/icon-selector_filter.png new file mode 100644 index 00000000..9c39774d Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_filter.png differ diff --git a/static/grappelli/img/icons/icon-selector_remove-m2m_horizontal-hover.png b/static/grappelli/img/icons/icon-selector_remove-m2m_horizontal-hover.png new file mode 100644 index 00000000..9bfb7424 Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_remove-m2m_horizontal-hover.png differ diff --git a/static/grappelli/img/icons/icon-selector_remove-m2m_horizontal.png b/static/grappelli/img/icons/icon-selector_remove-m2m_horizontal.png new file mode 100644 index 00000000..a6bdc7c0 Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_remove-m2m_horizontal.png differ diff --git a/static/grappelli/img/icons/icon-selector_remove-m2m_vertical-hover.png b/static/grappelli/img/icons/icon-selector_remove-m2m_vertical-hover.png new file mode 100644 index 00000000..943945ce Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_remove-m2m_vertical-hover.png differ diff --git a/static/grappelli/img/icons/icon-selector_remove-m2m_vertical.png b/static/grappelli/img/icons/icon-selector_remove-m2m_vertical.png new file mode 100644 index 00000000..ee330c98 Binary files /dev/null and b/static/grappelli/img/icons/icon-selector_remove-m2m_vertical.png differ diff --git a/static/grappelli/img/icons/icon-th-ascending.png b/static/grappelli/img/icons/icon-th-ascending.png new file mode 100644 index 00000000..24dda0af Binary files /dev/null and b/static/grappelli/img/icons/icon-th-ascending.png differ diff --git a/static/grappelli/img/icons/icon-th-descending.png b/static/grappelli/img/icons/icon-th-descending.png new file mode 100644 index 00000000..32fb3fb8 Binary files /dev/null and b/static/grappelli/img/icons/icon-th-descending.png differ diff --git a/static/grappelli/img/icons/icon-timepicker-hover.png b/static/grappelli/img/icons/icon-timepicker-hover.png new file mode 100644 index 00000000..a0610633 Binary files /dev/null and b/static/grappelli/img/icons/icon-timepicker-hover.png differ diff --git a/static/grappelli/img/icons/icon-timepicker.png b/static/grappelli/img/icons/icon-timepicker.png new file mode 100644 index 00000000..e39798bc Binary files /dev/null and b/static/grappelli/img/icons/icon-timepicker.png differ diff --git a/static/grappelli/img/icons/icon-tools-add-handler-hover.png b/static/grappelli/img/icons/icon-tools-add-handler-hover.png new file mode 100644 index 00000000..48a23a18 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-add-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-add-handler.png b/static/grappelli/img/icons/icon-tools-add-handler.png new file mode 100644 index 00000000..e9bf71bb Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-add-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-arrow-down-handler-hover.png b/static/grappelli/img/icons/icon-tools-arrow-down-handler-hover.png new file mode 100644 index 00000000..f3591fd5 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-arrow-down-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-arrow-down-handler.png b/static/grappelli/img/icons/icon-tools-arrow-down-handler.png new file mode 100644 index 00000000..e40c93e5 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-arrow-down-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-arrow-up-handler-hover.png b/static/grappelli/img/icons/icon-tools-arrow-up-handler-hover.png new file mode 100644 index 00000000..26ef6437 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-arrow-up-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-arrow-up-handler.png b/static/grappelli/img/icons/icon-tools-arrow-up-handler.png new file mode 100644 index 00000000..2e15e77c Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-arrow-up-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-close-handler-hover.png b/static/grappelli/img/icons/icon-tools-close-handler-hover.png new file mode 100644 index 00000000..b51722f4 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-close-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-close-handler.png b/static/grappelli/img/icons/icon-tools-close-handler.png new file mode 100644 index 00000000..2c5e650a Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-close-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-delete-handler-hover.png b/static/grappelli/img/icons/icon-tools-delete-handler-hover.png new file mode 100644 index 00000000..90ce6408 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-delete-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-delete-handler.png b/static/grappelli/img/icons/icon-tools-delete-handler.png new file mode 100644 index 00000000..7708b402 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-delete-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-drag-handler-hover.png b/static/grappelli/img/icons/icon-tools-drag-handler-hover.png new file mode 100644 index 00000000..0f62eb9e Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-drag-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-drag-handler.png b/static/grappelli/img/icons/icon-tools-drag-handler.png new file mode 100644 index 00000000..6f7421bd Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-drag-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-open-handler-hover.png b/static/grappelli/img/icons/icon-tools-open-handler-hover.png new file mode 100644 index 00000000..655d944c Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-open-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-open-handler.png b/static/grappelli/img/icons/icon-tools-open-handler.png new file mode 100644 index 00000000..24169925 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-open-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-remove-handler-hover.png b/static/grappelli/img/icons/icon-tools-remove-handler-hover.png new file mode 100644 index 00000000..c10c90b6 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-remove-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-remove-handler.png b/static/grappelli/img/icons/icon-tools-remove-handler.png new file mode 100644 index 00000000..eefa1459 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-remove-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-trash-handler-hover.png b/static/grappelli/img/icons/icon-tools-trash-handler-hover.png new file mode 100644 index 00000000..4eeec6f8 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-trash-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-trash-handler.png b/static/grappelli/img/icons/icon-tools-trash-handler.png new file mode 100644 index 00000000..7d4a6f78 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-trash-handler.png differ diff --git a/static/grappelli/img/icons/icon-tools-viewsite-link-hover.png b/static/grappelli/img/icons/icon-tools-viewsite-link-hover.png new file mode 100644 index 00000000..5bf16deb Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-viewsite-link-hover.png differ diff --git a/static/grappelli/img/icons/icon-tools-viewsite-link.png b/static/grappelli/img/icons/icon-tools-viewsite-link.png new file mode 100644 index 00000000..9f678a86 Binary files /dev/null and b/static/grappelli/img/icons/icon-tools-viewsite-link.png differ diff --git a/static/grappelli/img/icons/icon-trash-list-toggle-handler-hover.png b/static/grappelli/img/icons/icon-trash-list-toggle-handler-hover.png new file mode 100644 index 00000000..22057833 Binary files /dev/null and b/static/grappelli/img/icons/icon-trash-list-toggle-handler-hover.png differ diff --git a/static/grappelli/img/icons/icon-trash-list-toggle-handler.png b/static/grappelli/img/icons/icon-trash-list-toggle-handler.png new file mode 100644 index 00000000..81593993 Binary files /dev/null and b/static/grappelli/img/icons/icon-trash-list-toggle-handler.png differ diff --git a/static/grappelli/img/icons/icon-unknown.png b/static/grappelli/img/icons/icon-unknown.png new file mode 100644 index 00000000..0b7d1809 Binary files /dev/null and b/static/grappelli/img/icons/icon-unknown.png differ diff --git a/static/grappelli/img/icons/icon-yes.png b/static/grappelli/img/icons/icon-yes.png new file mode 100644 index 00000000..2f140794 Binary files /dev/null and b/static/grappelli/img/icons/icon-yes.png differ diff --git a/static/grappelli/img/icons/icon_fieldset_collapse-closed.png b/static/grappelli/img/icons/icon_fieldset_collapse-closed.png new file mode 100644 index 00000000..94b609a7 Binary files /dev/null and b/static/grappelli/img/icons/icon_fieldset_collapse-closed.png differ diff --git a/static/grappelli/img/icons/icon_fieldset_collapse-open.png b/static/grappelli/img/icons/icon_fieldset_collapse-open.png new file mode 100644 index 00000000..9854a65c Binary files /dev/null and b/static/grappelli/img/icons/icon_fieldset_collapse-open.png differ diff --git a/static/grappelli/img/icons/icon_inline-item-tools_addhandler.png b/static/grappelli/img/icons/icon_inline-item-tools_addhandler.png new file mode 100644 index 00000000..a3e1d384 Binary files /dev/null and b/static/grappelli/img/icons/icon_inline-item-tools_addhandler.png differ diff --git a/static/grappelli/img/icons/icon_inline-item-tools_closehandler.png b/static/grappelli/img/icons/icon_inline-item-tools_closehandler.png new file mode 100644 index 00000000..c3183bf3 Binary files /dev/null and b/static/grappelli/img/icons/icon_inline-item-tools_closehandler.png differ diff --git a/static/grappelli/img/icons/icon_inline-item-tools_openhandler.png b/static/grappelli/img/icons/icon_inline-item-tools_openhandler.png new file mode 100644 index 00000000..8119d8ee Binary files /dev/null and b/static/grappelli/img/icons/icon_inline-item-tools_openhandler.png differ diff --git a/static/grappelli/img/icons/ui-datepicker-next-hover.png b/static/grappelli/img/icons/ui-datepicker-next-hover.png new file mode 100644 index 00000000..b508453f Binary files /dev/null and b/static/grappelli/img/icons/ui-datepicker-next-hover.png differ diff --git a/static/grappelli/img/icons/ui-datepicker-next.png b/static/grappelli/img/icons/ui-datepicker-next.png new file mode 100644 index 00000000..f45aa1a4 Binary files /dev/null and b/static/grappelli/img/icons/ui-datepicker-next.png differ diff --git a/static/grappelli/img/icons/ui-datepicker-prev-hover.png b/static/grappelli/img/icons/ui-datepicker-prev-hover.png new file mode 100644 index 00000000..8ca2c402 Binary files /dev/null and b/static/grappelli/img/icons/ui-datepicker-prev-hover.png differ diff --git a/static/grappelli/img/icons/ui-datepicker-prev.png b/static/grappelli/img/icons/ui-datepicker-prev.png new file mode 100644 index 00000000..adbc08ac Binary files /dev/null and b/static/grappelli/img/icons/ui-datepicker-prev.png differ diff --git a/static/grappelli/img/input-throbber.gif b/static/grappelli/img/input-throbber.gif new file mode 100644 index 00000000..19c2e0a3 Binary files /dev/null and b/static/grappelli/img/input-throbber.gif differ diff --git a/static/grappelli/jquery/i18n/ui.datepicker-de.js b/static/grappelli/jquery/i18n/ui.datepicker-de.js new file mode 100644 index 00000000..4a7447ca --- /dev/null +++ b/static/grappelli/jquery/i18n/ui.datepicker-de.js @@ -0,0 +1,20 @@ +/* German initialisation for the jQuery UI date picker plugin. */ +/* Written by Milian Wolff (mail@milianw.de). */ +(function($){ + $.datepicker.regional['de'] = { + closeText: 'schließen', + prevText: '<zurück', + nextText: 'Vor>', + currentText: 'heute', + monthNames: ['Januar','Februar','März','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dez'], + dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], + dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dateFormat: 'yy-mm-dd', firstDay: 1, + isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['de']); +})(grp.jQuery); + diff --git a/static/grappelli/jquery/i18n/ui.datepicker-fr.js b/static/grappelli/jquery/i18n/ui.datepicker-fr.js new file mode 100644 index 00000000..f4e6df8b --- /dev/null +++ b/static/grappelli/jquery/i18n/ui.datepicker-fr.js @@ -0,0 +1,19 @@ +/* French initialisation for the jQuery UI date picker plugin. */ +/* Written by Keith Wood (kbwood@virginbroadband.com.au) and Stéphane Nahmani (sholby@sholby.net). */ +(function($){ + $.datepicker.regional['fr'] = { + closeText: 'Fermer', + prevText: '<Préc', + nextText: 'Suiv>', + currentText: 'Courant', + monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], + monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', + 'Jul','Aoû','Sep','Oct','Nov','Déc'], + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], + dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], + dateFormat: 'yy-mm-dd', firstDay: 1, + isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['fr']); +})(grp.jQuery); diff --git a/static/grappelli/jquery/jquery-1.4.2.min.js b/static/grappelli/jquery/jquery-1.4.2.min.js new file mode 100644 index 00000000..7c243080 --- /dev/null +++ b/static/grappelli/jquery/jquery-1.4.2.min.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(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 X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(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(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.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,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +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:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.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 fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=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 h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.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,h,l){return!!k(l[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,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},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){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},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,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===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 Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._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!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).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,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}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,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});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||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).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,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},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,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},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:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+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);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},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=J(),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 f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,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
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.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(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/static/grappelli/jquery/jquery-1.6.2.min.js b/static/grappelli/jquery/jquery-1.6.2.min.js new file mode 100644 index 00000000..48590ecb --- /dev/null +++ b/static/grappelli/jquery/jquery-1.6.2.min.js @@ -0,0 +1,18 @@ +/*! + * jQuery JavaScript Library v1.6.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Jun 30 14:16:56 2011 -0400 + */ +(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(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){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,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=n.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.6.2",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.done(a);return this},eq:function(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.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();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},isNaN:function(a){return a==null||!m.test(a)||isNaN(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;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw 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(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},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,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?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([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&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.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}})}}),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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=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},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. +shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.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(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.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]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),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]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.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!!k(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=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([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.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":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=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=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(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.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:[]}},l.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&&(l.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")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[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}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.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 k(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;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;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||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());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(V(c[0])||V(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),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.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 X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._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){return this.each(function(){f(this).wrapAll(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(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,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());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(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$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=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},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(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");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&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.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 bo.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;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,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=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,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.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.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(bL,"")).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||bM.test(this.nodeName)||bG.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(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[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","*":"*/*"},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}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),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?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),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._Deferred(),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=bF.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.done,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(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.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]!=="*"?", */*; 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=bX(bS,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){status<2?w(-1,z):f.error(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)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),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&&(ca.test(b.url)||e&&ca.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(ca,l),b.url===j&&(e&&(k=k.replace(ca,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 cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,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,cb&&delete cd[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=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-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=cu.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&&!cu.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=cv(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=cv(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")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):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];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["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 h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/static/grappelli/jquery/jquery-1.7.2.min.js b/static/grappelli/jquery/jquery-1.7.2.min.js new file mode 100644 index 00000000..16ad06c5 --- /dev/null +++ b/static/grappelli/jquery/jquery-1.7.2.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 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 cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(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(;e=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)?+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.2",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!=null&&a==a.window},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){if(typeof c!="string"||!c)return null;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=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.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:p.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,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});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;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-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.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];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,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\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,g=p.selector),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&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?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));o.match.globalPOS=p;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|bdi|canvas|data|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:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],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){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},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){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.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(;d1&&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||f.isXMLDoc(a)||!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,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$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))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=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)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.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(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),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)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.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(bM,"")).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||bN.test(this.nodeName)||bH.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(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\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:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},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:bY(bS),ajaxTransport:bY(bT),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?ca(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=cb(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=bG.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(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.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]!=="*"?", "+bW+"; 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=bZ(bT,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)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.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(cd,l),b.url===j&&(e&&(k=k.replace(cd,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 ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,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,ce&&delete cg[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);try{m.text=h.responseText}catch(a){}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=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("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({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),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/static/grappelli/jquery/jquery-1.9.1.min.js b/static/grappelli/jquery/jquery-1.9.1.min.js new file mode 100644 index 00000000..006e9531 --- /dev/null +++ b/static/grappelli/jquery/jquery-1.9.1.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery.min.map +*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="
t
",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; +return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="
",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) +}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("': +"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, +e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ +(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? +a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, +e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, +"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; +if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== +"string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.15";window["DP_jQuery_"+B]=d})(jQuery); +; \ No newline at end of file diff --git a/static/grappelli/jquery/ui/js/jquery-ui-1.8.18.custom.min.js b/static/grappelli/jquery/ui/js/jquery-ui-1.8.18.custom.min.js new file mode 100644 index 00000000..f00a62f1 --- /dev/null +++ b/static/grappelli/jquery/ui/js/jquery-ui-1.8.18.custom.min.js @@ -0,0 +1,356 @@ +/*! + * jQuery UI 1.8.18 + * + * 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(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",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}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_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(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* + * jQuery UI Position 1.8.18 + * + * 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(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* + * jQuery UI Draggable 1.8.18 + * + * 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(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){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(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.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},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.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";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.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()}}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,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* + * jQuery UI Selectable 1.8.18 + * + * 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/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),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"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=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 c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}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(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"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(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/* + * jQuery UI Autocomplete 1.8.18 + * + * 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/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("
    ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):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",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},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(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* + * jQuery UI Dialog 1.8.18 + * + * 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/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
    ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
    ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Tabs 1.8.18 + * + * 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/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(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"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},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 b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(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"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
    ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
    '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
    ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
    '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
    '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
    "+(j?""+(g[0]>0&&N==g[1]-1?'
    ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""), +a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
    ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
    ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* + * jQuery UI Progressbar 1.8.18 + * + * 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/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
    ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Effects 1.8.18 + * + * 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/Effects/ + */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* + * jQuery UI Effects Fade 1.8.18 + * + * 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/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Fold 1.8.18 + * + * 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/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* + * jQuery UI Effects Highlight 1.8.18 + * + * 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/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Pulsate 1.8.18 + * + * 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/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/static/grappelli/jquery/ui/js/jquery-ui-1.8.5.custom.min.js b/static/grappelli/jquery/ui/js/jquery-ui-1.8.5.custom.min.js new file mode 100644 index 00000000..827b5f05 --- /dev/null +++ b/static/grappelli/jquery/ui/js/jquery-ui-1.8.5.custom.min.js @@ -0,0 +1,778 @@ +/*! + * jQuery UI 1.8.5 + * + * Copyright 2010, 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.5",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"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.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.style(this,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.style(this, +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.createElement("div"),b=document.body;c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.appendChild(a).offsetHeight===100;b.removeChild(a).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=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.5 + * + * Copyright 2010, 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.scrollTo&&d.document){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=parseInt(i.left);i.top=parseInt(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.5 + * + * Copyright 2010, 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)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=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(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').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), +d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", +b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; +f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", +b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top= +a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, +k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ +a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this, +arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable, +{version:"1.8.5"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize, +function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n= +(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition= +false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left- +a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize", +b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top", +"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset, +f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left= +a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+ +a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&& +e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative", +height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width= +d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Selectable 1.8.5 + * + * Copyright 2010, 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/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",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();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}}}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.topthis.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 li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");a.active=f.length?f:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",function(g){return a._keydown(g)}).next().attr("role", +"tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(g){a._clickHandler.call(a,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers); +this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(g){c(a.target).attr("tabIndex",-1);c(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); +a.next().addClass("ui-accordion-content-active")}h=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):h,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(h,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},h=this.active=c([]);this._toggle(h,f,g)}},_toggle:function(a,b,d,f,g){var h=this,e=h.options;h.toShow=a;h.toHide=b;h.data=d;var j=function(){if(h)return h._completed.apply(h,arguments)};h._trigger("changestart",null,h.data);h.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),toHide:b,complete:j, +down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!f[k]&&!c.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:i||700})}); +f[k](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.5",animations:{slide:function(a, +b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},h={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){h[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);g[i]={value:j[1], +unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(h,{step:function(j,i){if(i.prop=="height")f=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=f*g[i.prop].value+g[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide", +paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +;/* + * jQuery UI Autocomplete 1.8.5 + * + * Copyright 2010, 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/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function(e){e.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},_create:function(){var a=this,b=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!a.options.disabled){var d=e.ui.keyCode;switch(c.keyCode){case d.PAGE_UP:a._move("previousPage", +c);break;case d.PAGE_DOWN:a._move("nextPage",c);break;case d.UP:a._move("previous",c);c.preventDefault();break;case d.DOWN:a._move("next",c);c.preventDefault();break;case d.ENTER:case d.NUMPAD_ENTER:a.menu.element.is(":visible")&&c.preventDefault();case d.TAB:if(!a.menu.active)return;a.menu.select(c);break;case d.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay); +break}}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=e("
      ").addClass("ui-autocomplete").appendTo(e(this.options.appendTo||"body",b)[0]).mousedown(function(c){var d=a.menu.element[0]; +c.target===d&&setTimeout(function(){e(document).one("mousedown",function(f){f.target!==a.element[0]&&f.target!==d&&!e.ui.contains(d,f.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,d){d=d.item.data("item.autocomplete");false!==a._trigger("focus",null,{item:d})&&/^key/.test(c.originalEvent.type)&&a.element.val(d.value)},selected:function(c,d){d=d.item.data("item.autocomplete");var f=a.previous;if(a.element[0]!==b.activeElement){a.element.focus(); +a.previous=f}if(false!==a._trigger("select",c,{item:d})){a.term=d.value;a.element.val(d.value)}a.close(c);a.selectedItem=d},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");e.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();e.Widget.prototype.destroy.call(this)},_setOption:function(a,b){e.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(e(b||"body",this.element[0].ownerDocument)[0])},_initSource:function(){var a=this,b,c;if(e.isArray(this.options.source)){b=this.options.source;this.source=function(d,f){f(e.ui.autocomplete.filter(b,d.term))}}else if(typeof this.options.source==="string"){c=this.options.source;this.source= +function(d,f){a.xhr&&a.xhr.abort();a.xhr=e.getJSON(c,d,function(g,i,h){h===a.xhr&&f(g);a.xhr=null})}}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(e("").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}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}, +filter:function(a,b){var c=new RegExp(e.ui.autocomplete.escapeRegex(b),"i");return e.grep(a,function(d){return c.test(d.label||d.value||d)})}})})(jQuery); +(function(e){e.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){if(e(b.target).closest(".ui-menu-item a").length){b.preventDefault();a.select(b)}});this.refresh()},refresh:function(){var a=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(b){a.activate(b,e(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.attr("scrollTop"),f=this.element.height();if(c<0)this.element.attr("scrollTop",d+c);else c>=f&&this.element.attr("scrollTop",d+c-f+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})}, +deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},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(a,b,c){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0); +a.length?this.activate(c,a):this.activate(c,this.element.children(b))}else this.activate(c,this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(":first"));else{var b=this.active.offset().top,c=this.element.height(),d=this.element.children("li").filter(function(){var f=e(this).offset().top-b-c+e(this).height();return f<10&&f>-10});d.length||(d=this.element.children(":last"));this.activate(a,d)}else this.activate(a,this.element.children(!this.active|| +this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(":last"));else{var b=this.active.offset().top,c=this.element.height();result=this.element.children("li").filter(function(){var d=e(this).offset().top-b+c-e(this).height();return d<10&&d>-10});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))}, +hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary"); +this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":visible").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end().end()}, +destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); +;/* + * jQuery UI Dialog 1.8.5 + * + * Copyright 2010, 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/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function(c,j){c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title"); +if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",f=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
      ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog", +"aria-labelledby":f}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var e=(a.uiDialogTitlebar=c("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i); +return false}).appendTo(e);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id",f).html(d).prependTo(e);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;e.find("*").add(e).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&& +g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog"); +b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0])d=Math.max(d,c(this).css("z-index"))});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,f=d.options;if(f.modal&&!a||!f.stack&&!f.modal)return d._trigger("focus",b);if(f.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ= +f.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;d.next().length&&d.appendTo("body");a._size();a._position(b.position);d.show(b.show); +a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(f){if(f.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),e=g.filter(":first");g=g.filter(":last");if(f.target===g[0]&&!f.shiftKey){e.focus(1);return false}else if(f.target===e[0]&&f.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false, +f=c("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
      ").addClass("ui-dialog-buttonset").appendTo(f);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(e,h){h=c.isFunction(h)?{click:h,text:e}:h;e=c("",h).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&e.button()});f.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(e){return{position:e.position, +offset:e.offset}}var b=this,d=b.options,f=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(e,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",e,a(h))},drag:function(e,h){b._trigger("drag",e,a(h))},stop:function(e,h){d.position=[h.position.left-f.scrollLeft(),h.position.top-f.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g); +b._trigger("dragStop",e,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}a=a===j?this.options.resizable:a;var d=this,f=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:d._minHeight(), +handles:a,start:function(e,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",e,b(h))},resize:function(e,h){d._trigger("resize",e,b(h))},stop:function(e,h){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();d._trigger("resizeStop",e,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight, +a.height)},_position:function(a){var b=[],d=[0,0],f;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,e){if(+b[g]===b[g]){d[g]=b[g];b[g]=e}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(f=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a); +f||this.uiDialog.hide()},_setOption:function(a,b){var d=this,f=d.uiDialog,g=f.is(":data(resizable)"),e=false;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);e=true;break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":f.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case "draggable":b? +d._makeDraggable():f.draggable("destroy");break;case "height":e=true;break;case "maxHeight":g&&f.resizable("option","maxHeight",b);e=true;break;case "maxWidth":g&&f.resizable("option","maxWidth",b);e=true;break;case "minHeight":g&&f.resizable("option","minHeight",b);e=true;break;case "minWidth":g&&f.resizable("option","minWidth",b);e=true;break;case "position":d._position(b);break;case "resizable":g&&!b&&f.resizable("destroy");g&&typeof b==="string"&&f.resizable("option","handles",b);!g&&b!==false&& +d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break;case "width":e=true;break}c.Widget.prototype._setOption.apply(d,arguments);e&&d._size()},_size:function(){var a=this.options,b;this.element.css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();this.element.css(a.height==="auto"?{minHeight:Math.max(a.minHeight-b,0),height:c.support.minHeight?"auto":Math.max(a.minHeight- +b,0)}:{minHeight:0,height:Math.max(a.height-b,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.5",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), +function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){this.oldInstances.push(this.instances.splice(c.inArray(a,this.instances),1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var b=0;c.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var a, +b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("
      ");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); +if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur(); +else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= +false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");h=a._start(c,f);if(h===false)return}break}i=a.options.step;h=a.options.values&&a.options.values.length?(g=a.values(f)):(g=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=a._valueMin();break;case d.ui.keyCode.END:g=a._valueMax();break;case d.ui.keyCode.PAGE_UP:g=a._trimAlignValue(h+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=a._trimAlignValue(h-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== +a._valueMax())return;g=a._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===a._valueMin())return;g=a._trimAlignValue(h-i);break}a._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); +this._mouseDestroy();return this},_mouseCapture:function(a){var b=this.options,c,e,f,h,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(b.range===true&&this.values(1)===b.min){g+=1;f=d(this.handles[g])}if(this._start(a, +g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();b=f.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-f.width()/2,top:a.pageY-b.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= +this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= +this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); +c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;fthis._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= +this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({width:f- +g+"%"},{queue:false,duration:b.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:b.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"}, +b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.5"})})(jQuery); +;/* + * jQuery UI Tabs 1.8.5 + * + * Copyright 2010, 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/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
    • #{label}
    • "},_create:function(){this._tabify(true)},_setOption:function(a,e){if(a=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[a]=e;this._tabify()}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var a=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[a].concat(d.makeArray(arguments)))},_ui:function(a,e){return{tab:a,panel:e,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var a= +d(this);a.html(a.data("label.tabs")).removeData("label.tabs")})},_tabify:function(a){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var b=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))b.panels=b.panels.add(b._sanitizeSelector(i));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=b._tabId(f);f.href="#"+i;f=d("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(b.panels[g-1]||b.list);f.data("destroy.tabs",true)}b.panels=b.panels.add(f)}else c.disabled.push(g)});if(a){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(b._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 b.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){this.panels.eq(c.selected).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");b.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[c.selected],b.panels[c.selected]))});this.load(c.selected)}d(window).bind("unload",function(){b.lis.add(b.anchors).unbind(".tabs");b.lis=b.anchors=b.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);a=0;for(var j;j=this.lis[a];a++)d(j)[d.inArray(a,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);b._trigger("show", +null,b._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");b._trigger("show",null,b._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){b.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);b.element.dequeue("tabs")})}:function(g,f){b.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");b.element.dequeue("tabs")};this.anchors.bind(c.event+".tabs", +function(){var g=this,f=d(g).closest("li"),i=b.panels.filter(":not(.ui-tabs-hide)"),l=d(b._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||b.panels.filter(":animated").length||b._trigger("select",null,b._ui(this,l[0]))===false){this.blur();return false}c.selected=b.anchors.index(this);b.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=-1;c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs", +function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs",function(){r(g,l)});b.load(b.anchors.index(this));this.blur();return false}c.cookie&&b._cookie(c.selected,c.cookie);if(l.length){i.length&&b.element.queue("tabs",function(){s(g,i)});b.element.queue("tabs",function(){r(g,l)});b.load(b.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(a){if(typeof a=="string")a=this.anchors.index(this.anchors.filter("[href$="+a+"]"));return a},destroy:function(){var a=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 b=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){b.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")});a.cookie&&this._cookie(null,a.cookie);return this},add:function(a,e,b){if(b===p)b=this.anchors.length; +var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,a).replace(/#\{label\}/g,e));a=!a.indexOf("#")?a.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=d("#"+a);j.length||(j=d(h.panelTemplate).attr("id",a).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(b>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[b]); +j.insertBefore(this.panels[b])}h.disabled=d.map(h.disabled,function(k){return k>=b?++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[b],this.panels[b]));return this},remove:function(a){a=this._getIndex(a);var e=this.options,b=this.lis.eq(a).remove(),c=this.panels.eq(a).remove(); +if(b.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(a+(a+1=a?--h:h});this._tabify();this._trigger("remove",null,this._ui(b.find("a")[0],c[0]));return this},enable:function(a){a=this._getIndex(a);var e=this.options;if(d.inArray(a,e.disabled)!=-1){this.lis.eq(a).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(b){return b!=a});this._trigger("enable",null, +this._ui(this.anchors[a],this.panels[a]));return this}},disable:function(a){a=this._getIndex(a);var e=this.options;if(a!=e.selected){this.lis.eq(a).addClass("ui-state-disabled");e.disabled.push(a);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))}return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this}, +load:function(a){a=this._getIndex(a);var e=this,b=this.options,c=this.anchors.eq(a)[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(a).addClass("ui-state-processing");if(b.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(b.spinner)}this.xhr=d.ajax(d.extend({},b.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(c.hash)).html(k);e._cleanup();b.cache&&d.data(c,"cache.tabs", +true);e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.error(k,n,a,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(a, +e){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.5"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(a,e){var b=this,c=this.options,h=b._rotate||(b._rotate=function(j){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var k=c.selected;b.select(++k')}function E(a,b){d.extend(a, +b);for(var c in b)if(b[c]==null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.5"}});var y=(new Date).getTime();d.extend(L.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]= +f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
      ')}}, +_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& +b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== +""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, +c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), +true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor== +Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]); +d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}}, +_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b= +d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; +for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target|| +a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a); +d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&& +d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f, +h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover"); +this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover"); +this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); +a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(), +k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"]; +a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val(): +"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&& +!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth; +b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b= +this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a= +d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a, +"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b== +"object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1 +-1){k=1;l=u;do{e=this._getDaysInMonth(c,k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24* +60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e? +"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k= +this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a, +"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+ +n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
      '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
      ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),I="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
      '+(/all|left/.test(t)&&C==0?c? +f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'
      ';var A=k?'":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, +A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!k?"":'";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,K=B&&!H||!F[0]||j&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+""}g++;if(g>11){g=0;m++}x+="
      '+this._get(a,"weekHeader")+"
      '+this._get(a,"calculateWeek")(q)+""+(B&&!w?" ":K?''+q.getDate()+ +"":''+q.getDate()+"")+"
      "+(l?""+(i[0]>0&&D==i[1]-1?'
      ':""):"");N+=x}I+=N}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': +"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='
      ',o="";if(h||!k)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(j+=o+(h||!(k&&l)?" ":""));if(h||!l)j+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b, +i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?" ":"")+o;j+="
      ";return j},_adjustInstDate:function(a,b,c){var e= +a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, +"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); +c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, +"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= +function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); +return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new L;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.5";window["DP_jQuery_"+y]=d})(jQuery); +;/* + * jQuery UI Progressbar 1.8.5 + * + * Copyright 2010, 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/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,c){b.widget("ui.progressbar",{options:{value:0},min:0,max:100,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this._value()});this.valueDiv=b("
      ").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===c)return this._value();this._setOption("value",a);return this},_setOption:function(a,d){if(a==="value"){this.options.value=d;this._refreshValue();this._trigger("change")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.max,Math.max(this.min,a))},_refreshValue:function(){var a=this.value();this.valueDiv.toggleClass("ui-corner-right", +a===this.max).width(a+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.5"})})(jQuery); +;/* + * jQuery UI Effects 1.8.5 + * + * Copyright 2010, 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/Effects/ + */ +jQuery.effects||function(f,j){function l(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return m.transparent;return m[f.trim(c).toLowerCase()]}function r(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return l(b)}function n(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function o(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in s||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function t(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=r(b.elem,a);b.end=l(b.end);b.colorInit= +true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var m={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189, +183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255, +165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},p=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=o(n.call(this)),q,u=e.attr("className");f.each(p,function(v, +i){c[i]&&e[i+"Class"](c[i])});q=o(n.call(this));e.attr("className",u);e.animate(t(h,q),a,b,function(){f.each(p,function(v,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a? +f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.5",save:function(c,a){for(var b=0;b").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})}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);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| +typeof c=="number"||f.fx.speeds[c]||!f.effects[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(!c||typeof c=="number"||f.fx.speeds[c]||!f.effects[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(!c||typeof c=="number"||f.fx.speeds[c]||!f.effects[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").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.5 + * + * Copyright 2010, 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/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.5 + * + * Copyright 2010, 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/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* +f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.5 + * + * Copyright 2010, 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/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.5 + * + * Copyright 2010, 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/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; \ No newline at end of file diff --git a/static/grappelli/js/LICENSE-JQUERY.txt b/static/grappelli/js/LICENSE-JQUERY.txt new file mode 100644 index 00000000..a4c5bd76 --- /dev/null +++ b/static/grappelli/js/LICENSE-JQUERY.txt @@ -0,0 +1,20 @@ +Copyright (c) 2010 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/static/grappelli/js/SelectBox.js b/static/grappelli/js/SelectBox.js new file mode 100644 index 00000000..f28c8615 --- /dev/null +++ b/static/grappelli/js/SelectBox.js @@ -0,0 +1,111 @@ +var SelectBox = { + cache: new Object(), + init: function(id) { + var box = document.getElementById(id); + var node; + SelectBox.cache[id] = new Array(); + var cache = SelectBox.cache[id]; + for (var i = 0; (node = box.options[i]); i++) { + cache.push({value: node.value, text: node.text, displayed: 1}); + } + }, + redisplay: function(id) { + // Repopulate HTML select box from cache + var box = document.getElementById(id); + box.options.length = 0; // clear all options + for (var i = 0, j = SelectBox.cache[id].length; i < j; i++) { + var node = SelectBox.cache[id][i]; + if (node.displayed) { + box.options[box.options.length] = new Option(node.text, node.value, false, false); + } + } + }, + filter: function(id, text) { + // Redisplay the HTML select box, displaying only the choices containing ALL + // the words in text. (It's an AND search.) + var tokens = text.toLowerCase().split(/\s+/); + var node, token; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + node.displayed = 1; + for (var j = 0; (token = tokens[j]); j++) { + if (node.text.toLowerCase().indexOf(token) == -1) { + node.displayed = 0; + } + } + } + SelectBox.redisplay(id); + }, + delete_from_cache: function(id, value) { + var node, delete_index = null; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + delete_index = i; + break; + } + } + var j = SelectBox.cache[id].length - 1; + for (var i = delete_index; i < j; i++) { + SelectBox.cache[id][i] = SelectBox.cache[id][i+1]; + } + SelectBox.cache[id].length--; + }, + add_to_cache: function(id, option) { + SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); + }, + cache_contains: function(id, value) { + // Check if an item is contained in the cache + var node; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + return true; + } + } + return false; + }, + move: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (option.selected && SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + move_all: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + sort: function(id) { + SelectBox.cache[id].sort( function(a, b) { + a = a.text.toLowerCase(); + b = b.text.toLowerCase(); + try { + if (a > b) return 1; + if (a < b) return -1; + } + catch (e) { + // silently fail on IE 'unknown' exception + } + return 0; + } ); + }, + select_all: function(id) { + var box = document.getElementById(id); + for (var i = 0; i < box.options.length; i++) { + box.options[i].selected = 'selected'; + } + } +} diff --git a/static/grappelli/js/SelectFilter2.js b/static/grappelli/js/SelectFilter2.js new file mode 100644 index 00000000..9b50cb99 --- /dev/null +++ b/static/grappelli/js/SelectFilter2.js @@ -0,0 +1,117 @@ +/* +SelectFilter2 - Turns a multiple-select box into a filter interface. + +Different than SelectFilter because this is coupled to the admin framework. + +Requires core.js, SelectBox.js and addevent.js. +*/ + +function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() != 'form') { + return findForm(node.parentNode); + } + return node; +} + +var SelectFilter = { + init: function(field_id, field_name, is_stacked, admin_media_prefix) { + if (field_id.match(/__prefix__/)){ + // Don't intialize on empty forms. + return; + } + var from_box = document.getElementById(field_id); + from_box.id += '_from'; // change its ID + from_box.className = 'filtered'; + + // Remove

      , because it just gets in the way. + var ps = from_box.parentNode.getElementsByTagName('p'); + for (var i=0; i or

      + var selector_div = quickElement('div', from_box.parentNode); + selector_div.className = is_stacked ? 'selector stacked' : 'selector'; + + //
      + var selector_available = quickElement('div', selector_div, ''); + selector_available.className = 'selector-available'; + quickElement('h2', selector_available, interpolate(gettext('Available %s'), [field_name])); + var filter_p = quickElement('p', selector_available, ''); + filter_p.className = 'selector-filter'; + quickElement('img', filter_p, '', 'src', admin_media_prefix + 'img/admin/selector-search.gif'); + filter_p.appendChild(document.createTextNode(' ')); + var filter_input = quickElement('input', filter_p, '', 'type', 'text'); + filter_input.id = field_id + '_input'; + selector_available.appendChild(from_box); + var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); })()'); + choose_all.className = 'selector-chooseall'; + + //
        + var selector_chooser = quickElement('ul', selector_div, ''); + selector_chooser.className = 'selector-chooser'; + var add_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Add'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to");})()'); + add_link.className = 'selector-add'; + var remove_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from");})()'); + remove_link.className = 'selector-remove'; + + //
        + var selector_chosen = quickElement('div', selector_div, ''); + selector_chosen.className = 'selector-chosen'; + quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s'), [field_name])); + var selector_filter = quickElement('p', selector_chosen, gettext('Select your choice(s) and click ')); + selector_filter.className = 'selector-filter'; + quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/admin/selector_stacked-add.gif':'img/admin/selector-add.gif'), 'alt', 'Add'); + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); + to_box.className = 'filtered'; + var clear_all = quickElement('a', selector_chosen, gettext('Clear all'), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from");})()'); + clear_all.className = 'selector-clearall'; + + from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); + + // Set up the JavaScript event handlers for the select box filter interface + addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); + addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); + addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); }); + addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); }); + addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); + SelectBox.init(field_id + '_from'); + SelectBox.init(field_id + '_to'); + // Move selected from_box options to to_box + SelectBox.move(field_id + '_from', field_id + '_to'); + }, + filter_key_up: function(event, field_id) { + from = document.getElementById(field_id + '_from'); + // don't submit form if user pressed Enter + if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { + from.selectedIndex = 0; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = 0; + return false; + } + var temp = from.selectedIndex; + SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); + from.selectedIndex = temp; + return true; + }, + filter_key_down: function(event, field_id) { + from = document.getElementById(field_id + '_from'); + // right arrow -- move across + if ((event.which && event.which == 39) || (event.keyCode && event.keyCode == 39)) { + var old_index = from.selectedIndex; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = (old_index == from.length) ? from.length - 1 : old_index; + return false; + } + // down arrow -- wrap around + if ((event.which && event.which == 40) || (event.keyCode && event.keyCode == 40)) { + from.selectedIndex = (from.length == from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; + } + // up arrow -- wrap around + if ((event.which && event.which == 38) || (event.keyCode && event.keyCode == 38)) { + from.selectedIndex = (from.selectedIndex == 0) ? from.length - 1 : from.selectedIndex - 1; + } + return true; + } +} diff --git a/static/grappelli/js/actions.js b/static/grappelli/js/actions.js new file mode 100644 index 00000000..c4ae355f --- /dev/null +++ b/static/grappelli/js/actions.js @@ -0,0 +1,5 @@ +/** + * GRAPPELLI ACTIONS.JS + * see actions.min.js + * + */ \ No newline at end of file diff --git a/static/grappelli/js/actions.min.js b/static/grappelli/js/actions.min.js new file mode 100644 index 00000000..3f560de2 --- /dev/null +++ b/static/grappelli/js/actions.min.js @@ -0,0 +1,135 @@ +/** + * GRAPPELLI ACTIONS.JS + * minor modifications compared with the original js + * + */ + +(function($) { + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + checker = function(checked) { + if (checked) { + showQuestion(); + $(actionCheckboxes).attr("checked", true) + .parent().parent().toggleClass(options.selectedClass, checked); + } else { + reset(); + $(actionCheckboxes).attr("checked", false) + .parent().parent().toggleClass(options.selectedClass, checked); + } + }; + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: _actions_icnt + }, true)); + $(options.allToggle).attr("checked", function() { + if (sel == actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + }; + showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + }; + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + }; + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + }; + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + }; + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() == 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).attr("checked")); + updateCounter(); + }); + $("div.changelist-actions li.question a").click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("div.changelist-actions li.clear-selection a").click(function(event) { + event.preventDefault(); + $(options.allToggle).attr("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { var event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { + var inrange = false; + $(lastChecked).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + + // GRAPPELLI CUSTOM: REMOVED ALL JS-CONFIRMS + // TRUSTED EDITORS SHOULD KNOW WHAT TO DO + + // GRAPPELLI CUSTOM: submit on select + $(options.actionSelect).attr("autocomplete", "off").change(function(evt){ + $(this).parents("form").submit(); + }); + + }; + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.changelist-actions", + counterContainer: "li.action-counter span.action-counter", + allContainer: "div.changelist-actions li.all", + acrossInput: "div.changelist-actions input.select-across", + acrossQuestions: "div.changelist-actions li.question", + acrossClears: "div.changelist-actions li.clear-selection", + allToggle: "#action-toggle", + selectedClass: "selected", + actionSelect: "div.changelist-actions select" + }; +})(django.jQuery); + diff --git a/static/grappelli/js/admin/DateTimeShortcuts.js b/static/grappelli/js/admin/DateTimeShortcuts.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/admin/DateTimeShortcuts.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/admin/RelatedObjectLookups.js b/static/grappelli/js/admin/RelatedObjectLookups.js new file mode 100644 index 00000000..f82b29bb --- /dev/null +++ b/static/grappelli/js/admin/RelatedObjectLookups.js @@ -0,0 +1,141 @@ +// Handles related-objects functionality: lookup link for raw_id_fields +// and Add Another links. + +function html_unescape(text) { + // Unescape a string that was escaped using django.utils.html.escape. + text = text.replace(/</g, '<'); + text = text.replace(/>/g, '>'); + text = text.replace(/"/g, '"'); + text = text.replace(/'/g, "'"); + text = text.replace(/&/g, '&'); + return text; +} + +// IE doesn't accept periods or dashes in the window name, but the element IDs +// we use to generate popup window names may contain them, therefore we map them +// to allowed characters in a reversible way so that we can locate the correct +// element when the popup window is dismissed. +function id_to_windowname(text) { + text = text.replace(/\./g, '__dot__'); + text = text.replace(/\-/g, '__dash__'); + return text; +} + +function windowname_to_id(text) { + text = text.replace(/__dot__/g, '.'); + text = text.replace(/__dash__/g, '-'); + return text; +} + +function showRelatedObjectLookupPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^lookup_/, ''); + name = id_to_windowname(name); + var href; + if (triggeringLink.href.search(/\?/) >= 0) { + href = triggeringLink.href + '&pop=1'; + } else { + href = triggeringLink.href + '?pop=1'; + } + // GRAPPELLI CUSTOM: changed width + var win = window.open(href, name, 'height=500,width=980,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissRelatedLookupPopup(win, chosenId) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + chosenId; + } else { + document.getElementById(name).value = chosenId; + } + // GRAPPELLI CUSTOM: element focus + elem.focus(); + win.close(); +} + +// GRAPPELLI CUSTOM +function removeRelatedObject(triggeringLink) { + var id = triggeringLink.id.replace(/^remove_/, ''); + var elem = document.getElementById(id); + elem.value = ""; + elem.focus(); +} + +function showAddAnotherPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^add_/, ''); + name = id_to_windowname(name); + href = triggeringLink.href; + if (href.indexOf('?') == -1) { + href += '?_popup=1'; + } else { + href += '&_popup=1'; + } + // GRAPPELLI CUSTOM: changed width + var win = window.open(href, name, 'height=500,width=980,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissAddAnotherPopup(win, newId, newRepr) { + // newId and newRepr are expected to have previously been escaped by + // django.utils.html.escape. + newId = html_unescape(newId); + newRepr = html_unescape(newRepr); + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem) { + if (elem.nodeName == 'SELECT') { + var o = new Option(newRepr, newId); + elem.options[elem.options.length] = o; + o.selected = true; + } else if (elem.nodeName == 'INPUT') { + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + newId; + elem.focus(); + } else { + elem.value = newId; + elem.focus(); + } + // GRAPPELLI CUSTOM + // NOTE: via http://code.djangoproject.com/ticket/10191 + // check if the className contains radiolist - if it's HORIZONTAL, then it won't match if we compare explicitly + } else if (elem.className.indexOf('radiolist') > -1) { + var cnt = elem.getElementsByTagName('li').length; + var idName = elem.id+'_'+cnt; + var newLi = document.createElement('li'); + var newLabel = document.createElement('label'); + var newText = document.createTextNode(' '+newRepr); + try { + // IE doesn't support settings name, type, or class by setAttribute + var newInput = document.createElement(''); + } catch(err) { + var newInput = document.createElement('input'); + newInput.setAttribute('class', elem.className); + newInput.setAttribute('type', 'radio'); + newInput.setAttribute('name', name.slice(3)); + } + newLabel.setAttribute('for', idName); + newInput.setAttribute('id', idName); + newInput.setAttribute('value', newId); + newInput.setAttribute('checked', 'checked'); + newLabel.appendChild(newInput); + // check if the content being added is a tag - useful for image lists + if (newRepr.charAt(0) == '<' && newRepr.charAt(newRepr.length-1) == '>') { + newLabel.innerHTML += newRepr; + } else { + newLabel.appendChild(newText); + } + newLi.appendChild(newLabel); + elem.appendChild(newLi); + } + } else { + var toId = name + "_to"; + elem = document.getElementById(toId); + var o = new Option(newRepr, newId); + SelectBox.add_to_cache(toId, o); + SelectBox.redisplay(toId); + } + win.close(); +} diff --git a/static/grappelli/js/admin/ordering.js b/static/grappelli/js/admin/ordering.js new file mode 100644 index 00000000..fa995880 --- /dev/null +++ b/static/grappelli/js/admin/ordering.js @@ -0,0 +1,4 @@ +// dropped +// not used in grappelli +// not used in django either +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/calendar.js b/static/grappelli/js/calendar.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/calendar.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/collapse.js b/static/grappelli/js/collapse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/collapse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/collapse.min.js b/static/grappelli/js/collapse.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/collapse.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/compress.py b/static/grappelli/js/compress.py new file mode 100644 index 00000000..8d2caa28 --- /dev/null +++ b/static/grappelli/js/compress.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +import os +import optparse +import subprocess +import sys + +here = os.path.dirname(__file__) + +def main(): + usage = "usage: %prog [file1..fileN]" + description = """With no file paths given this script will automatically +compress all jQuery-based files of the admin app. Requires the Google Closure +Compiler library and Java version 6 or later.""" + parser = optparse.OptionParser(usage, description=description) + parser.add_option("-c", dest="compiler", default="~/bin/compiler.jar", + help="path to Closure Compiler jar file") + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose") + parser.add_option("-q", "--quiet", + action="store_false", dest="verbose") + (options, args) = parser.parse_args() + + compiler = os.path.expanduser(options.compiler) + if not os.path.exists(compiler): + sys.exit("Google Closure compiler jar file %s not found. Please use the -c option to specify the path." % compiler) + + if not args: + if options.verbose: + sys.stdout.write("No filenames given; defaulting to admin scripts\n") + args = [os.path.join(here, f) for f in [ + "actions.js", "collapse.js", "inlines.js", "prepopulate.js"]] + + for arg in args: + if not arg.endswith(".js"): + arg = arg + ".js" + to_compress = os.path.expanduser(arg) + if os.path.exists(to_compress): + to_compress_min = "%s.min.js" % "".join(arg.rsplit(".js")) + cmd = "java -jar %s --js %s --js_output_file %s" % (compiler, to_compress, to_compress_min) + if options.verbose: + sys.stdout.write("Running: %s\n" % cmd) + subprocess.call(cmd.split()) + else: + sys.stdout.write("File %s not found. Sure it exists?\n" % to_compress) + +if __name__ == '__main__': + main() diff --git a/static/grappelli/js/core.js b/static/grappelli/js/core.js new file mode 100644 index 00000000..3ca8ad0f --- /dev/null +++ b/static/grappelli/js/core.js @@ -0,0 +1,221 @@ +// Core javascript helper functions + +// basic browser identification & version +var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); +var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); + +// Cross-browser event handlers. +function addEvent(obj, evType, fn) { + if (obj.addEventListener) { + obj.addEventListener(evType, fn, false); + return true; + } else if (obj.attachEvent) { + var r = obj.attachEvent("on" + evType, fn); + return r; + } else { + return false; + } +} + +function removeEvent(obj, evType, fn) { + if (obj.removeEventListener) { + obj.removeEventListener(evType, fn, false); + return true; + } else if (obj.detachEvent) { + obj.detachEvent("on" + evType, fn); + return true; + } else { + return false; + } +} + +// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]); +function quickElement() { + var obj = document.createElement(arguments[0]); + if (arguments[2] != '' && arguments[2] != null) { + var textNode = document.createTextNode(arguments[2]); + obj.appendChild(textNode); + } + var len = arguments.length; + for (var i = 3; i < len; i += 2) { + obj.setAttribute(arguments[i], arguments[i+1]); + } + arguments[1].appendChild(obj); + return obj; +} + +// ---------------------------------------------------------------------------- +// Cross-browser xmlhttp object +// from http://jibbering.com/2002/4/httprequest.html +// ---------------------------------------------------------------------------- +var xmlhttp; +/*@cc_on @*/ +/*@if (@_jscript_version >= 5) + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } +@else + xmlhttp = false; +@end @*/ +if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { + xmlhttp = new XMLHttpRequest(); +} + +// ---------------------------------------------------------------------------- +// Find-position functions by PPK +// See http://www.quirksmode.org/js/findpos.html +// ---------------------------------------------------------------------------- +function findPosX(obj) { + var curleft = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curleft += obj.offsetLeft - obj.scrollLeft; + } + } else if (obj.x) { + curleft += obj.x; + } + return curleft; +} + +function findPosY(obj) { + var curtop = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curtop += obj.offsetTop - obj.scrollTop; + } + } else if (obj.y) { + curtop += obj.y; + } + return curtop; +} + +//----------------------------------------------------------------------------- +// Date object extensions +// ---------------------------------------------------------------------------- +Date.prototype.getCorrectYear = function() { + // Date.getYear() is unreliable -- + // see http://www.quirksmode.org/js/introdate.html#year + var y = this.getYear() % 100; + return (y < 38) ? y + 2000 : y + 1900; +} + +Date.prototype.getTwelveHours = function() { + hours = this.getHours(); + if (hours == 0) { + return 12; + } + else { + return hours <= 12 ? hours : hours-12 + } +} + +Date.prototype.getTwoDigitMonth = function() { + return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1); +} + +Date.prototype.getTwoDigitDate = function() { + return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); +} + +Date.prototype.getTwoDigitTwelveHour = function() { + return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); +} + +Date.prototype.getTwoDigitHour = function() { + return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); +} + +Date.prototype.getTwoDigitMinute = function() { + return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); +} + +Date.prototype.getTwoDigitSecond = function() { + return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); +} + +Date.prototype.getISODate = function() { + return this.getCorrectYear() + '-' + this.getTwoDigitMonth() + '-' + this.getTwoDigitDate(); +} + +Date.prototype.getHourMinute = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); +} + +Date.prototype.getHourMinuteSecond = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); +} + +Date.prototype.strftime = function(format) { + var fields = { + c: this.toString(), + d: this.getTwoDigitDate(), + H: this.getTwoDigitHour(), + I: this.getTwoDigitTwelveHour(), + m: this.getTwoDigitMonth(), + M: this.getTwoDigitMinute(), + p: (this.getHours() >= 12) ? 'PM' : 'AM', + S: this.getTwoDigitSecond(), + w: '0' + this.getDay(), + x: this.toLocaleDateString(), + X: this.toLocaleTimeString(), + y: ('' + this.getFullYear()).substr(2, 4), + Y: '' + this.getFullYear(), + '%' : '%' + }; + var result = '', i = 0; + while (i < format.length) { + if (format.charAt(i) === '%') { + result = result + fields[format.charAt(i + 1)]; + ++i; + } + else { + result = result + format.charAt(i); + } + ++i; + } + return result; +} + +// ---------------------------------------------------------------------------- +// String object extensions +// ---------------------------------------------------------------------------- +String.prototype.pad_left = function(pad_length, pad_string) { + var new_string = this; + for (var i = 0; new_string.length < pad_length; i++) { + new_string = pad_string + new_string; + } + return new_string; +} + +// ---------------------------------------------------------------------------- +// Get the computed style for and element +// ---------------------------------------------------------------------------- +function getStyle(oElm, strCssRule){ + var strValue = ""; + if(document.defaultView && document.defaultView.getComputedStyle){ + strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); + } + else if(oElm.currentStyle){ + strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ + return p1.toUpperCase(); + }); + strValue = oElm.currentStyle[strCssRule]; + } + return strValue; +} diff --git a/static/grappelli/js/dateparse.js b/static/grappelli/js/dateparse.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/dateparse.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/getElementsBySelector.js b/static/grappelli/js/getElementsBySelector.js new file mode 100644 index 00000000..15b57a19 --- /dev/null +++ b/static/grappelli/js/getElementsBySelector.js @@ -0,0 +1,167 @@ +/* document.getElementsBySelector(selector) + - returns an array of element objects from the current document + matching the CSS selector. Selectors can contain element names, + class names and ids and can be nested. For example: + + elements = document.getElementsBySelect('div#main p a.external') + + Will return an array of all 'a' elements with 'external' in their + class attribute that are contained inside 'p' elements that are + contained inside the 'div' element which has id="main" + + New in version 0.4: Support for CSS2 and CSS3 attribute selectors: + See http://www.w3.org/TR/css3-selectors/#attribute-selectors + + Version 0.4 - Simon Willison, March 25th 2003 + -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows + -- Opera 7 fails +*/ + +function getAllChildren(e) { + // Returns all children of element. Workaround required for IE5/Windows. Ugh. + return e.all ? e.all : e.getElementsByTagName('*'); +} + +document.getElementsBySelector = function(selector) { + // Attempt to fail gracefully in lesser browsers + if (!document.getElementsByTagName) { + return new Array(); + } + // Split selector in to tokens + var tokens = selector.split(' '); + var currentContext = new Array(document); + for (var i = 0; i < tokens.length; i++) { + token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');; + if (token.indexOf('#') > -1) { + // Token is an ID selector + var bits = token.split('#'); + var tagName = bits[0]; + var id = bits[1]; + var element = document.getElementById(id); + if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) { + // ID not found or tag with that ID not found, return false. + return new Array(); + } + // Set currentContext to contain just this element + currentContext = new Array(element); + continue; // Skip to next token + } + if (token.indexOf('.') > -1) { + // Token contains a class selector + var bits = token.split('.'); + var tagName = bits[0]; + var className = bits[1]; + if (!tagName) { + tagName = '*'; + } + // Get elements matching tag, filter them for class selector + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + try { + elements = currentContext[h].getElementsByTagName(tagName); + } + catch(e) { + elements = []; + } + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) { + currentContext[currentContextIndex++] = found[k]; + } + } + continue; // Skip to next token + } + // Code to deal with attribute selectors + if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) { + var tagName = RegExp.$1; + var attrName = RegExp.$2; + var attrOperator = RegExp.$3; + var attrValue = RegExp.$4; + if (!tagName) { + tagName = '*'; + } + // Grab all of the tagName elements within current context + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + elements = currentContext[h].getElementsByTagName(tagName); + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + var checkFunction; // This function will be used to filter the elements + switch (attrOperator) { + case '=': // Equality + checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); }; + break; + case '~': // Match one of space seperated words + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); }; + break; + case '|': // Match start with value followed by optional hyphen + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); }; + break; + case '^': // Match starts with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); }; + break; + case '$': // Match ends with value - fails with "Warning" in Opera 7 + checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); }; + break; + case '*': // Match ends with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); }; + break; + default : + // Just test for existence of attribute + checkFunction = function(e) { return e.getAttribute(attrName); }; + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (checkFunction(found[k])) { + currentContext[currentContextIndex++] = found[k]; + } + } + // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue); + continue; // Skip to next token + } + // If we get here, token is JUST an element (not a class or ID selector) + tagName = token; + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements = currentContext[h].getElementsByTagName(tagName); + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = found; + } + return currentContext; +} + +/* That revolting regular expression explained +/^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/ + \---/ \---/\-------------/ \-------/ + | | | | + | | | The value + | | ~,|,^,$,* or = + | Attribute + Tag +*/ diff --git a/static/grappelli/js/grappelli.js b/static/grappelli/js/grappelli.js new file mode 100644 index 00000000..a0112bd6 --- /dev/null +++ b/static/grappelli/js/grappelli.js @@ -0,0 +1,157 @@ +/** + * GRAPPELLI UTILS + * functions needed for Grappelli + */ + +// grp jQuery namespace +var grp = { + "jQuery": jQuery.noConflict(true) +}; + +// django jQuery namespace +var django = { + "jQuery": grp.jQuery.noConflict(true) +}; + +// var jQuery = grp.jQuery.noConflict(true); + +(function($) { + + // dateformat + grappelli.getFormat = function(type) { + if (type == "date") { + var format = DATE_FORMAT.toLowerCase().replace(/%\w/g, function(str) { + str = str.replace(/%/, ''); + return str + str; + }); + return format; + } + }; + + // datepicker, timepicker init + grappelli.initDateAndTimePicker = function() { + + // HACK: get rid of text after DateField (hardcoded in django.admin) + $('p.datetime').each(function() { + var text = $(this).html(); + text = text.replace(/^\w*: /, ""); + text = text.replace(/
        [^<]*: /g, "
        "); + $(this).html(text); + }); + + var options = { + //appendText: '(mm/dd/yyyy)', + constrainInput: false, + showOn: 'button', + buttonImageOnly: false, + buttonText: '', + dateFormat: grappelli.getFormat('date'), + showButtonPanel: true, + showAnim: '', + // HACK: sets the current instance to a global var. + // needed to actually select today if the today-button is clicked. + // see onClick handler for ".ui-datepicker-current" + beforeShow: function(year, month, inst) { + grappelli.datepicker_instance = this; + } + }; + var dateFields = $("input[class*='vDateField']:not([id*='__prefix__'])"); + dateFields.datepicker(options); + + if (typeof IS_POPUP != "undefined" && IS_POPUP) { + dateFields.datepicker('disable'); + } + + // HACK: adds an event listener to the today button of datepicker + // if clicked today gets selected and datepicker hides. + // use on() because couldn't find hook after datepicker generates it's complete dom. + $(".ui-datepicker-current").on('click', function() { + $.datepicker._selectDate(grappelli.datepicker_instance); + grappelli.datepicker_instance = null; + }); + + // init timepicker + $("input[class*='vTimeField']:not([id*='__prefix__'])").grp_timepicker(); + + // now-button for both date and time + // $("');this.element.after(this.button);if(this.element.prop("disabled")){this.button.prop("disabled",true)}else{this.button.click(function(){b._toggleTimepicker()})}},_toggleTimepicker:function(){if(this.timepicker.is(":visible")){this.timepicker.hide()}else{this.element.focus();this._generateTimepickerContents();this._showTimepicker()}},_generateTimepickerContents:function(){var d=this,b="
          ";if(this.options.time_list.length===0){this.options.time_list=this.options.default_time_list}for(var g=0;g'+c+":"+f+""}else{b+='
        • '+this.options.time_list[g]+"
        • "}}b+="
        ";this.timepicker.html(b);this.timepicker.find("li").click(function(){a(this).parent().children("li").removeClass("ui-state-active");a(this).addClass("ui-state-active");d.element.val(a(this).html());d.timepicker.hide()})},_showTimepicker:function(){var f=document.documentElement.clientHeight;var i=document.documentElement.scrollTop||document.body.scrollTop;var b=this.element.outerHeight();var e=this.timepicker.outerHeight()+b;var c=this.element.offset().top;var d=this.element.offset().left;var j=c-i+e+60;if(j'+g[0].label+"")})};c.fn.grp_related_fk.defaults={placeholder:'',repr_max_length:30,lookup_url:""}})(grp.jQuery);(function(c){var b={init:function(d){d=c.extend({},c.fn.grp_related_m2m.defaults,d);return this.each(function(){var e=c(this);e.parent().find("a.related-lookup").after(d.placeholder);e.next().addClass("grp-m2m");e.addClass("grp-has-related-lookup");a(e,d);e.bind("change focus keyup",function(){a(e,d)})})}};c.fn.grp_related_m2m=function(d){if(b[d]){return b[d].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof d==="object"||!d){return b.init.apply(this,arguments)}else{c.error("Method "+d+" does not exist on jQuery.grp_related_m2m")}}return false};var a=function(e,d){c.getJSON(d.lookup_url,{object_id:e.val(),app_label:grappelli.get_app_label(e),model_name:grappelli.get_model_name(e),query_string:grappelli.get_query_string(e)},function(f){values=c.map(f,function(g){return''+g.label+""});if(values===""){e.parent().find(".grp-placeholder-related-m2m").hide()}else{e.parent().find(".grp-placeholder-related-m2m").show()}e.parent().find(".grp-placeholder-related-m2m").html(values.join(''))})};c.fn.grp_related_m2m.defaults={placeholder:'',repr_max_length:30,lookup_url:""}})(grp.jQuery);(function(d){var b={init:function(f){f=d.extend({},d.fn.grp_related_generic.defaults,f);return this.each(function(){var g=d(this);var h=d(f.content_type).val()||d(f.content_type).find(":checked").val();if(h){g.after(f.placeholder).after(e(g.attr("id"),h))}g.addClass("grp-has-related-lookup");if(h){a(g,f)}g.bind("change focus keyup",function(){a(g,f)});d(f.content_type).bind("change",function(){c(d(this),f)})})}};d.fn.grp_related_generic=function(f){if(b[f]){return b[f].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof f==="object"||!f){return b.init.apply(this,arguments)}else{d.error("Method "+f+" does not exist on jQuery.grp_related_generic")}}return false};var e=function(h,g){var f=d('');f.attr("id","lookup_"+h);f.attr("href","../../../"+MODEL_URL_ARRAY[g].app+"/"+MODEL_URL_ARRAY[g].model+"/?t=id");f.attr("onClick","return showRelatedObjectLookupPopup(this);");return f};var c=function(g,f){var h=d(f.object_id);h.val("");h.parent().find("a.related-lookup").remove();h.parent().find(".grp-placeholder-related-generic").remove();var i=d(g).val()||d(g).find(":checked").val();if(i){h.after(f.placeholder).after(e(h.attr("id"),i))}};var a=function(g,f){var h=g.next().next();d.getJSON(f.lookup_url,{object_id:g.val(),app_label:grappelli.get_app_label(g),model_name:grappelli.get_model_name(g),query_string:grappelli.get_query_string(g)},function(i){if(i[0].label===""){h.hide()}else{h.show()}h.html(''+i[0].label+"")})};d.fn.grp_related_generic.defaults={placeholder:'',repr_max_length:30,lookup_url:"",content_type:"",object_id:""}})(grp.jQuery);(function(f){var d={init:function(g){g=f.extend({},f.fn.grp_autocomplete_fk.defaults,g);return this.each(function(){var h=f(this);h.attr({tabindex:"-1",readonly:"readonly"}).addClass("grp-autocomplete-hidden-field");if(h.next().next()&&h.next().next().attr("class")!="errorlist"&&h.next().next().attr("class")!="grp-help"){h.next().next().remove()}h.next().after(b).after(a(h.attr("id")));h.parent().wrapInner("
        ");h.parent().prepend("");g=f.extend({wrapper_autocomplete:h.parent(),input_field:h.prev(),remove_link:h.next().next().hide(),loader:h.next().next().next().hide()},f.fn.grp_autocomplete_fk.defaults,g);c(h,g);e(h,g);h.bind("change focus keyup",function(){c(h,g)});f("label[for='"+h.attr("id")+"']").each(function(){f(this).attr("for",h.attr("id")+"-autocomplete")})})}};f.fn.grp_autocomplete_fk=function(g){if(d[g]){return d[g].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof g==="object"||!g){return d.init.apply(this,arguments)}else{f.error("Method "+g+" does not exist on jQuery.grp_autocomplete_fk")}}return false};var b=function(){var g=f('
        loader
        ');return g};var a=function(h){var g=f('');g.attr("id","remove_"+h);g.attr("href","javascript://");g.attr("onClick","return removeRelatedObject(this);");g.hover(function(){f(this).parent().toggleClass("grp-autocomplete-preremove")});return g};var e=function(h,g){g.wrapper_autocomplete.find("input:first").bind("focus",function(){g.wrapper_autocomplete.addClass("grp-state-focus")}).bind("blur",function(){g.wrapper_autocomplete.removeClass("grp-state-focus")}).autocomplete({minLength:1,delay:1000,source:function(j,i){f.ajax({url:g.autocomplete_lookup_url,dataType:"json",data:"term="+encodeURIComponent(j.term)+"&app_label="+grappelli.get_app_label(h)+"&model_name="+grappelli.get_model_name(h)+"&query_string="+grappelli.get_query_string(h),beforeSend:function(k){g.loader.show()},success:function(k){i(f.map(k,function(l){return{label:l.label,value:l.value}}))},complete:function(k,l){g.loader.hide()}})},focus:function(){return false},select:function(i,j){g.input_field.val(j.item.label);h.val(j.item.value);h.val()?f(g.remove_link).show():f(g.remove_link).hide();return false}}).data("ui-autocomplete")._renderItem=function(i,j){if(!j.value){return f("
      • ").data("item.autocomplete",j).append(""+j.label).appendTo(i)}else{return f("
      • ").data("item.autocomplete",j).append(""+j.label).appendTo(i)}}};var c=function(h,g){f.getJSON(g.lookup_url,{object_id:h.val(),app_label:grappelli.get_app_label(h),model_name:grappelli.get_model_name(h)},function(i){f.each(i,function(j){g.input_field.val(i[j].label);h.val()?f(g.remove_link).show():f(g.remove_link).hide()})})};f.fn.grp_autocomplete_fk.defaults={autocomplete_lookup_url:"",lookup_url:""}})(grp.jQuery);(function(e){var c={init:function(j){j=e.extend({},e.fn.grp_autocomplete_m2m.defaults,j);return this.each(function(){var k=e(this);k.attr({tabindex:"-1",readonly:"readonly"}).addClass("grp-autocomplete-hidden-field");k.next().after(g).after(d(k.attr("id")));k.parent().wrapInner("
        ");k.parent().prepend("
        ");j=e.extend({wrapper_autocomplete:k.parent(),wrapper_repr:k.parent().find("ul.grp-repr"),wrapper_search:k.parent().find("li.grp-search"),remove_link:k.next().next().hide(),loader:k.next().next().next().hide()},e.fn.grp_autocomplete_m2m.defaults,j);if(k.parent().find("ul.errorlist")){k.parent().find("ul.errorlist").detach().appendTo(k.parent().parent())}a(k,j);b(k,j);k.bind("change focus keyup",function(){a(k,j)});e("label[for='"+k.attr("id")+"']").each(function(){e(this).attr("for",k.attr("id")+"-autocomplete")});j.wrapper_autocomplete.bind("click",function(l){if(!e(l.target).hasClass("related-lookup")&&!e(l.target).hasClass("grp-related-remove")){j.wrapper_search.find("input:first").focus()}})})}};e.fn.grp_autocomplete_m2m=function(j){if(c[j]){return c[j].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof j==="object"||!j){return c.init.apply(this,arguments)}else{e.error("Method "+j+" does not exist on jQuery.grp_autocomplete_m2m")}}return false};var f=function(l,m,k){var j=[];if(l.val()){j=l.val().split(",")}j.push(m);l.val(j.join(","));return j.join(",")};var i=function(m,j,l){var k=[];if(m.val()){k=m.val().split(",")}k.splice(j,1);m.val(k.join(","));return k.join(",")};var g=function(){var j=e('
        loader
        ');return j};var d=function(k){var j=e('
        ');j.attr("id","remove_"+k);j.attr("href","javascript://");j.attr("onClick","return removeRelatedObject(this);");j.hover(function(){e(this).parent().toggleClass("grp-autocomplete-preremove")});return j};var h=function(n,m,l){var k=e('
      • ');var j=e(''+m+"");k.append(j);k.insertBefore(l.wrapper_search);j.bind("click",function(o){var p=e(this).parent().parent().children("li").index(e(this).parent());i(n,p,l);e(this).parent().remove();n.val()?e(l.remove_link).show():e(l.remove_link).hide();o.stopPropagation()});j.hover(function(){e(this).parent().toggleClass("grp-autocomplete-preremove")})};var b=function(k,j){j.wrapper_search.find("input:first").bind("keydown",function(l){if(l.keyCode===e.ui.keyCode.TAB&&e(this).data("autocomplete").menu.active){l.preventDefault()}}).bind("focus",function(){j.wrapper_autocomplete.addClass("grp-state-focus")}).bind("blur",function(){j.wrapper_autocomplete.removeClass("grp-state-focus")}).autocomplete({minLength:1,delay:1000,position:{my:"left top",at:"left bottom",of:j.wrapper_autocomplete},open:function(l,m){e(".ui-menu").width(j.wrapper_autocomplete.outerWidth()-6)},source:function(m,l){e.ajax({url:j.autocomplete_lookup_url,dataType:"json",data:"term="+encodeURIComponent(m.term)+"&app_label="+grappelli.get_app_label(k)+"&model_name="+grappelli.get_model_name(k)+"&query_string="+grappelli.get_query_string(k),beforeSend:function(n){j.loader.show()},success:function(n){l(e.map(n,function(o){return{label:o.label,value:o.value}}))},complete:function(n,o){j.loader.hide()}})},focus:function(){return false},select:function(l,m){h(k,m.item.label,j);f(k,m.item.value,j);k.val()?e(j.remove_link).show():e(j.remove_link).hide();e(this).val("").focus();return false}}).data("ui-autocomplete")._renderItem=function(l,m){if(!m.value){return e("
      • ").data("item.autocomplete",m).append(""+m.label).appendTo(l)}else{return e("
      • ").data("item.autocomplete",m).append(""+m.label).appendTo(l)}}};var a=function(k,j){e.getJSON(j.lookup_url,{object_id:k.val(),app_label:grappelli.get_app_label(k),model_name:grappelli.get_model_name(k)},function(l){j.wrapper_repr.find("li.grp-repr").remove();j.wrapper_search.find("input").val("");e.each(l,function(m){if(l[m].value){h(k,l[m].label,j)}});k.val()?e(j.remove_link).show():e(j.remove_link).hide()})}})(grp.jQuery);(function(f){var d={init:function(g){g=f.extend({},f.fn.grp_autocomplete_fk.defaults,g);return this.each(function(){var h=f(this);h.attr({tabindex:"-1",readonly:"readonly"}).addClass("grp-autocomplete-hidden-field");if(h.next().next()&&h.next().next().attr("class")!="errorlist"&&h.next().next().attr("class")!="grp-help"){h.next().next().remove()}h.next().after(b).after(a(h.attr("id")));h.parent().wrapInner("
        ");h.parent().prepend("");g=f.extend({wrapper_autocomplete:h.parent(),input_field:h.prev(),remove_link:h.next().next().hide(),loader:h.next().next().next().hide()},f.fn.grp_autocomplete_fk.defaults,g);c(h,g);e(h,g);h.bind("change focus keyup",function(){c(h,g)});f("label[for='"+h.attr("id")+"']").each(function(){f(this).attr("for",h.attr("id")+"-autocomplete")})})}};f.fn.grp_autocomplete_fk=function(g){if(d[g]){return d[g].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof g==="object"||!g){return d.init.apply(this,arguments)}else{f.error("Method "+g+" does not exist on jQuery.grp_autocomplete_fk")}}return false};var b=function(){var g=f('
        loader
        ');return g};var a=function(h){var g=f('
        ');g.attr("id","remove_"+h);g.attr("href","javascript://");g.attr("onClick","return removeRelatedObject(this);");g.hover(function(){f(this).parent().toggleClass("grp-autocomplete-preremove")});return g};var e=function(h,g){g.wrapper_autocomplete.find("input:first").bind("focus",function(){g.wrapper_autocomplete.addClass("grp-state-focus")}).bind("blur",function(){g.wrapper_autocomplete.removeClass("grp-state-focus")}).autocomplete({minLength:1,delay:1000,source:function(j,i){f.ajax({url:g.autocomplete_lookup_url,dataType:"json",data:"term="+encodeURIComponent(j.term)+"&app_label="+grappelli.get_app_label(h)+"&model_name="+grappelli.get_model_name(h)+"&query_string="+grappelli.get_query_string(h),beforeSend:function(k){g.loader.show()},success:function(k){i(f.map(k,function(l){return{label:l.label,value:l.value}}))},complete:function(k,l){g.loader.hide()}})},focus:function(){return false},select:function(i,j){g.input_field.val(j.item.label);h.val(j.item.value);h.val()?f(g.remove_link).show():f(g.remove_link).hide();return false}}).data("ui-autocomplete")._renderItem=function(i,j){if(!j.value){return f("
      • ").data("item.autocomplete",j).append(""+j.label).appendTo(i)}else{return f("
      • ").data("item.autocomplete",j).append(""+j.label).appendTo(i)}}};var c=function(h,g){f.getJSON(g.lookup_url,{object_id:h.val(),app_label:grappelli.get_app_label(h),model_name:grappelli.get_model_name(h)},function(i){f.each(i,function(j){g.input_field.val(i[j].label);h.val()?f(g.remove_link).show():f(g.remove_link).hide()})})};f.fn.grp_autocomplete_fk.defaults={autocomplete_lookup_url:"",lookup_url:""}})(grp.jQuery);(function(g){var d={init:function(i){i=g.extend({},g.fn.grp_autocomplete_generic.defaults,i);return this.each(function(){var j=g(this);j.attr({tabindex:"-1",readonly:"readonly"}).addClass("grp-autocomplete-hidden-field");var k=g(i.content_type).val()||g(i.content_type).find(":checked").val();if(k){j.after(b).after(a(j.attr("id"))).after(h(j.attr("id"),k))}j.parent().wrapInner("
        ");j.parent().prepend("");i=g.extend({wrapper_autocomplete:g(this).parent(),input_field:g(this).prev(),remove_link:j.nextAll("a.grp-related-remove").hide(),loader:j.nextAll("div.grp-loader").hide()},g.fn.grp_autocomplete_generic.defaults,i);if(k){c(j,i)}f(j,i);j.bind("change focus keyup",function(){c(j,i)});g(i.content_type).bind("change",function(){e(g(this),i)});g("label[for='"+j.attr("id")+"']").each(function(){g(this).attr("for",j.attr("id")+"-autocomplete")})})}};g.fn.grp_autocomplete_generic=function(i){if(d[i]){return d[i].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof i==="object"||!i){return d.init.apply(this,arguments)}else{g.error("Method "+i+" does not exist on jQuery.grp_autocomplete_generic")}}return false};var b=function(){var i=g('
        loader
        ');return i};var a=function(j){var i=g('
        ');i.attr("id","remove_"+j);i.attr("href","javascript://");i.attr("onClick","return removeRelatedObject(this);");i.hover(function(){g(this).parent().toggleClass("grp-autocomplete-preremove")});return i};var h=function(k,j){var i=g('');i.attr("id","lookup_"+k);i.attr("href","../../../"+MODEL_URL_ARRAY[j].app+"/"+MODEL_URL_ARRAY[j].model+"/?t=id");i.attr("onClick","return showRelatedObjectLookupPopup(this);");return i};var e=function(j,i){var k=g(i.object_id);k.val("");k.prev().val("");k.nextAll("a.related-lookup").remove();k.nextAll("a.grp-related-remove").remove();k.nextAll("div.grp-loader").remove();var l=g(j).val()||g(j).find(":checked").val();if(l){k.after(b).after(a(k.attr("id"))).after(h(k.attr("id"),l));i.remove_link=k.nextAll("a.grp-related-remove").hide();i.loader=k.nextAll("div.grp-loader").hide()}};var f=function(j,i){i.wrapper_autocomplete.find("input:first").bind("focus",function(){i.wrapper_autocomplete.addClass("grp-state-focus")}).bind("blur",function(){i.wrapper_autocomplete.removeClass("grp-state-focus")}).autocomplete({minLength:1,delay:1000,source:function(l,k){g.ajax({url:i.autocomplete_lookup_url,dataType:"json",data:"term="+encodeURIComponent(l.term)+"&app_label="+grappelli.get_app_label(j)+"&model_name="+grappelli.get_model_name(j)+"&query_string="+grappelli.get_query_string(j),beforeSend:function(m){var n=g(i.content_type).val()||g(i.content_type).find(":checked").val();if(n){i.loader.show()}else{return false}},success:function(m){k(g.map(m,function(n){return{label:n.label,value:n.value}}))},complete:function(m,n){i.loader.hide()}})},focus:function(){return false},select:function(k,l){i.input_field.val(l.item.label);j.val(l.item.value);j.val()?g(i.remove_link).show():g(i.remove_link).hide();return false}}).data("ui-autocomplete")._renderItem=function(k,l){if(!l.value){return g("
      • ").data("item.autocomplete",l).append(""+l.label).appendTo(k)}else{return g("
      • ").data("item.autocomplete",l).append(""+l.label).appendTo(k)}}};var c=function(j,i){g.getJSON(i.lookup_url,{object_id:j.val(),app_label:grappelli.get_app_label(j),model_name:grappelli.get_model_name(j)},function(k){g.each(k,function(l){i.input_field.val(k[l].label);j.val()?g(i.remove_link).show():g(i.remove_link).hide()})})};g.fn.grp_autocomplete_generic.defaults={autocomplete_lookup_url:"",lookup_url:"",content_type:"",object_id:""}})(grp.jQuery);(function(a){a.fn.grp_inline=function(b){var c={prefix:"form",addText:"add another",deleteText:"remove",addCssClass:"grp-add-handler",removeCssClass:"grp-remove-handler",deleteCssClass:"grp-delete-handler",emptyCssClass:"grp-empty-form",formCssClass:"grp-dynamic-form",predeleteCssClass:"grp-predelete",onBeforeInit:function(d){},onBeforeAdded:function(d){},onBeforeRemoved:function(d){},onBeforeDeleted:function(d){},onAfterInit:function(d){},onAfterAdded:function(d){},onAfterRemoved:function(d){},onAfterDeleted:function(d){}};b=a.extend(c,b);return this.each(function(){var e=a(this);var d=e.find("#id_"+b.prefix+"-TOTAL_FORMS");d.attr("autocomplete","off");initInlineForms(e,b);initAddButtons(e,b);addButtonHandler(e.find("a."+b.addCssClass),b);removeButtonHandler(e.find("a."+b.removeCssClass),b);deleteButtonHandler(e.find("a."+b.deleteCssClass),b)})};updateFormIndex=function(d,c,b,e){d.find(":input,span,table,iframe,label,a,ul,p,img,div").each(function(){var i=a(this),k=i.attr("id"),h=i.attr("name"),j=i.attr("for"),g=i.attr("href"),l=i.attr("class"),f=i.attr("onclick");if(k){i.attr("id",k.replace(b,e))}if(h){i.attr("name",h.replace(b,e))}if(j){i.attr("for",j.replace(b,e))}if(g){i.attr("href",g.replace(b,e))}if(l){i.attr("class",l.replace(b,e))}if(f){i.attr("onclick",f.replace(b,e))}})};initInlineForms=function(c,b){c.find("div.grp-module").each(function(){var d=a(this);b.onBeforeInit(d);if(d.attr("id")!==""){d.not("."+b.emptyCssClass).not(".grp-table").not(".grp-thead").not(".add-item").addClass(b.formCssClass)}d.find("li.grp-delete-handler-container input").each(function(){if(a(this).is(":checked")&&d.hasClass("has_original")){d.toggleClass(b.predeleteCssClass)}});b.onAfterInit(d)})};initAddButtons=function(d,c){var e=d.find("#id_"+c.prefix+"-TOTAL_FORMS");var b=d.find("#id_"+c.prefix+"-MAX_NUM_FORMS");var f=d.find("a."+c.addCssClass);if((b.val()!=="")&&(b.val()-e.val())<=0){hideAddButtons(d,c)}};addButtonHandler=function(c,b){c.bind("click",function(){var i=c.parents(".grp-group"),h=i.find("#id_"+b.prefix+"-TOTAL_FORMS"),e=i.find("#id_"+b.prefix+"-MAX_NUM_FORMS"),k=i.find("a."+b.addCssClass),j=i.find("#"+b.prefix+"-empty");b.onBeforeAdded(i);var d=parseInt(h.val(),10),g=j.clone(true);g.removeClass(b.emptyCssClass).attr("id",j.attr("id").replace("-empty",d));var f=/__prefix__/g;updateFormIndex(g,b,f,d);g.insertBefore(j).addClass(b.formCssClass);h.val(d+1);if((e.val()!==0)&&(e.val()!=="")&&(e.val()-h.val())<=0){hideAddButtons(i,b)}b.onAfterAdded(g)})};removeButtonHandler=function(c,b){c.bind("click",function(){var k=c.parents(".grp-group"),h=a(this).parents("."+b.formCssClass).first(),j=k.find("#id_"+b.prefix+"-TOTAL_FORMS"),e=k.find("#id_"+b.prefix+"-MAX_NUM_FORMS");b.onBeforeRemoved(h);h.remove();var d=parseInt(j.val(),10);j.val(d-1);if((e.val()!==0)&&(e.val()-j.val())>0){showAddButtons(k,b)}var g=/-\d+-/g,f=0;k.find("."+b.formCssClass).each(function(){updateFormIndex(a(this),b,g,"-"+f+"-");f++});b.onAfterRemoved(k)})};deleteButtonHandler=function(c,b){c.bind("click",function(){var d=a(this).prev(),e=a(this).parents("."+b.formCssClass).first();b.onBeforeDeleted(e);if(e.hasClass("has_original")){e.toggleClass(b.predeleteCssClass);if(d.prop("checked")){d.removeAttr("checked")}else{d.prop("checked",true)}}b.onAfterDeleted(e)})};hideAddButtons=function(c,b){var d=c.find("a."+b.addCssClass);d.hide().parents(".grp-add-item").hide()};showAddButtons=function(c,b){var d=c.find("a."+b.addCssClass);d.show().parents(".grp-add-item").show()}})(grp.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/grappelli.js b/static/grappelli/js/grappelli/grappelli.js new file mode 100644 index 00000000..680a3143 --- /dev/null +++ b/static/grappelli/js/grappelli/grappelli.js @@ -0,0 +1,135 @@ +/** + * GRAPPELLI UTILS + * functions needed for Grappelli + */ + +var django = { + "jQuery": jQuery.noConflict(true) +}; + +(function($) { + + // dateformat + grappelli.getFormat = function(type) { + if (type == "date") { + var format = DATE_FORMAT.toLowerCase().replace(/%\w/g, function(str) { + str = str.replace(/%/, ''); + return str + str; + }); + return format; + } + }; + + // datepicker, timepicker init + grappelli.initDateAndTimePicker = function() { + + // HACK: get rid of text after DateField (hardcoded in django.admin) + $('p.datetime').each(function() { + var text = $(this).html(); + text = text.replace(/^\w*: /, ""); + text = text.replace(/
        .*: /, "
        "); + $(this).html(text); + }); + + var options = { + //appendText: '(mm/dd/yyyy)', + showOn: 'button', + buttonImageOnly: false, + buttonText: '', + dateFormat: grappelli.getFormat('date'), + showButtonPanel: true, + showAnim: '', + // HACK: sets the current instance to a global var. + // needed to actually select today if the today-button is clicked. + // see onClick handler for ".ui-datepicker-current" + beforeShow: function(year, month, inst) { + grappelli.datepicker_instance = this; + } + }; + var dateFields = $("input[class*='vDateField']:not([id*='__prefix__'])"); + dateFields.datepicker(options); + + if (typeof IS_POPUP != "undefined" && IS_POPUP) { + dateFields.datepicker('disable'); + } + + // HACK: adds an event listener to the today button of datepicker + // if clicked today gets selected and datepicker hides. + // use live() because couldn't find hook after datepicker generates it's complete dom. + $(".ui-datepicker-current").live('click', function() { + $.datepicker._selectDate(grappelli.datepicker_instance); + grappelli.datepicker_instance = null; + }); + + // init timepicker + $("input[class*='vTimeField']:not([id*='__prefix__'])").grp_timepicker(); + }; + + // changelist: filter + grappelli.initFilter = function() { + $("a.toggle-filters").click(function() { + $(".filter-pulldown").toggle(); + $("#filters").toggleClass("open"); + }); + $(".filter_choice").change(function(){ + location.href = $(this).val(); + }); + }; + + // changelist: searchbar + grappelli.initSearchbar = function() { + var searchbar = $("input#searchbar"); + searchbar.focus(); + }; + + grappelli.updateSelectFilter = function(form) { + if (typeof SelectFilter != "undefined"){ + form.find(".selectfilter").each(function(index, value){ + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}"); + }); + form.find(".selectfilterstacked").each(function(index, value){ + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}"); + }); + } + }; + + grappelli.reinitDateTimeFields = function(form) { + form.find(".vDateField").datepicker({ + showOn: 'button', + buttonImageOnly: false, + buttonText: '', + dateFormat: grappelli.getFormat('date') + }); + form.find(".vTimeField").grp_timepicker(); + }; + + // autocomplete helpers + grappelli.get_app_label = function(elem) { + var link = elem.next("a"); + if (link.length > 0) { + var url = link.attr('href').split('/'); + return url[url.length-3]; + } + return false; + }; + grappelli.get_model_name = function(elem) { + var link = elem.next("a"); + if (link.length > 0) { + var url = link.attr('href').split('/'); + return url[url.length-2]; + } + return false; + }; + grappelli.get_query_string = function(elem) { + var link = elem.next("a"); + if (link.length > 0) { + var url = link.attr('href').split('/'); + return url[url.length-1].replace('?', ''); + } + return false; + }; + +})(django.jQuery); + diff --git a/static/grappelli/js/grappelli/jquery.grp_autocomplete_fk.js b/static/grappelli/js/grappelli/jquery.grp_autocomplete_fk.js new file mode 100644 index 00000000..4c8c16eb --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_autocomplete_fk.js @@ -0,0 +1,126 @@ +/** + * GRAPPELLI AUTOCOMPLETE FK + * foreign-key lookup with autocomplete + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_autocomplete_fk.defaults, options); + return this.each(function() { + var $this = $(this); + // remove djangos object representation (if given) + if ($this.next().next() && $this.next().next().attr("class") != "errorlist") $this.next().next().remove(); + // build autocomplete wrapper + $this.next().after(loader).after(remove_link($this.attr('id'))); + $this.parent().wrapInner("
        "); + $this.parent().prepend(""); + // extend options + options = $.extend({ + wrapper_autocomplete: $this.parent(), + input_field: $this.prev(), + remove_link: $this.next().next().hide(), + loader: $this.next().next().next().hide() + }, $.fn.grp_autocomplete_fk.defaults, options); + // lookup + lookup_id($this, options); // lookup when loading page + lookup_autocomplete($this, options); // autocomplete-handler + $this.bind("change focus keyup blur", function() { // id-handler + lookup_id($this, options); + }); + // labels + $("label[for='"+$this.attr('id')+"']").each(function() { + $(this).attr("for", $this.attr("id")+"-autocomplete"); + }); + }); + } + }; + + $.fn.grp_autocomplete_fk = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_autocomplete_fk'); + }; + return false; + }; + + var loader = function() { + var loader = $('
        loader
        '); + return loader; + }; + + var remove_link = function(id) { + var removelink = $('
        '); + removelink.attr('id', 'remove_'+id); + removelink.attr('href', 'javascript://'); + removelink.attr('onClick', 'return removeRelatedObject(this);'); + removelink.hover(function() { + $(this).parent().toggleClass("autocomplete-preremove"); + }); + return removelink; + }; + + var lookup_autocomplete = function(elem, options) { + options.wrapper_autocomplete.find("input:first") + .autocomplete({ + minLength: 1, + delay: 1000, + source: function(request, response) { + $.ajax({ + url: options.autocomplete_lookup_url, + dataType: 'json', + data: "term=" + request.term + "&app_label=" + grappelli.get_app_label(elem) + "&model_name=" + grappelli.get_model_name(elem) + "&query_string=" + grappelli.get_query_string(elem), + beforeSend: function (XMLHttpRequest) { + options.loader.show(); + }, + success: function(data){ + response($.map(data, function(item) { + return {label: item.label, value: item.value}; + })); + }, + complete: function (XMLHttpRequest, textStatus) { + options.loader.hide(); + } + }); + }, + focus: function() { // prevent value inserted on focus + return false; + }, + select: function(event, ui) { + options.input_field.val(ui.item.label); + elem.val(ui.item.value); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + return false; + } + }) + .data("autocomplete")._renderItem = function(ul,item) { + return $("
      • ") + .data( "item.autocomplete", item ) + .append( "" + item.label + " (" + item.value + ")") + .appendTo(ul); + }; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + $.each(data, function(index) { + options.input_field.val(data[index].label); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + }); + }); + }; + + $.fn.grp_autocomplete_fk.defaults = { + autocomplete_lookup_url: '', + lookup_url: '' + }; + +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_autocomplete_generic.js b/static/grappelli/js/grappelli/jquery.grp_autocomplete_generic.js new file mode 100644 index 00000000..7705bb49 --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_autocomplete_generic.js @@ -0,0 +1,157 @@ +/** + * GRAPPELLI AUTOCOMPLETE GENERIC + * generic lookup with autocomplete + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_autocomplete_generic.defaults, options); + return this.each(function() { + var $this = $(this); + // build autocomplete wrapper + if ($(options.content_type).val()) { + $this.after(loader).after(remove_link($this.attr('id'))).after(lookup_link($this.attr("id"),$(options.content_type).val())); + } + $this.parent().wrapInner("
        "); + $this.parent().prepend(""); + // defaults + options = $.extend({ + wrapper_autocomplete: $(this).parent(), + input_field: $(this).prev(), + remove_link: $this.next().next().hide(), + loader: $this.next().next().next().hide() + }, $.fn.grp_autocomplete_generic.defaults, options); + // lookup + lookup_id($this, options); // lookup when loading page + lookup_autocomplete($this, options); // autocomplete-handler + $this.bind("change focus keyup blur", function() { // id-handler + lookup_id($this, options); + }); + $(options.content_type).bind("change", function() { // content-type-handler + update_lookup($(this), options); + }); + // labels + $("label[for='"+$this.attr('id')+"']").each(function() { + $(this).attr("for", $this.attr("id")+"-autocomplete"); + }); + }); + } + }; + + $.fn.grp_autocomplete_generic = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_autocomplete_generic'); + }; + return false; + }; + + var loader = function() { + var loader = $('
        loader
        '); + return loader; + }; + + var remove_link = function(id) { + var removelink = $('
        '); + removelink.attr('id', 'remove_'+id); + removelink.attr('href', 'javascript://'); + removelink.attr('onClick', 'return removeRelatedObject(this);'); + removelink.hover(function() { + $(this).parent().toggleClass("autocomplete-preremove"); + }); + return removelink; + }; + + var lookup_link = function(id, val) { + var lookuplink = $(''); + lookuplink.attr('id', 'lookup_'+id); + lookuplink.attr('href', "../../../" + MODEL_URL_ARRAY[val].app + "/" + MODEL_URL_ARRAY[val].model + '/?t=id'); + lookuplink.attr('onClick', 'return showRelatedObjectLookupPopup(this);'); + return lookuplink; + }; + + var update_lookup = function(elem, options) { + var obj = $(options.object_id); + obj.val(''); + obj.prev().val(''); + obj.next().remove(); + obj.next().remove(); + obj.next().remove(); + if ($(elem).val()) { + obj.after(loader).after(remove_link(obj.attr('id'))).after(lookup_link(obj.attr('id'),$(elem).val())); + options.remove_link = obj.next().next().hide(); + options.loader = obj.next().next().next().hide(); + } + }; + + var lookup_autocomplete = function(elem, options) { + options.wrapper_autocomplete.find("input:first") + .autocomplete({ + minLength: 1, + delay: 1000, + source: function(request, response) { + $.ajax({ + url: options.autocomplete_lookup_url, + dataType: 'json', + data: "term=" + request.term + "&app_label=" + grappelli.get_app_label(elem) + "&model_name=" + grappelli.get_model_name(elem) + "&query_string=" + grappelli.get_query_string(elem), + beforeSend: function (XMLHttpRequest) { + if ($(options.content_type).val()) { + options.loader.show(); + } else { + return false; + } + }, + success: function(data){ + response($.map(data, function(item) { + return {label: item.label, value: item.value}; + })); + }, + complete: function (XMLHttpRequest, textStatus) { + options.loader.hide(); + } + }); + }, + focus: function() { // prevent value inserted on focus + return false; + }, + select: function(event, ui) { + options.input_field.val(ui.item.label); + elem.val(ui.item.value); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + return false; + } + }) + .data("autocomplete")._renderItem = function(ul,item) { + return $("
      • ") + .data( "item.autocomplete", item ) + .append( "" + item.label + " (" + item.value + ")") + .appendTo(ul); + }; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + $.each(data, function(index) { + options.input_field.val(data[index].label); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + }); + }); + }; + + $.fn.grp_autocomplete_generic.defaults = { + autocomplete_lookup_url: '', + lookup_url: '', + content_type: '', + object_id: '' + }; + +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_autocomplete_m2m.js b/static/grappelli/js/grappelli/jquery.grp_autocomplete_m2m.js new file mode 100644 index 00000000..f2786b91 --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_autocomplete_m2m.js @@ -0,0 +1,181 @@ +/** + * GRAPPELLI AUTOCOMPLETE M2M + * many-to-many lookup with autocomplete + */ + + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_autocomplete_m2m.defaults, options); + return this.each(function() { + var $this = $(this); + // build autocomplete wrapper + $this.next().after(loader).after(remove_link($this.attr('id'))); + $this.parent().wrapInner("
        "); + //$this.parent().prepend("").prepend("
          "); + $this.parent().prepend("
          "); + // defaults + options = $.extend({ + wrapper_autocomplete: $this.parent(), + wrapper_repr: $this.parent().find("ul.repr"), + wrapper_search: $this.parent().find("li.search"), + remove_link: $this.next().next().hide(), + loader: $this.next().next().next().hide() + }, $.fn.grp_autocomplete_m2m.defaults, options); + // move errorlist outside the wrapper + if ($this.parent().find("ul.errorlist")) { + $this.parent().find("ul.errorlist").detach().appendTo($this.parent().parent()); + } + // lookup + lookup_id($this, options); // lookup when loading page + lookup_autocomplete($this, options); // autocomplete-handler + $this.bind("change focus keyup blur", function() { // id-handler + lookup_id($this, options); + }); + // labels + $("label[for='"+$this.attr('id')+"']").each(function() { + $(this).attr("for", $this.attr("id")+"-autocomplete"); + }); + // click on div > focus input + options.wrapper_autocomplete.bind("click", function() { + options.wrapper_search.find("input:first").focus(); + }); + }); + } + }; + + $.fn.grp_autocomplete_m2m = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_autocomplete_m2m'); + }; + return false; + }; + + var value_add = function(elem, value, options) { + var values = []; + if (elem.val()) values = elem.val().split(","); + values.push(value); + elem.val(values.join(",")); + return values.join(","); + }; + + var value_remove = function(elem, position, options) { + var values = []; + if (elem.val()) values = elem.val().split(","); + values.splice(position,1); + elem.val(values.join(",")); + return values.join(","); + }; + + var loader = function() { + var loader = $('
          loader
          '); + return loader; + }; + + var remove_link = function(id) { + var removelink = $('
          '); + removelink.attr('id', 'remove_'+id); + removelink.attr('href', 'javascript://'); + removelink.attr('onClick', 'return removeRelatedObject(this);'); + removelink.hover(function() { + $(this).parent().toggleClass("autocomplete-preremove"); + }); + return removelink; + }; + + var repr_add = function(elem, label, options) { + var repr = $('
        • '); + var removelink = $('' + label + ''); + repr.append(removelink); + repr.insertBefore(options.wrapper_search); + removelink.bind("click", function(e) { // remove-handler + var pos = $(this).parent().parent().children("li").index($(this).parent()); + value_remove(elem, pos, options); + $(this).parent().remove(); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + e.stopPropagation(); // prevent focus on input + }); + removelink.hover(function() { + $(this).parent().toggleClass("autocomplete-preremove"); + }); + }; + + var lookup_autocomplete = function(elem, options) {; + options.wrapper_search.find("input:first") + .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(); + } + }) + .bind("focus", function() { + options.wrapper_autocomplete.addClass("state-focus"); + }) + .bind("blur", function() { + options.wrapper_autocomplete.removeClass("state-focus"); + }) + .autocomplete({ + minLength: 1, + delay: 1000, + position: {my: "left top", at: "left bottom", of: options.wrapper_autocomplete}, + open: function(event, ui) { + $(".ui-menu").width(options.wrapper_autocomplete.outerWidth()-6); + }, + source: function(request, response) { + $.ajax({ + url: options.autocomplete_lookup_url, + dataType: 'json', + data: "term=" + request.term + "&app_label=" + grappelli.get_app_label(elem) + "&model_name=" + grappelli.get_model_name(elem) + "&query_string=" + grappelli.get_query_string(elem), + beforeSend: function (XMLHttpRequest) { + options.loader.show(); + }, + success: function(data){ + response($.map(data, function(item) { + return {label: item.label, value: item.value}; + })); + }, + complete: function (XMLHttpRequest, textStatus) { + options.loader.hide(); + } + }); + }, + focus: function() { // prevent value inserted on focus + return false; + }, + select: function(event, ui) { // add repr, add value + repr_add(elem, ui.item.label, options); + value_add(elem, ui.item.value, options); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + $(this).val("").focus(); + return false; + } + }) + .data("autocomplete")._renderItem = function(ul,item) { + return $("
        • ") + .data( "item.autocomplete", item ) + .append( "" + item.label + " (" + item.value + ")") + .appendTo(ul); + }; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + options.wrapper_repr.find("li.repr").remove(); + options.wrapper_search.find("input").val(""); + $.each(data, function(index) { + repr_add(elem, data[index].label, options); + }); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + }); + }; + +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_collapsible.js b/static/grappelli/js/grappelli/jquery.grp_collapsible.js new file mode 100644 index 00000000..43629f52 --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_collapsible.js @@ -0,0 +1,34 @@ +/** + * GRAPPELLI COLLAPSIBLES + * handles collapsibles, + * excluding open/closing all elements + * within a group. + */ + +(function($) { + $.fn.grp_collapsible = function(options){ + var defaults = { + toggle_handler_slctr: ".collapse-handler:first", + closed_css: "closed", + open_css: "open", + on_init: function() {}, + on_toggle: function() {} + }; + var opts = $.extend(defaults, options); + return this.each(function() { + _initialize($(this), opts); + }); + }; + var _initialize = function(elem, options) { + options.on_init(elem, options); + _register_handlers(elem, options); + }; + var _register_handlers = function(elem, options) { + _register_toggle_handler(elem, options); + }; + var _register_toggle_handler = function(elem, options) { + elem.children(options.toggle_handler_slctr).click(function() { + elem.toggleClass(options.closed_css).toggleClass(options.open_css); + }); + }; +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_collapsible_group.js b/static/grappelli/js/grappelli/jquery.grp_collapsible_group.js new file mode 100644 index 00000000..14626442 --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_collapsible_group.js @@ -0,0 +1,54 @@ +/** + * GRAPPELLI GROUP COLLAPSIBLES + * handles open/closing of all elements + * with tabular- and stacked-inlines. + */ + +(function($) { + $.fn.grp_collapsible_group = function(options){ + var defaults = { + open_handler_slctr: ".open-handler", + close_handler_slctr: ".close-handler", + collapsible_container_slctr: "div.collapse", + closed_css: "closed", + open_css: "open", + on_init: function() {}, + on_open: function() {}, + on_close: function() {} + }; + options = $.extend(defaults, options); + return this.each(function() { + _initialize($(this), options); + }); + }; + var _initialize = function(elem, options) { + options.on_init(elem, options); + _register_handlers(elem, options); + }; + var _register_handlers = function(elem, options) { + _register_open_handler(elem, options); + _register_close_handler(elem, options); + }; + var _register_open_handler = function(elem, options) { + elem.find(options.open_handler_slctr).each(function() { + $(this).click(function() { + options.on_open(elem, options); + elem.find(options.collapsible_container_slctr) + .removeClass(options.closed_css) + .addClass(options.open_css); + elem.removeClass(options.closed_css) + .addClass(options.open_css); + }); + }); + }; + var _register_close_handler = function(elem, options) { + elem.find(options.close_handler_slctr).each(function() { + $(this).click(function() { + options.on_close(elem, options); + elem.find(options.collapsible_container_slctr) + .removeClass(options.open_css) + .addClass(options.closed_css); + }); + }); + }; +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_inline.js b/static/grappelli/js/grappelli/jquery.grp_inline.js new file mode 100644 index 00000000..3078acbb --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_inline.js @@ -0,0 +1,179 @@ +/** + * GRAPPELLI INLINES + * jquery-plugin for inlines (stacked and tabular) + */ + + +(function($) { + $.fn.grp_inline = function(options) { + var defaults = { + prefix: "form", // The form prefix for your django formset + addText: "add another", // Text for the add link + deleteText: "remove", // Text for the delete link + addCssClass: "add-handler", // CSS class applied to the add link + removeCssClass: "remove-handler", // CSS class applied to the remove link + deleteCssClass: "delete-handler", // CSS class applied to the delete link + emptyCssClass: "empty-form", // CSS class applied to the empty row + formCssClass: "dynamic-form", // CSS class applied to each form in a formset + predeleteCssClass: "predelete", + onBeforeInit: function(form) {}, // Function called before a form is initialized + onBeforeAdded: function(inline) {}, // Function called before a form is added + onBeforeRemoved: function(form) {}, // Function called before a form is removed + onBeforeDeleted: function(form) {}, // Function called before a form is deleted + onAfterInit: function(form) {}, // Function called after a form has been initialized + onAfterAdded: function(form) {}, // Function called after a form has been added + onAfterRemoved: function(inline) {}, // Function called after a form has been removed + onAfterDeleted: function(form) {} // Function called after a form has been deleted + }; + options = $.extend(defaults, options); + + return this.each(function() { + var inline = $(this); // the current inline node + var totalForms = inline.find("#id_" + options.prefix + "-TOTAL_FORMS"); + // set autocomplete to off in order to prevent the browser from keeping the current value after reload + totalForms.attr("autocomplete", "off"); + // init inline and add-buttons + initInlineForms(inline, options); + initAddButtons(inline, options); + // button handlers + addButtonHandler(inline.find("a." + options.addCssClass), options); + removeButtonHandler(inline.find("a." + options.removeCssClass), options); + deleteButtonHandler(inline.find("a." + options.deleteCssClass), options); + }); + }; + + updateFormIndex = function(elem, options, replace_regex, replace_with) { + elem.find(':input,span,table,iframe,label,a,ul,p,img').each(function() { + var node = $(this), + node_id = node.attr('id'), + node_name = node.attr('name'), + node_for = node.attr('for'), + node_href = node.attr("href"); + if (node_id) { node.attr('id', node_id.replace(replace_regex, replace_with)); } + if (node_name) { node.attr('name', node_name.replace(replace_regex, replace_with)); } + if (node_for) { node.attr('for', node_for.replace(replace_regex, replace_with)); } + if (node_href) { node.attr('href', node_href.replace(replace_regex, replace_with)); } + }); + }; + + initInlineForms = function(elem, options) { + elem.find("div.module").each(function() { + var form = $(this); + // callback + options.onBeforeInit(form); + // add options.formCssClass to all forms in the inline + // except table/theader/add-item + if (form.attr('id') !== "") { + form.not("." + options.emptyCssClass).not(".table").not(".thead").not(".add-item").addClass(options.formCssClass); + } + // add options.predeleteCssClass to forms with the delete checkbox checked + form.find("li.delete-handler-container input").each(function() { + if ($(this).attr("checked") && form.hasClass("has_original")) { + form.toggleClass(options.predeleteCssClass); + } + }); + // callback + options.onAfterInit(form); + }); + }; + + initAddButtons = function(elem, options) { + var totalForms = elem.find("#id_" + options.prefix + "-TOTAL_FORMS"); + var maxForms = elem.find("#id_" + options.prefix + "-MAX_NUM_FORMS"); + var addButtons = elem.find("a." + options.addCssClass); + // hide add button in case we've hit the max, except we want to add infinitely + if ((maxForms.val() !== '') && (maxForms.val()-totalForms.val()) <= 0) { + hideAddBottons(elem, options); + } + }; + + addButtonHandler = function(elem, options) { + elem.bind("click", function() { + var inline = elem.parents("div.group"), + totalForms = inline.find("#id_" + options.prefix + "-TOTAL_FORMS"), + maxForms = inline.find("#id_" + options.prefix + "-MAX_NUM_FORMS"), + addButtons = inline.find("a." + options.addCssClass), + empty_template = inline.find("#" + options.prefix + "-empty"); + // callback + options.onBeforeAdded(inline); + // create new form + var index = parseInt(totalForms.val(), 10), + form = empty_template.clone(true); + form.removeClass(options.emptyCssClass) + .attr("id", empty_template.attr('id').replace("-empty", index)) + .insertBefore(empty_template) + .addClass(options.formCssClass); + // update form index + var re = /__prefix__/g; + updateFormIndex(form, options, re, index); + // update total forms + totalForms.val(index + 1); + // hide add button in case we've hit the max, except we want to add infinitely + if ((maxForms.val() !== 0) && (maxForms.val() != "") && (maxForms.val() - totalForms.val()) <= 0) { + hideAddBottons(inline, options); + } + // callback + options.onAfterAdded(form); + }); + }; + + removeButtonHandler = function(elem, options) { + elem.bind("click", function() { + var inline = elem.parents("div.group"), + form = $(this).parents("." + options.formCssClass).first(), + totalForms = inline.find("#id_" + options.prefix + "-TOTAL_FORMS"), + maxForms = inline.find("#id_" + options.prefix + "-MAX_NUM_FORMS"); + // callback + options.onBeforeRemoved(form); + // remove form + form.remove(); + // update total forms + var index = parseInt(totalForms.val(), 10); + totalForms.val(index - 1); + // show add button in case we've dropped below max + if ((maxForms.val() !== 0) && (maxForms.val() - totalForms.val()) > 0) { + showAddButtons(inline, options); + } + // update form index (for all forms) + var re = /-\d+-/g, + i = 0; + inline.find("." + options.formCssClass).each(function() { + updateFormIndex($(this), options, re, "-" + i + "-"); + i++; + }); + // callback + options.onAfterRemoved(inline); + }); + }; + + deleteButtonHandler = function(elem, options) { + elem.bind("click", function() { + var deleteInput = $(this).prev(), + form = $(this).parents("." + options.formCssClass).first(); + // callback + options.onBeforeDeleted(form); + // toggle options.predeleteCssClass and toggle checkbox + if (form.hasClass("has_original")) { + form.toggleClass(options.predeleteCssClass); + if (deleteInput.attr("checked")) { + deleteInput.removeAttr("checked"); + } else { + deleteInput.attr("checked", 'checked'); + } + } + // callback + options.onAfterDeleted(form); + }); + }; + + hideAddBottons = function(elem, options) { + var addButtons = elem.find("a." + options.addCssClass); + addButtons.hide().parents('div.add-item').hide(); + }; + + showAddButtons = function(elem, options) { + var addButtons = elem.find("a." + options.addCssClass); + addButtons.show().parents('div.add-item').show(); + }; + +})(django.jQuery); diff --git a/static/grappelli/js/grappelli/jquery.grp_related_fk.js b/static/grappelli/js/grappelli/jquery.grp_related_fk.js new file mode 100644 index 00000000..69ea9b54 --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_related_fk.js @@ -0,0 +1,56 @@ +/** + * GRAPPELLI RELATED FK + * foreign-key lookup + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_related_fk.defaults, options); + return this.each(function() { + var $this = $(this); + // remove djangos object representation + if ($this.next().next() && $this.next().next().attr("class") != "errorlist") { + $this.next().next().remove(); + } + // add placeholder + $this.next().after(options.placeholder); + // lookup + lookup_id($this, options); // lookup when loading page + $this.bind("change focus keyup blur", function() { // id-handler + lookup_id($this, options); + }); + }); + } + }; + + $.fn.grp_related_fk = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_related_fk'); + }; + return false; + }; + + var lookup_id = function(elem, options) { + var text = elem.next().next(); + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + text.text(data[0].label); + }); + }; + + $.fn.grp_related_fk.defaults = { + placeholder: ' ', + repr_max_length: 30, + lookup_url: '' + }; + +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_related_generic.js b/static/grappelli/js/grappelli/jquery.grp_related_generic.js new file mode 100644 index 00000000..90b14e3a --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_related_generic.js @@ -0,0 +1,77 @@ +/** + * GRAPPELLI RELATED FK + * generic lookup + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_related_generic.defaults, options); + return this.each(function() { + var $this = $(this); + // add placeholder + if ($(options.content_type).val()) { + $this.after(options.placeholder).after(lookup_link($this.attr("id"),$(options.content_type).val())); + } + // lookup + lookup_id($this, options); // lookup when loading page + $this.bind("change focus keyup blur", function() { // id-handler + lookup_id($this, options); + }); + $(options.content_type).bind("change", function() { // content-type-handler + update_lookup($(this), options); + }); + }); + } + }; + + $.fn.grp_related_generic = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_related_generic'); + }; + return false; + }; + + var lookup_link = function(id, val) { + var lookuplink = $(''); + lookuplink.attr('id', 'lookup_'+id); + lookuplink.attr('href', "../../../" + MODEL_URL_ARRAY[val].app + "/" + MODEL_URL_ARRAY[val].model + '/?t=id'); + lookuplink.attr('onClick', 'return showRelatedObjectLookupPopup(this);'); + return lookuplink; + }; + + var update_lookup = function(elem, options) { + var obj = $(options.object_id); + obj.val(''); + obj.next().remove(); + obj.next().remove(); + if ($(elem).val()) { + obj.after(options.placeholder).after(lookup_link(obj.attr('id'),$(elem).val())); + } + }; + + var lookup_id = function(elem, options) { + var text = elem.next().next(); + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + text.text(data[0].label); + }); + }; + + $.fn.grp_related_generic.defaults = { + placeholder: ' ', + repr_max_length: 30, + lookup_url: '', + content_type: '', + object_id: '' + }; + +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_related_m2m.js b/static/grappelli/js/grappelli/jquery.grp_related_m2m.js new file mode 100644 index 00000000..e8c73371 --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_related_m2m.js @@ -0,0 +1,54 @@ +/** + * GRAPPELLI RELATED M2M + * m2m lookup + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_related_m2m.defaults, options); + return this.each(function() { + var $this = $(this); + // add placeholder + $this.next().after(options.placeholder); + // change lookup class + $this.next().addClass("m2m"); + // lookup + lookup_id($this, options); // lookup when loading page + $this.bind("change focus keyup blur", function() { // id-handler + lookup_id($this, options); + }); + }); + } + }; + + $.fn.grp_related_m2m = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_related_m2m'); + }; + return false; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + values = $.map(data, function (a) { return a.label; }); + elem.next().next().text(values.join(", ")); + }); + }; + + $.fn.grp_related_m2m.defaults = { + placeholder: ' ', + repr_max_length: 30, + lookup_url: '' + }; + +})(django.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/grappelli/jquery.grp_timepicker.js b/static/grappelli/js/grappelli/jquery.grp_timepicker.js new file mode 100644 index 00000000..15fd586d --- /dev/null +++ b/static/grappelli/js/grappelli/jquery.grp_timepicker.js @@ -0,0 +1,161 @@ +/** + * GRAPPELLI TIMEPICKER + * works pretty similar to ui.datepicker: + * adds a button to the element + * creates a node (div) at the bottom called ui-timepicker + * element.onClick fills the ui-timepicker node with the time_list (all times you can select) + */ + +(function($) { + $.widget("ui.grp_timepicker", { + // default options + options: { + // template for the container of the timepicker + template: '', + // selector to get the ui-timepicker once it's added to the dom + timepicker_selector: "#ui-timepicker", + // needed offset of the container from the element + offset: { + top: 0 + }, + // if time_list wasn't sent when calling the timepicker we use this + default_time_list: [ + 'now', + '00:00', + '01:00', + '02:00', + '03:00', + '04:00', + '05:00', + '06:00', + '07:00', + '08:00', + '09:00', + '10:00', + '11:00', + '12:00', + '13:00', + '14:00', + '15:00', + '16:00', + '17:00', + '18:00', + '19:00', + '20:00', + '21:00', + '22:00', + '23:00' + ], + // leave this empty!!! + // NOTE: you can't set a default for time_list because if you call: + // $("node").timepicker({time_list: ["01:00", "02:00"]}) + // ui.widget will extend/merge the options.time_list with the one you sent. + time_list: [] + }, + + // init timepicker for a specific element + _create: function() { + // for the events + var self = this; + + // to close timpicker if you click somewhere in the document + $(document).mousedown(function(evt) { + if (self.timepicker.is(":visible")) { + var $target = $(evt.target); + if ($target[0].id != self.timepicker[0].id && $target.parents(self.options.timepicker_selector).length === 0 && !$target.hasClass('hasTimepicker') && !$target.hasClass('ui-timepicker-trigger')) { + self.timepicker.hide(); + } + } + }); + + // get/create timepicker's container + if ($(this.options.timepicker_selector).size() === 0) { + $(this.options.template).appendTo('body'); + } + this.timepicker = $(this.options.timepicker_selector); + this.timepicker.hide(); + + // modify the element and create the button + this.element.addClass("hasTimepicker"); + this.button = $(''); + this.element.after(this.button); + + // disable button if element is disabled + if (this.element.attr("disabled")) { + this.button.attr("disabled", true); + } else { + // register event + this.button.click(function() { + self._toggleTimepicker(); + }); + } + }, + + // called when button is clicked + _toggleTimepicker: function() { + if (this.timepicker.is(":visible")) { + this.timepicker.hide(); + } else { + this.element.focus(); + this._generateTimepickerContents(); + this._showTimepicker(); + } + }, + + // fills timepicker with time_list of element and shows it. + // called by _toggleTimepicker + _generateTimepickerContents: function() { + var self = this, + template_str = "
            "; + + // there is no time_list for this instance so use the default one + if (this.options.time_list.length === 0) { + this.options.time_list = this.options.default_time_list; + } + + for (var i = 0; i < this.options.time_list.length; i++) { + if (this.options.time_list[i] == "now") { + var now = new Date(), + hours = now.getHours(), + minutes = now.getMinutes(); + + hours = ((hours < 10) ? "0" + hours : hours); + minutes = ((minutes < 10) ? "0" + minutes : minutes); + + template_str += '
          • ' + hours + ":" + minutes + '
          • '; + } else { + template_str += '
          • ' + this.options.time_list[i] + '
          • '; + } + } + template_str += "
          "; + + // fill timepicker container + this.timepicker.html(template_str); + + // click handler for items (times) in timepicker + this.timepicker.find('li').click(function() { + // remove active class from all items + $(this).parent().children('li').removeClass("ui-state-active"); + // mark clicked item as active + $(this).addClass("ui-state-active"); + // set the new value and hide the timepicker + self.element.val($(this).html()); + self.timepicker.hide(); + }); + }, + + // sets offset and shows timepicker container + _showTimepicker: function() { + this.timepicker_offset = this.element.offset(); + this.timepicker_offset.top += this.element.outerHeight() + this.options.offset.top; + this.timepicker.css(this.timepicker_offset); + this.timepicker.show(); + }, + + destroy: function() { + $.Widget.prototype.destroy.apply(this, arguments); // default destroy + // now do other stuff particular to this widget + } + + }); +})(django.jQuery); diff --git a/static/grappelli/js/inlines.js b/static/grappelli/js/inlines.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/inlines.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/inlines.min.js b/static/grappelli/js/inlines.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/inlines.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/jquery.grp_autocomplete_fk.js b/static/grappelli/js/jquery.grp_autocomplete_fk.js new file mode 100644 index 00000000..86274ca8 --- /dev/null +++ b/static/grappelli/js/jquery.grp_autocomplete_fk.js @@ -0,0 +1,144 @@ +/** + * GRAPPELLI AUTOCOMPLETE FK + * foreign-key lookup with autocomplete + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_autocomplete_fk.defaults, options); + return this.each(function() { + var $this = $(this); + // assign attributes + $this.attr({ + "tabindex": "-1", + "readonly": "readonly" + }).addClass("grp-autocomplete-hidden-field"); + // remove djangos object representation (if given) + if ($this.next().next() && $this.next().next().attr("class") != "errorlist" && $this.next().next().attr("class") != "grp-help") $this.next().next().remove(); + // build autocomplete wrapper + $this.next().after(loader).after(remove_link($this.attr('id'))); + $this.parent().wrapInner("
          "); + $this.parent().prepend(""); + // extend options + options = $.extend({ + wrapper_autocomplete: $this.parent(), + input_field: $this.prev(), + remove_link: $this.next().next().hide(), + loader: $this.next().next().next().hide() + }, $.fn.grp_autocomplete_fk.defaults, options); + // lookup + lookup_id($this, options); // lookup when loading page + lookup_autocomplete($this, options); // autocomplete-handler + $this.bind("change focus keyup", function() { // id-handler + lookup_id($this, options); + }); + // labels + $("label[for='"+$this.attr('id')+"']").each(function() { + $(this).attr("for", $this.attr("id")+"-autocomplete"); + }); + }); + } + }; + + $.fn.grp_autocomplete_fk = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_autocomplete_fk'); + } + return false; + }; + + var loader = function() { + var loader = $('
          loader
          '); + return loader; + }; + + var remove_link = function(id) { + var removelink = $(''); + removelink.attr('id', 'remove_'+id); + removelink.attr('href', 'javascript://'); + removelink.attr('onClick', 'return removeRelatedObject(this);'); + removelink.hover(function() { + $(this).parent().toggleClass("grp-autocomplete-preremove"); + }); + return removelink; + }; + + var lookup_autocomplete = function(elem, options) { + options.wrapper_autocomplete.find("input:first") + .bind("focus", function() { + options.wrapper_autocomplete.addClass("grp-state-focus"); + }) + .bind("blur", function() { + options.wrapper_autocomplete.removeClass("grp-state-focus"); + }) + .autocomplete({ + minLength: 1, + delay: 1000, + source: function(request, response) { + $.ajax({ + url: options.autocomplete_lookup_url, + dataType: 'json', + data: "term=" + encodeURIComponent(request.term) + "&app_label=" + grappelli.get_app_label(elem) + "&model_name=" + grappelli.get_model_name(elem) + "&query_string=" + grappelli.get_query_string(elem), + beforeSend: function (XMLHttpRequest) { + options.loader.show(); + }, + success: function(data){ + response($.map(data, function(item) { + return {label: item.label, value: item.value}; + })); + }, + complete: function (XMLHttpRequest, textStatus) { + options.loader.hide(); + } + }); + }, + focus: function() { // prevent value inserted on focus + return false; + }, + select: function(event, ui) { + options.input_field.val(ui.item.label); + elem.val(ui.item.value); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + return false; + } + }) + .data("ui-autocomplete")._renderItem = function(ul,item) { + if (!item.value) { + return $("
        • ") + .data( "item.autocomplete", item ) + .append( "" + item.label) + .appendTo(ul); + } else { + return $("
        • ") + .data( "item.autocomplete", item ) + .append( "" + item.label) + .appendTo(ul); + } + }; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + $.each(data, function(index) { + options.input_field.val(data[index].label); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + }); + }); + }; + + $.fn.grp_autocomplete_fk.defaults = { + autocomplete_lookup_url: '', + lookup_url: '' + }; + +})(grp.jQuery); diff --git a/static/grappelli/js/jquery.grp_autocomplete_generic.js b/static/grappelli/js/jquery.grp_autocomplete_generic.js new file mode 100644 index 00000000..0d177d59 --- /dev/null +++ b/static/grappelli/js/jquery.grp_autocomplete_generic.js @@ -0,0 +1,181 @@ +/** + * GRAPPELLI AUTOCOMPLETE GENERIC + * generic lookup with autocomplete + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_autocomplete_generic.defaults, options); + return this.each(function() { + var $this = $(this); + // assign attributes + $this.attr({ + "tabindex": "-1", + "readonly": "readonly" + }).addClass("grp-autocomplete-hidden-field"); + // build autocomplete wrapper + var val = $(options.content_type).val() || $(options.content_type).find(':checked').val(); + if (val) { + $this.after(loader).after(remove_link($this.attr('id'))).after(lookup_link($this.attr("id"),val)); + } + $this.parent().wrapInner("
          "); + $this.parent().prepend(""); + // defaults + options = $.extend({ + wrapper_autocomplete: $(this).parent(), + input_field: $(this).prev(), + remove_link: $this.nextAll("a.grp-related-remove").hide(), + loader: $this.nextAll("div.grp-loader").hide() + }, $.fn.grp_autocomplete_generic.defaults, options); + // lookup + if (val) { + lookup_id($this, options); // lookup when loading page + } + lookup_autocomplete($this, options); // autocomplete-handler + $this.bind("change focus keyup", function() { // id-handler + lookup_id($this, options); + }); + $(options.content_type).bind("change", function() { // content-type-handler + update_lookup($(this), options); + }); + // labels + $("label[for='"+$this.attr('id')+"']").each(function() { + $(this).attr("for", $this.attr("id")+"-autocomplete"); + }); + }); + } + }; + + $.fn.grp_autocomplete_generic = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_autocomplete_generic'); + } + return false; + }; + + var loader = function() { + var loader = $('
          loader
          '); + return loader; + }; + + var remove_link = function(id) { + var removelink = $('
          '); + removelink.attr('id', 'remove_'+id); + removelink.attr('href', 'javascript://'); + removelink.attr('onClick', 'return removeRelatedObject(this);'); + removelink.hover(function() { + $(this).parent().toggleClass("grp-autocomplete-preremove"); + }); + return removelink; + }; + + var lookup_link = function(id, val) { + var lookuplink = $(''); + lookuplink.attr('id', 'lookup_'+id); + lookuplink.attr('href', "../../../" + MODEL_URL_ARRAY[val].app + "/" + MODEL_URL_ARRAY[val].model + '/?t=id'); + lookuplink.attr('onClick', 'return showRelatedObjectLookupPopup(this);'); + return lookuplink; + }; + + var update_lookup = function(elem, options) { + var obj = $(options.object_id); + obj.val(''); + obj.prev().val(''); + // remove loader, a-related, related-lookup + obj.nextAll("a.related-lookup").remove(); + obj.nextAll("a.grp-related-remove").remove(); + obj.nextAll("div.grp-loader").remove(); + var val = $(elem).val() || $(elem).find(':checked').val(); + if (val) { + obj.after(loader).after(remove_link(obj.attr('id'))).after(lookup_link(obj.attr('id'),val)); + options.remove_link = obj.nextAll("a.grp-related-remove").hide(); + options.loader = obj.nextAll("div.grp-loader").hide(); + } + }; + + var lookup_autocomplete = function(elem, options) { + options.wrapper_autocomplete.find("input:first") + .bind("focus", function() { + options.wrapper_autocomplete.addClass("grp-state-focus"); + }) + .bind("blur", function() { + options.wrapper_autocomplete.removeClass("grp-state-focus"); + }) + .autocomplete({ + minLength: 1, + delay: 1000, + source: function(request, response) { + $.ajax({ + url: options.autocomplete_lookup_url, + dataType: 'json', + data: "term=" + encodeURIComponent(request.term) + "&app_label=" + grappelli.get_app_label(elem) + "&model_name=" + grappelli.get_model_name(elem) + "&query_string=" + grappelli.get_query_string(elem), + beforeSend: function (XMLHttpRequest) { + var val = $(options.content_type).val() || $(options.content_type).find(':checked').val(); + if (val) { + options.loader.show(); + } else { + return false; + } + }, + success: function(data){ + response($.map(data, function(item) { + return {label: item.label, value: item.value}; + })); + }, + complete: function (XMLHttpRequest, textStatus) { + options.loader.hide(); + } + }); + }, + focus: function() { // prevent value inserted on focus + return false; + }, + select: function(event, ui) { + options.input_field.val(ui.item.label); + elem.val(ui.item.value); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + return false; + } + }) + .data("ui-autocomplete")._renderItem = function(ul,item) { + if (!item.value) { + return $("
        • ") + .data( "item.autocomplete", item ) + .append( "" + item.label) + .appendTo(ul); + } else { + return $("
        • ") + .data( "item.autocomplete", item ) + .append( "" + item.label) + .appendTo(ul); + } + }; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + $.each(data, function(index) { + options.input_field.val(data[index].label); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + }); + }); + }; + + $.fn.grp_autocomplete_generic.defaults = { + autocomplete_lookup_url: '', + lookup_url: '', + content_type: '', + object_id: '' + }; + +})(grp.jQuery); diff --git a/static/grappelli/js/jquery.grp_autocomplete_m2m.js b/static/grappelli/js/jquery.grp_autocomplete_m2m.js new file mode 100644 index 00000000..a44d2e39 --- /dev/null +++ b/static/grappelli/js/jquery.grp_autocomplete_m2m.js @@ -0,0 +1,196 @@ +/** + * GRAPPELLI AUTOCOMPLETE M2M + * many-to-many lookup with autocomplete + */ + + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_autocomplete_m2m.defaults, options); + return this.each(function() { + var $this = $(this); + // assign attributes + $this.attr({ + "tabindex": "-1", + "readonly": "readonly" + }).addClass("grp-autocomplete-hidden-field"); + // build autocomplete wrapper + $this.next().after(loader).after(remove_link($this.attr('id'))); + $this.parent().wrapInner("
          "); + //$this.parent().prepend("").prepend("
            "); + $this.parent().prepend("
            "); + // defaults + options = $.extend({ + wrapper_autocomplete: $this.parent(), + wrapper_repr: $this.parent().find("ul.grp-repr"), + wrapper_search: $this.parent().find("li.grp-search"), + remove_link: $this.next().next().hide(), + loader: $this.next().next().next().hide() + }, $.fn.grp_autocomplete_m2m.defaults, options); + // move errorlist outside the wrapper + if ($this.parent().find("ul.errorlist")) { + $this.parent().find("ul.errorlist").detach().appendTo($this.parent().parent()); + } + // lookup + lookup_id($this, options); // lookup when loading page + lookup_autocomplete($this, options); // autocomplete-handler + $this.bind("change focus keyup", function() { // id-handler + lookup_id($this, options); + }); + // labels + $("label[for='"+$this.attr('id')+"']").each(function() { + $(this).attr("for", $this.attr("id")+"-autocomplete"); + }); + // click on div > focus input + options.wrapper_autocomplete.bind("click", function(e) { + // prevent focus when clicking on remove/select + if (!$(e.target).hasClass("related-lookup") && !$(e.target).hasClass("grp-related-remove")) { + options.wrapper_search.find("input:first").focus(); + } + }); + }); + } + }; + + $.fn.grp_autocomplete_m2m = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_autocomplete_m2m'); + } + return false; + }; + + var value_add = function(elem, value, options) { + var values = []; + if (elem.val()) values = elem.val().split(","); + values.push(value); + elem.val(values.join(",")); + return values.join(","); + }; + + var value_remove = function(elem, position, options) { + var values = []; + if (elem.val()) values = elem.val().split(","); + values.splice(position,1); + elem.val(values.join(",")); + return values.join(","); + }; + + var loader = function() { + var loader = $('
            loader
            '); + return loader; + }; + + var remove_link = function(id) { + var removelink = $('
            '); + removelink.attr('id', 'remove_'+id); + removelink.attr('href', 'javascript://'); + removelink.attr('onClick', 'return removeRelatedObject(this);'); + removelink.hover(function() { + $(this).parent().toggleClass("grp-autocomplete-preremove"); + }); + return removelink; + }; + + var repr_add = function(elem, label, options) { + var repr = $('
          • '); + var removelink = $('' + label + ''); + repr.append(removelink); + repr.insertBefore(options.wrapper_search); + removelink.bind("click", function(e) { // remove-handler + var pos = $(this).parent().parent().children("li").index($(this).parent()); + value_remove(elem, pos, options); + $(this).parent().remove(); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + e.stopPropagation(); // prevent focus on input + }); + removelink.hover(function() { + $(this).parent().toggleClass("grp-autocomplete-preremove"); + }); + }; + + var lookup_autocomplete = function(elem, options) { + options.wrapper_search.find("input:first") + .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(); + } + }) + .bind("focus", function() { + options.wrapper_autocomplete.addClass("grp-state-focus"); + }) + .bind("blur", function() { + options.wrapper_autocomplete.removeClass("grp-state-focus"); + }) + .autocomplete({ + minLength: 1, + delay: 1000, + position: {my: "left top", at: "left bottom", of: options.wrapper_autocomplete}, + open: function(event, ui) { + $(".ui-menu").width(options.wrapper_autocomplete.outerWidth()-6); + }, + source: function(request, response) { + $.ajax({ + url: options.autocomplete_lookup_url, + dataType: 'json', + data: "term=" + encodeURIComponent(request.term) + "&app_label=" + grappelli.get_app_label(elem) + "&model_name=" + grappelli.get_model_name(elem) + "&query_string=" + grappelli.get_query_string(elem), + beforeSend: function (XMLHttpRequest) { + options.loader.show(); + }, + success: function(data){ + response($.map(data, function(item) { + return {label: item.label, value: item.value}; + })); + }, + complete: function (XMLHttpRequest, textStatus) { + options.loader.hide(); + } + }); + }, + focus: function() { // prevent value inserted on focus + return false; + }, + select: function(event, ui) { // add repr, add value + repr_add(elem, ui.item.label, options); + value_add(elem, ui.item.value, options); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + $(this).val("").focus(); + return false; + } + }) + .data("ui-autocomplete")._renderItem = function(ul,item) { + if (!item.value) { + return $("
          • ") + .data( "item.autocomplete", item ) + .append( "" + item.label) + .appendTo(ul); + } else { + return $("
          • ") + .data( "item.autocomplete", item ) + .append( "" + item.label) + .appendTo(ul); + } + }; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem) + }, function(data) { + options.wrapper_repr.find("li.grp-repr").remove(); + options.wrapper_search.find("input").val(""); + $.each(data, function(index) { + if (data[index].value) repr_add(elem, data[index].label, options); + }); + elem.val() ? $(options.remove_link).show() : $(options.remove_link).hide(); + }); + }; + +})(grp.jQuery); diff --git a/static/grappelli/js/jquery.grp_collapsible.js b/static/grappelli/js/jquery.grp_collapsible.js new file mode 100644 index 00000000..b6be9606 --- /dev/null +++ b/static/grappelli/js/jquery.grp_collapsible.js @@ -0,0 +1,35 @@ +/** + * GRAPPELLI COLLAPSIBLES + * handles collapsibles, + * excluding open/closing all elements + * within a group. + */ + +(function($) { + $.fn.grp_collapsible = function(options){ + var defaults = { + toggle_handler_slctr: ".grp-collapse-handler:first", + closed_css: "grp-closed", + open_css: "grp-open", + on_init: function() {}, + on_toggle: function() {} + }; + var opts = $.extend(defaults, options); + return this.each(function() { + _initialize($(this), opts); + }); + }; + var _initialize = function(elem, options) { + options.on_init(elem, options); + _register_handlers(elem, options); + }; + var _register_handlers = function(elem, options) { + _register_toggle_handler(elem, options); + }; + var _register_toggle_handler = function(elem, options) { + elem.children(options.toggle_handler_slctr).click(function() { + elem.toggleClass(options.closed_css).toggleClass(options.open_css); + options.on_toggle(elem, options); + }); + }; +})(grp.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/jquery.grp_collapsible_group.js b/static/grappelli/js/jquery.grp_collapsible_group.js new file mode 100644 index 00000000..d61c5db9 --- /dev/null +++ b/static/grappelli/js/jquery.grp_collapsible_group.js @@ -0,0 +1,54 @@ +/** + * GRAPPELLI GROUP COLLAPSIBLES + * handles open/closing of all elements + * with tabular- and stacked-inlines. + */ + +(function($) { + $.fn.grp_collapsible_group = function(options){ + var defaults = { + open_handler_slctr: ".grp-open-handler", + close_handler_slctr: ".grp-close-handler", + collapsible_container_slctr: ".grp-collapse", + closed_css: "grp-closed", + open_css: "grp-open", + on_init: function() {}, + on_open: function() {}, + on_close: function() {} + }; + options = $.extend(defaults, options); + return this.each(function() { + _initialize($(this), options); + }); + }; + var _initialize = function(elem, options) { + options.on_init(elem, options); + _register_handlers(elem, options); + }; + var _register_handlers = function(elem, options) { + _register_open_handler(elem, options); + _register_close_handler(elem, options); + }; + var _register_open_handler = function(elem, options) { + elem.find(options.open_handler_slctr).each(function() { + $(this).click(function() { + options.on_open(elem, options); + elem.find(options.collapsible_container_slctr) + .removeClass(options.closed_css) + .addClass(options.open_css); + elem.removeClass(options.closed_css) + .addClass(options.open_css); + }); + }); + }; + var _register_close_handler = function(elem, options) { + elem.find(options.close_handler_slctr).each(function() { + $(this).click(function() { + options.on_close(elem, options); + elem.find(options.collapsible_container_slctr) + .removeClass(options.open_css) + .addClass(options.closed_css); + }); + }); + }; +})(grp.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/jquery.grp_inline.js b/static/grappelli/js/jquery.grp_inline.js new file mode 100644 index 00000000..2d20a0b5 --- /dev/null +++ b/static/grappelli/js/jquery.grp_inline.js @@ -0,0 +1,187 @@ +/** + * GRAPPELLI INLINES + * jquery-plugin for inlines (stacked and tabular) + */ + + +(function($) { + $.fn.grp_inline = function(options) { + var defaults = { + prefix: "form", // The form prefix for your django formset + addText: "add another", // Text for the add link + deleteText: "remove", // Text for the delete link + addCssClass: "grp-add-handler", // CSS class applied to the add link + removeCssClass: "grp-remove-handler", // CSS class applied to the remove link + deleteCssClass: "grp-delete-handler", // CSS class applied to the delete link + emptyCssClass: "grp-empty-form", // CSS class applied to the empty row + formCssClass: "grp-dynamic-form", // CSS class applied to each form in a formset + predeleteCssClass: "grp-predelete", + onBeforeInit: function(form) {}, // Function called before a form is initialized + onBeforeAdded: function(inline) {}, // Function called before a form is added + onBeforeRemoved: function(form) {}, // Function called before a form is removed + onBeforeDeleted: function(form) {}, // Function called before a form is deleted + onAfterInit: function(form) {}, // Function called after a form has been initialized + onAfterAdded: function(form) {}, // Function called after a form has been added + onAfterRemoved: function(inline) {}, // Function called after a form has been removed + onAfterDeleted: function(form) {} // Function called after a form has been deleted + }; + options = $.extend(defaults, options); + + return this.each(function() { + var inline = $(this); // the current inline node + var totalForms = inline.find("#id_" + options.prefix + "-TOTAL_FORMS"); + // set autocomplete to off in order to prevent the browser from keeping the current value after reload + totalForms.attr("autocomplete", "off"); + // init inline and add-buttons + initInlineForms(inline, options); + initAddButtons(inline, options); + // button handlers + addButtonHandler(inline.find("a." + options.addCssClass), options); + removeButtonHandler(inline.find("a." + options.removeCssClass), options); + deleteButtonHandler(inline.find("a." + options.deleteCssClass), options); + }); + }; + + updateFormIndex = function(elem, options, replace_regex, replace_with) { + elem.find(':input,span,table,iframe,label,a,ul,p,img,div').each(function() { + var node = $(this), + node_id = node.attr('id'), + node_name = node.attr('name'), + node_for = node.attr('for'), + node_href = node.attr("href"), + node_class = node.attr("class"), + node_onclick = node.attr("onclick"); + if (node_id) { node.attr('id', node_id.replace(replace_regex, replace_with)); } + if (node_name) { node.attr('name', node_name.replace(replace_regex, replace_with)); } + if (node_for) { node.attr('for', node_for.replace(replace_regex, replace_with)); } + if (node_href) { node.attr('href', node_href.replace(replace_regex, replace_with)); } + if (node_class) { node.attr('class', node_class.replace(replace_regex, replace_with)); } + if (node_onclick) { node.attr('onclick', node_onclick.replace(replace_regex, replace_with)); } + }); + }; + + initInlineForms = function(elem, options) { + elem.find("div.grp-module").each(function() { + var form = $(this); + // callback + options.onBeforeInit(form); + // add options.formCssClass to all forms in the inline + // except table/theader/add-item + if (form.attr('id') !== "") { + form.not("." + options.emptyCssClass).not(".grp-table").not(".grp-thead").not(".add-item").addClass(options.formCssClass); + } + // add options.predeleteCssClass to forms with the delete checkbox checked + form.find("li.grp-delete-handler-container input").each(function() { + if ($(this).is(":checked") && form.hasClass("has_original")) { + form.toggleClass(options.predeleteCssClass); + } + }); + // callback + options.onAfterInit(form); + }); + }; + + initAddButtons = function(elem, options) { + var totalForms = elem.find("#id_" + options.prefix + "-TOTAL_FORMS"); + var maxForms = elem.find("#id_" + options.prefix + "-MAX_NUM_FORMS"); + var addButtons = elem.find("a." + options.addCssClass); + // hide add button in case we've hit the max, except we want to add infinitely + if ((maxForms.val() !== '') && (maxForms.val()-totalForms.val()) <= 0) { + hideAddButtons(elem, options); + } + }; + + addButtonHandler = function(elem, options) { + elem.bind("click", function() { + var inline = elem.parents(".grp-group"), + totalForms = inline.find("#id_" + options.prefix + "-TOTAL_FORMS"), + maxForms = inline.find("#id_" + options.prefix + "-MAX_NUM_FORMS"), + addButtons = inline.find("a." + options.addCssClass), + empty_template = inline.find("#" + options.prefix + "-empty"); + // callback + options.onBeforeAdded(inline); + // create new form + var index = parseInt(totalForms.val(), 10), + form = empty_template.clone(true); + form.removeClass(options.emptyCssClass) + .attr("id", empty_template.attr('id').replace("-empty", index)); + // update form index + var re = /__prefix__/g; + updateFormIndex(form, options, re, index); + // after "__prefix__" strings has been substituted with the number + // of the inline, we can add the form to DOM, not earlier. + // This way we can support handlers that track live element + // adding/removing, like those used in django-autocomplete-light + form.insertBefore(empty_template) + .addClass(options.formCssClass); + // update total forms + totalForms.val(index + 1); + // hide add button in case we've hit the max, except we want to add infinitely + if ((maxForms.val() !== 0) && (maxForms.val() !== "") && (maxForms.val() - totalForms.val()) <= 0) { + hideAddButtons(inline, options); + } + // callback + options.onAfterAdded(form); + }); + }; + + removeButtonHandler = function(elem, options) { + elem.bind("click", function() { + var inline = elem.parents(".grp-group"), + form = $(this).parents("." + options.formCssClass).first(), + totalForms = inline.find("#id_" + options.prefix + "-TOTAL_FORMS"), + maxForms = inline.find("#id_" + options.prefix + "-MAX_NUM_FORMS"); + // callback + options.onBeforeRemoved(form); + // remove form + form.remove(); + // update total forms + var index = parseInt(totalForms.val(), 10); + totalForms.val(index - 1); + // show add button in case we've dropped below max + if ((maxForms.val() !== 0) && (maxForms.val() - totalForms.val()) > 0) { + showAddButtons(inline, options); + } + // update form index (for all forms) + var re = /-\d+-/g, + i = 0; + inline.find("." + options.formCssClass).each(function() { + updateFormIndex($(this), options, re, "-" + i + "-"); + i++; + }); + // callback + options.onAfterRemoved(inline); + }); + }; + + deleteButtonHandler = function(elem, options) { + elem.bind("click", function() { + var deleteInput = $(this).prev(), + form = $(this).parents("." + options.formCssClass).first(); + // callback + options.onBeforeDeleted(form); + // toggle options.predeleteCssClass and toggle checkbox + if (form.hasClass("has_original")) { + form.toggleClass(options.predeleteCssClass); + if (deleteInput.prop("checked")) { + deleteInput.removeAttr("checked"); + } else { + deleteInput.prop("checked", true); + } + } + // callback + options.onAfterDeleted(form); + }); + }; + + hideAddButtons = function(elem, options) { + var addButtons = elem.find("a." + options.addCssClass); + addButtons.hide().parents('.grp-add-item').hide(); + }; + + showAddButtons = function(elem, options) { + var addButtons = elem.find("a." + options.addCssClass); + addButtons.show().parents('.grp-add-item').show(); + }; + +})(grp.jQuery); diff --git a/static/grappelli/js/jquery.grp_related_fk.js b/static/grappelli/js/jquery.grp_related_fk.js new file mode 100644 index 00000000..9091c676 --- /dev/null +++ b/static/grappelli/js/jquery.grp_related_fk.js @@ -0,0 +1,66 @@ +/** + * GRAPPELLI RELATED FK + * foreign-key lookup + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_related_fk.defaults, options); + return this.each(function() { + var $this = $(this); + var $parent = $this.parent(); + // remove djangos object representation + if ($parent.find('a.related-lookup').next().is('strong')) { + $parent.find('a.related-lookup').get(0).nextSibling.nodeValue=""; + $parent.find('a.related-lookup').next('strong').remove(); + } + // add placeholder + $parent.find('a.related-lookup').after(options.placeholder); + // add related class + $this.addClass('grp-has-related-lookup'); + // lookup + lookup_id($this, options); // lookup when loading page + $this.bind("change focus keyup", function() { // id-handler + lookup_id($this, options); + }); + }); + } + }; + + $.fn.grp_related_fk = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_related_fk'); + } + return false; + }; + + var lookup_id = function(elem, options) { + var text = elem.parent().find('.grp-placeholder-related-fk'); + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem), + query_string: grappelli.get_query_string(elem) + }, function(data) { + if (data[0].label === "") { + text.hide(); + } else { + text.show(); + } + text.html('' + data[0].label + ''); + }); + }; + + $.fn.grp_related_fk.defaults = { + placeholder: '', + repr_max_length: 30, + lookup_url: '' + }; + +})(grp.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/jquery.grp_related_generic.js b/static/grappelli/js/jquery.grp_related_generic.js new file mode 100644 index 00000000..946f8c45 --- /dev/null +++ b/static/grappelli/js/jquery.grp_related_generic.js @@ -0,0 +1,89 @@ +/** + * GRAPPELLI RELATED FK + * generic lookup + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_related_generic.defaults, options); + return this.each(function() { + var $this = $(this); + // add placeholder + var val = $(options.content_type).val() || $(options.content_type).find(':checked').val(); + if (val) { + $this.after(options.placeholder).after(lookup_link($this.attr('id'),val)); + } + // add related class + $this.addClass('grp-has-related-lookup'); + // lookup + if (val) { + lookup_id($this, options); // lookup when loading page + } + $this.bind("change focus keyup", function() { // id-handler + lookup_id($this, options); + }); + $(options.content_type).bind("change", function() { // content-type-handler + update_lookup($(this), options); + }); + }); + } + }; + + $.fn.grp_related_generic = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_related_generic'); + } + return false; + }; + + var lookup_link = function(id, val) { + var lookuplink = $(''); + lookuplink.attr('id', 'lookup_'+id); + lookuplink.attr('href', "../../../" + MODEL_URL_ARRAY[val].app + "/" + MODEL_URL_ARRAY[val].model + '/?t=id'); + lookuplink.attr('onClick', 'return showRelatedObjectLookupPopup(this);'); + return lookuplink; + }; + + var update_lookup = function(elem, options) { + var obj = $(options.object_id); + obj.val(''); + obj.parent().find('a.related-lookup').remove(); + obj.parent().find('.grp-placeholder-related-generic').remove(); + var val = $(elem).val() || $(elem).find(':checked').val(); + if (val) { + obj.after(options.placeholder).after(lookup_link(obj.attr('id'),val)); + } + }; + + var lookup_id = function(elem, options) { + var text = elem.next().next(); + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem), + query_string: grappelli.get_query_string(elem) + }, function(data) { + if (data[0].label === "") { + text.hide(); + } else { + text.show(); + } + text.html('' + data[0].label + ''); + }); + }; + + $.fn.grp_related_generic.defaults = { + placeholder: '', + repr_max_length: 30, + lookup_url: '', + content_type: '', + object_id: '' + }; + +})(grp.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/jquery.grp_related_m2m.js b/static/grappelli/js/jquery.grp_related_m2m.js new file mode 100644 index 00000000..58098741 --- /dev/null +++ b/static/grappelli/js/jquery.grp_related_m2m.js @@ -0,0 +1,62 @@ +/** + * GRAPPELLI RELATED M2M + * m2m lookup + */ + +(function($){ + + var methods = { + init: function(options) { + options = $.extend({}, $.fn.grp_related_m2m.defaults, options); + return this.each(function() { + var $this = $(this); + // add placeholder + $this.parent().find('a.related-lookup').after(options.placeholder); + // change lookup class + $this.next().addClass("grp-m2m"); + // add related class + $this.addClass('grp-has-related-lookup'); + // lookup + lookup_id($this, options); // lookup when loading page + $this.bind("change focus keyup", function() { // id-handler + lookup_id($this, options); + }); + }); + } + }; + + $.fn.grp_related_m2m = function(method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.grp_related_m2m'); + } + return false; + }; + + var lookup_id = function(elem, options) { + $.getJSON(options.lookup_url, { + object_id: elem.val(), + app_label: grappelli.get_app_label(elem), + model_name: grappelli.get_model_name(elem), + query_string: grappelli.get_query_string(elem) + }, function(data) { + values = $.map(data, function (a) { return '' + a.label + ''; }); + if (values === "") { + elem.parent().find('.grp-placeholder-related-m2m').hide(); + } else { + elem.parent().find('.grp-placeholder-related-m2m').show(); + } + elem.parent().find('.grp-placeholder-related-m2m').html(values.join('')); + }); + }; + + $.fn.grp_related_m2m.defaults = { + placeholder: '', + repr_max_length: 30, + lookup_url: '' + }; + +})(grp.jQuery); \ No newline at end of file diff --git a/static/grappelli/js/jquery.grp_timepicker.js b/static/grappelli/js/jquery.grp_timepicker.js new file mode 100644 index 00000000..3118d65c --- /dev/null +++ b/static/grappelli/js/jquery.grp_timepicker.js @@ -0,0 +1,186 @@ +/** + * GRAPPELLI TIMEPICKER + * works pretty similar to ui.datepicker: + * adds a button to the element + * creates a node (div) at the bottom called ui-timepicker + * element.onClick fills the ui-timepicker node with the time_list (all times you can select) + */ + +(function($) { + $.widget("ui.grp_timepicker", { + // default options + options: { + // template for the container of the timepicker + template: '', + // selector to get the ui-timepicker once it's added to the dom + timepicker_selector: "#ui-timepicker", + // needed offset of the container from the element + offset: { + top: 0 + }, + // if time_list wasn't sent when calling the timepicker we use this + default_time_list: [ + 'now', + '00:00', + '01:00', + '02:00', + '03:00', + '04:00', + '05:00', + '06:00', + '07:00', + '08:00', + '09:00', + '10:00', + '11:00', + '12:00', + '13:00', + '14:00', + '15:00', + '16:00', + '17:00', + '18:00', + '19:00', + '20:00', + '21:00', + '22:00', + '23:00' + ], + // leave this empty!!! + // NOTE: you can't set a default for time_list because if you call: + // $("node").timepicker({time_list: ["01:00", "02:00"]}) + // ui.widget will extend/merge the options.time_list with the one you sent. + time_list: [] + }, + + // init timepicker for a specific element + _create: function() { + // for the events + var self = this; + + // to close timpicker if you click somewhere in the document + $(document).mousedown(function(evt) { + if (self.timepicker.is(":visible")) { + var $target = $(evt.target); + if ($target[0].id != self.timepicker[0].id && $target.parents(self.options.timepicker_selector).length === 0 && !$target.hasClass('hasTimepicker') && !$target.hasClass('ui-timepicker-trigger')) { + self.timepicker.hide(); + } + } + }); + // close on esc + $(document).keyup(function(e) { + if (e.keyCode == 27) { + self.timepicker.hide(); + } + }); + + // get/create timepicker's container + if ($(this.options.timepicker_selector).size() === 0) { + $(this.options.template).appendTo('body'); + } + this.timepicker = $(this.options.timepicker_selector); + this.timepicker.hide(); + + // modify the element and create the button + this.element.addClass("hasTimepicker"); + this.button = $(''); + this.element.after(this.button); + + // disable button if element is disabled + if (this.element.prop("disabled")) { + this.button.prop("disabled", true); + } else { + // register event + this.button.click(function() { + self._toggleTimepicker(); + }); + } + }, + + // called when button is clicked + _toggleTimepicker: function() { + if (this.timepicker.is(":visible")) { + this.timepicker.hide(); + } else { + this.element.focus(); + this._generateTimepickerContents(); + this._showTimepicker(); + } + }, + + // fills timepicker with time_list of element and shows it. + // called by _toggleTimepicker + _generateTimepickerContents: function() { + var self = this, + template_str = "
              "; + + // there is no time_list for this instance so use the default one + if (this.options.time_list.length === 0) { + this.options.time_list = this.options.default_time_list; + } + + for (var i = 0; i < this.options.time_list.length; i++) { + if (this.options.time_list[i] == "now") { + var now = new Date(), + hours = now.getHours(), + minutes = now.getMinutes(); + + hours = ((hours < 10) ? "0" + hours : hours); + minutes = ((minutes < 10) ? "0" + minutes : minutes); + + template_str += '
            • ' + hours + ":" + minutes + '
            • '; + } else { + template_str += '
            • ' + this.options.time_list[i] + '
            • '; + } + } + template_str += "
            "; + + // fill timepicker container + this.timepicker.html(template_str); + + // click handler for items (times) in timepicker + this.timepicker.find('li').click(function() { + // remove active class from all items + $(this).parent().children('li').removeClass("ui-state-active"); + // mark clicked item as active + $(this).addClass("ui-state-active"); + // set the new value and hide the timepicker + self.element.val($(this).html()); + self.timepicker.hide(); + }); + }, + + // sets offset and shows timepicker container + _showTimepicker: function() { + var browserHeight = document.documentElement.clientHeight; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + var tpInputHeight = this.element.outerHeight(); + var tpDialogHeight = this.timepicker.outerHeight() + tpInputHeight; + var offsetTop = this.element.offset().top; + var offsetLeft = this.element.offset().left; + + // check the remaining space within the viewport + // 60 counts for fixed header/footer + var checkSpace = offsetTop - scrollY + tpDialogHeight + 60; + + // position timepicker below or above the input + if (checkSpace < browserHeight) { + // place the timepicker below input + var below = offsetTop + tpInputHeight; + this.timepicker.css('left', offsetLeft + 'px').css('top', below + 'px'); + } else { + // place timepicker above input + var above = offsetTop - tpDialogHeight + tpInputHeight; + this.timepicker.css('left', offsetLeft + 'px').css('top', above + 'px'); + } + // show timepicker + this.timepicker.show(); + }, + + destroy: function() { + $.Widget.prototype.destroy.apply(this, arguments); // default destroy + // now do other stuff particular to this widget + } + + }); +})(grp.jQuery); diff --git a/static/grappelli/js/jquery.init.js b/static/grappelli/js/jquery.init.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/jquery.init.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/jquery.js b/static/grappelli/js/jquery.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/jquery.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/jquery.min.js b/static/grappelli/js/jquery.min.js new file mode 100644 index 00000000..b8a75abe --- /dev/null +++ b/static/grappelli/js/jquery.min.js @@ -0,0 +1,3 @@ +// dropped +// not used in grappelli +// kept this file to prevent 404 \ No newline at end of file diff --git a/static/grappelli/js/json.min.js b/static/grappelli/js/json.min.js new file mode 100644 index 00000000..f708ed51 --- /dev/null +++ b/static/grappelli/js/json.min.js @@ -0,0 +1,29 @@ + +if(!this.JSON){this.JSON={};} +(function(){function f(n){return n<10?'0'+n:n;} +if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ +f(this.getUTCMonth()+1)+'-'+ +f(this.getUTCDate())+'T'+ +f(this.getUTCHours())+':'+ +f(this.getUTCMinutes())+':'+ +f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} +var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} +function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} +if(typeof rep==='function'){value=rep.call(holder,key,value);} +switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} +gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i*[class^=g-d],.l-2c-fluid:not(.grp-cell)>*[class^=g-d],.l-2cr-fluid>*[class^=g-d]{position:relative;display:table-cell;float:none;vertical-align:top}body:not(.rtl) .g-d-c-fluid,body:not(.rtl) .l-2c-fluid:not(.grp-cell),body:not(.rtl) .l-2cr-fluid{margin-right:0 !important;padding-right:0 !important}body:not(.rtl) .g-d-c-fluid>*[class^=g-d],body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d],body:not(.rtl) .l-2cr-fluid>*[class^=g-d]{pmargin-right:0 !important;padding-right:20px}body:not(.rtl) .g-d-c-fluid>*[class^=g-d].g-d-l,body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-d-l,body:not(.rtl) .l-2cr-fluid>*[class^=g-d].g-d-l,body:not(.rtl) .g-d-c-fluid>*[class^=g-d].g-all-l,body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-l,body:not(.rtl) .l-2cr-fluid>*[class^=g-d].g-all-l,body:not(.rtl) .g-d-c-fluid>*[class^=g-d].g-all-fl,body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-fl,body:not(.rtl) .l-2cr-fluid>*[class^=g-d].g-all-fl,body:not(.rtl) .l-2c .g-d-c-fluid>*[class^=g-d].c-2,.l-2c body:not(.rtl) .g-d-c-fluid>*[class^=g-d].c-2,body:not(.rtl) .l-2c .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2c body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body:not(.rtl) .l-2c .l-2cr-fluid>*[class^=g-d].c-2,.l-2c body:not(.rtl) .l-2cr-fluid>*[class^=g-d].c-2,body:not(.rtl) .l-2cr .g-d-c-fluid>*[class^=g-d].c-2,.l-2cr body:not(.rtl) .g-d-c-fluid>*[class^=g-d].c-2,body:not(.rtl) .l-2cr .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2cr body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body:not(.rtl) .l-2cr .l-2cr-fluid>*[class^=g-d].c-2,.l-2cr body:not(.rtl) .l-2cr-fluid>*[class^=g-d].c-2{padding-right:0}body.rtl .g-d-c-fluid,body.rtl .l-2c-fluid:not(.grp-cell),body.rtl .l-2cr-fluid{margin-left:0 !important;padding-left:0 !important}body.rtl .g-d-c-fluid>*[class^=g-d],body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d],body.rtl .l-2cr-fluid>*[class^=g-d]{margin-left:0 !important;padding-left:20px}body.rtl .g-d-c-fluid>*[class^=g-d].g-d-l,body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-d-l,body.rtl .l-2cr-fluid>*[class^=g-d].g-d-l,body.rtl .g-d-c-fluid>*[class^=g-d].g-all-l,body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-l,body.rtl .l-2cr-fluid>*[class^=g-d].g-all-l,body.rtl .g-d-c-fluid>*[class^=g-d].g-all-fl,body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-fl,body.rtl .l-2cr-fluid>*[class^=g-d].g-all-fl,body.rtl .l-2c .g-d-c-fluid>*[class^=g-d].c-2,.l-2c body.rtl .g-d-c-fluid>*[class^=g-d].c-2,body.rtl .l-2c .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2c body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body.rtl .l-2c .l-2cr-fluid>*[class^=g-d].c-2,.l-2c body.rtl .l-2cr-fluid>*[class^=g-d].c-2,body.rtl .l-2cr .g-d-c-fluid>*[class^=g-d].c-2,.l-2cr body.rtl .g-d-c-fluid>*[class^=g-d].c-2,body.rtl .l-2cr .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2cr body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body.rtl .l-2cr .l-2cr-fluid>*[class^=g-d].c-2,.l-2cr body.rtl .l-2cr-fluid>*[class^=g-d].c-2{padding-left:0}.g-base-c{*zoom:1}.g-base-c:after{content:"";display:table;clear:both}.g-base-c.g-centered{float:none;margin:0 auto}.l-2c-fluid:not(.grp-cell) .c-1{margin-left:0;padding-left:20px;vertical-align:top}.l-2c-fluid:not(.grp-cell) .c-2{float:none;display:table-cell;width:100%;vertical-align:top}.grp-row>.l-2c-fluid:not(.grp-cell) .c-2{padding-left:0}.l-2cr-fluid .c-1{float:left !important;display:table-cell;margin-left:0 !important;padding-left:0 !important;margin-right:0 !important;padding-right:20px !important;vertical-align:top}.l-2cr-fluid .c-2{float:right !important;display:table-cell;margin-left:0 !important;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;vertical-align:top}.grp-module .l-2c-fluid .c-2{padding-left:10px}.grp-module .l-2c-fluid.grp-cell .c-1{display:table-cell;vertical-align:top}.grp-module .l-2c-fluid.grp-cell .c-2{display:table-cell;float:none;padding-left:0;width:auto !important;vertical-align:top}.grp-module .l-2c-fluid.grp-cell .c-2 *{white-space:normal} diff --git a/static/grappelli/stylesheets/mueller/grid/output.css b/static/grappelli/stylesheets/mueller/grid/output.css new file mode 100644 index 00000000..d88d3d28 --- /dev/null +++ b/static/grappelli/stylesheets/mueller/grid/output.css @@ -0,0 +1 @@ +* html{font-size:75%}html{font-size:12px;line-height:1.33333em}.g-d-c,.g-all-c{*zoom:1;width:940px}.g-d-c:after,.g-all-c:after{content:"";display:table;clear:both}.g-d-c.g-centered,.g-centered.g-all-c{float:none;margin:0 auto}.g-d{float:left;*zoom:1}.g-d:after{content:"";display:table;clear:both}.g-d-f,.g-all-f,.g-all-fl,.l-2c .c-1,.l-2cr .c-1{margin-left:0 !important;margin-right:20px !important;clear:left}.g-d-l,.g-all-l,.g-all-fl,.l-2c .c-2,.l-2cr .c-2{margin-right:0 !important}.g-d-prepend24{padding-left:960px !important}.g-d-append24,.l-2cr-fluid.l-d-24 .c-2{padding-right:960px !important}.g-d-push24{position:relative;margin-left:960px !important;margin-right:-960px !important;margin-top:0;margin-bottom:0}.g-d-pull24{position:relative;margin-left:-940px !important}.g-d-doublepull24,.l-2cr-fluid.l-d-24 .c-1{position:relative;margin-left:-1960px !important}.g-d-prepend23{padding-left:920px !important}.g-d-append23,.l-2cr-fluid.l-d-23 .c-2{padding-right:920px !important}.g-d-push23{position:relative;margin-left:920px !important;margin-right:-920px !important;margin-top:0;margin-bottom:0}.g-d-pull23{position:relative;margin-left:-900px !important}.g-d-doublepull23,.l-2cr-fluid.l-d-23 .c-1{position:relative;margin-left:-1880px !important}.g-d-prepend22{padding-left:880px !important}.g-d-append22,.l-2cr-fluid.l-d-22 .c-2{padding-right:880px !important}.g-d-push22{position:relative;margin-left:880px !important;margin-right:-880px !important;margin-top:0;margin-bottom:0}.g-d-pull22{position:relative;margin-left:-860px !important}.g-d-doublepull22,.l-2cr-fluid.l-d-22 .c-1{position:relative;margin-left:-1800px !important}.g-d-prepend21{padding-left:840px !important}.g-d-append21,.l-2cr-fluid.l-d-21 .c-2{padding-right:840px !important}.g-d-push21{position:relative;margin-left:840px !important;margin-right:-840px !important;margin-top:0;margin-bottom:0}.g-d-pull21{position:relative;margin-left:-820px !important}.g-d-doublepull21,.l-2cr-fluid.l-d-21 .c-1{position:relative;margin-left:-1720px !important}.g-d-prepend20{padding-left:800px !important}.g-d-append20,.l-2cr-fluid.l-d-20 .c-2{padding-right:800px !important}.g-d-push20{position:relative;margin-left:800px !important;margin-right:-800px !important;margin-top:0;margin-bottom:0}.g-d-pull20{position:relative;margin-left:-780px !important}.g-d-doublepull20,.l-2cr-fluid.l-d-20 .c-1{position:relative;margin-left:-1640px !important}.g-d-prepend19{padding-left:760px !important}.g-d-append19,.l-2cr-fluid.l-d-19 .c-2{padding-right:760px !important}.g-d-push19{position:relative;margin-left:760px !important;margin-right:-760px !important;margin-top:0;margin-bottom:0}.g-d-pull19{position:relative;margin-left:-740px !important}.g-d-doublepull19,.l-2cr-fluid.l-d-19 .c-1{position:relative;margin-left:-1560px !important}.g-d-prepend18{padding-left:720px !important}.g-d-append18,.l-2cr-fluid.l-d-18 .c-2{padding-right:720px !important}.g-d-push18{position:relative;margin-left:720px !important;margin-right:-720px !important;margin-top:0;margin-bottom:0}.g-d-pull18{position:relative;margin-left:-700px !important}.g-d-doublepull18,.l-2cr-fluid.l-d-18 .c-1{position:relative;margin-left:-1480px !important}.g-d-prepend17{padding-left:680px !important}.g-d-append17,.l-2cr-fluid.l-d-17 .c-2{padding-right:680px !important}.g-d-push17{position:relative;margin-left:680px !important;margin-right:-680px !important;margin-top:0;margin-bottom:0}.g-d-pull17{position:relative;margin-left:-660px !important}.g-d-doublepull17,.l-2cr-fluid.l-d-17 .c-1{position:relative;margin-left:-1400px !important}.g-d-prepend16{padding-left:640px !important}.g-d-append16,.l-2cr-fluid.l-d-16 .c-2{padding-right:640px !important}.g-d-push16,.l-2cr .c-1{position:relative;margin-left:640px !important;margin-right:-640px !important;margin-top:0;margin-bottom:0}.g-d-pull16{position:relative;margin-left:-620px !important}.g-d-doublepull16,.l-2cr-fluid.l-d-16 .c-1{position:relative;margin-left:-1320px !important}.g-d-prepend15{padding-left:600px !important}.g-d-append15,.l-2cr-fluid.l-d-15 .c-2{padding-right:600px !important}.g-d-push15{position:relative;margin-left:600px !important;margin-right:-600px !important;margin-top:0;margin-bottom:0}.g-d-pull15{position:relative;margin-left:-580px !important}.g-d-doublepull15,.l-2cr-fluid.l-d-15 .c-1{position:relative;margin-left:-1240px !important}.g-d-prepend14{padding-left:560px !important}.g-d-append14,.l-2cr-fluid.l-d-14 .c-2{padding-right:560px !important}.g-d-push14{position:relative;margin-left:560px !important;margin-right:-560px !important;margin-top:0;margin-bottom:0}.g-d-pull14{position:relative;margin-left:-540px !important}.g-d-doublepull14,.l-2cr-fluid.l-d-14 .c-1{position:relative;margin-left:-1160px !important}.g-d-prepend13{padding-left:520px !important}.g-d-append13,.l-2cr-fluid.l-d-13 .c-2{padding-right:520px !important}.g-d-push13{position:relative;margin-left:520px !important;margin-right:-520px !important;margin-top:0;margin-bottom:0}.g-d-pull13{position:relative;margin-left:-500px !important}.g-d-doublepull13,.l-2cr-fluid.l-d-13 .c-1{position:relative;margin-left:-1080px !important}.g-d-prepend12{padding-left:480px !important}.g-d-append12,.l-2cr-fluid.l-d-12 .c-2{padding-right:480px !important}.g-d-push12{position:relative;margin-left:480px !important;margin-right:-480px !important;margin-top:0;margin-bottom:0}.g-d-pull12{position:relative;margin-left:-460px !important}.g-d-doublepull12,.l-2cr-fluid.l-d-12 .c-1{position:relative;margin-left:-1000px !important}.g-d-prepend11{padding-left:440px !important}.g-d-append11,.l-2cr-fluid.l-d-11 .c-2{padding-right:440px !important}.g-d-push11{position:relative;margin-left:440px !important;margin-right:-440px !important;margin-top:0;margin-bottom:0}.g-d-pull11{position:relative;margin-left:-420px !important}.g-d-doublepull11,.l-2cr-fluid.l-d-11 .c-1{position:relative;margin-left:-920px !important}.g-d-prepend10{padding-left:400px !important}.g-d-append10,.l-2cr-fluid.l-d-10 .c-2{padding-right:400px !important}.g-d-push10{position:relative;margin-left:400px !important;margin-right:-400px !important;margin-top:0;margin-bottom:0}.g-d-pull10{position:relative;margin-left:-380px !important}.g-d-doublepull10,.l-2cr-fluid.l-d-10 .c-1{position:relative;margin-left:-840px !important}.g-d-prepend9{padding-left:360px !important}.g-d-append9,.l-2cr-fluid.l-d-9 .c-2{padding-right:360px !important}.g-d-push9{position:relative;margin-left:360px !important;margin-right:-360px !important;margin-top:0;margin-bottom:0}.g-d-pull9{position:relative;margin-left:-340px !important}.g-d-doublepull9,.l-2cr-fluid.l-d-9 .c-1{position:relative;margin-left:-760px !important}.g-d-prepend8{padding-left:320px !important}.g-d-append8,.l-2cr-fluid.l-d-8 .c-2{padding-right:320px !important}.g-d-push8{position:relative;margin-left:320px !important;margin-right:-320px !important;margin-top:0;margin-bottom:0}.g-d-pull8,.l-2cr .c-2{position:relative;margin-left:-300px !important}.g-d-doublepull8,.l-2cr-fluid.l-d-8 .c-1{position:relative;margin-left:-680px !important}.g-d-prepend7{padding-left:280px !important}.g-d-append7,.l-2cr-fluid.l-d-7 .c-2{padding-right:280px !important}.g-d-push7{position:relative;margin-left:280px !important;margin-right:-280px !important;margin-top:0;margin-bottom:0}.g-d-pull7{position:relative;margin-left:-260px !important}.g-d-doublepull7,.l-2cr-fluid.l-d-7 .c-1{position:relative;margin-left:-600px !important}.g-d-prepend6{padding-left:240px !important}.g-d-append6,.l-2cr-fluid.l-d-6 .c-2{padding-right:240px !important}.g-d-push6{position:relative;margin-left:240px !important;margin-right:-240px !important;margin-top:0;margin-bottom:0}.g-d-pull6{position:relative;margin-left:-220px !important}.g-d-doublepull6,.l-2cr-fluid.l-d-6 .c-1{position:relative;margin-left:-520px !important}.g-d-prepend5{padding-left:200px !important}.g-d-append5,.l-2cr-fluid.l-d-5 .c-2{padding-right:200px !important}.g-d-push5{position:relative;margin-left:200px !important;margin-right:-200px !important;margin-top:0;margin-bottom:0}.g-d-pull5{position:relative;margin-left:-180px !important}.g-d-doublepull5,.l-2cr-fluid.l-d-5 .c-1{position:relative;margin-left:-440px !important}.g-d-prepend4{padding-left:160px !important}.g-d-append4,.l-2cr-fluid.l-d-4 .c-2{padding-right:160px !important}.g-d-push4{position:relative;margin-left:160px !important;margin-right:-160px !important;margin-top:0;margin-bottom:0}.g-d-pull4{position:relative;margin-left:-140px !important}.g-d-doublepull4,.l-2cr-fluid.l-d-4 .c-1{position:relative;margin-left:-360px !important}.g-d-prepend3{padding-left:120px !important}.g-d-append3,.l-2cr-fluid.l-d-3 .c-2{padding-right:120px !important}.g-d-push3{position:relative;margin-left:120px !important;margin-right:-120px !important;margin-top:0;margin-bottom:0}.g-d-pull3{position:relative;margin-left:-100px !important}.g-d-doublepull3,.l-2cr-fluid.l-d-3 .c-1{position:relative;margin-left:-280px !important}.g-d-prepend2{padding-left:80px !important}.g-d-append2,.l-2cr-fluid.l-d-2 .c-2{padding-right:80px !important}.g-d-push2{position:relative;margin-left:80px !important;margin-right:-80px !important;margin-top:0;margin-bottom:0}.g-d-pull2{position:relative;margin-left:-60px !important}.g-d-doublepull2,.l-2cr-fluid.l-d-2 .c-1{position:relative;margin-left:-200px !important}.g-d-prepend1{padding-left:40px !important}.g-d-append1,.l-2cr-fluid.l-d-1 .c-2{padding-right:40px !important}.g-d-push1{position:relative;margin-left:40px !important;margin-right:-40px !important;margin-top:0;margin-bottom:0}.g-d-pull1{position:relative;margin-left:-20px !important}.g-d-doublepull1,.l-2cr-fluid.l-d-1 .c-1{position:relative;margin-left:-120px !important}.g-d-prepend0{padding-left:0px !important}.g-d-append0{padding-right:0px !important}.g-d-push0{position:relative;margin-left:0px !important;margin-right:0px !important;margin-top:0;margin-bottom:0}.g-d-pull0{position:relative;margin-left:20px !important}.g-d-doublepull0{position:relative;margin-left:-40px !important}.g-d-24,.l-2c,.l-2cr,.l-2cr-fluid.l-d-24 .c-1{float:left;*zoom:1;margin-left:0 !important;margin-right:0 !important;clear:both;width:940px}.g-d-24:after,.l-2c:after,.l-2cr:after,.l-2cr-fluid.l-d-24 .c-1:after{content:"";display:table;clear:both}.g-d-23,.l-2cr-fluid.l-d-23 .c-1{float:left;*zoom:1;margin-right:20px;width:900px}.g-d-23:after,.l-2cr-fluid.l-d-23 .c-1:after{content:"";display:table;clear:both}.g-d-22,.l-2cr-fluid.l-d-22 .c-1{float:left;*zoom:1;margin-right:20px;width:860px}.g-d-22:after,.l-2cr-fluid.l-d-22 .c-1:after{content:"";display:table;clear:both}.g-d-21,.l-2cr-fluid.l-d-21 .c-1{float:left;*zoom:1;margin-right:20px;width:820px}.g-d-21:after,.l-2cr-fluid.l-d-21 .c-1:after{content:"";display:table;clear:both}.g-d-20,.l-2cr-fluid.l-d-20 .c-1{float:left;*zoom:1;margin-right:20px;width:780px}.g-d-20:after,.l-2cr-fluid.l-d-20 .c-1:after{content:"";display:table;clear:both}.g-d-19,.l-2cr-fluid.l-d-19 .c-1{float:left;*zoom:1;margin-right:20px;width:740px}.g-d-19:after,.l-2cr-fluid.l-d-19 .c-1:after{content:"";display:table;clear:both}.g-d-18,.l-2cr-fluid.l-d-18 .c-1{float:left;*zoom:1;margin-right:20px;width:700px}.g-d-18:after,.l-2cr-fluid.l-d-18 .c-1:after{content:"";display:table;clear:both}.g-d-17,.l-2cr-fluid.l-d-17 .c-1{float:left;*zoom:1;margin-right:20px;width:660px}.g-d-17:after,.l-2cr-fluid.l-d-17 .c-1:after{content:"";display:table;clear:both}.g-d-16,.l-2c .c-2,.l-2cr .c-2,.l-2cr-fluid.l-d-16 .c-1{float:left;*zoom:1;margin-right:20px;width:620px}.g-d-16:after,.l-2c .c-2:after,.l-2cr .c-2:after,.l-2cr-fluid.l-d-16 .c-1:after{content:"";display:table;clear:both}.g-d-15,.l-2cr-fluid.l-d-15 .c-1{float:left;*zoom:1;margin-right:20px;width:580px}.g-d-15:after,.l-2cr-fluid.l-d-15 .c-1:after{content:"";display:table;clear:both}.g-d-14,.l-2cr-fluid.l-d-14 .c-1{float:left;*zoom:1;margin-right:20px;width:540px}.g-d-14:after,.l-2cr-fluid.l-d-14 .c-1:after{content:"";display:table;clear:both}.g-d-13,.l-2cr-fluid.l-d-13 .c-1{float:left;*zoom:1;margin-right:20px;width:500px}.g-d-13:after,.l-2cr-fluid.l-d-13 .c-1:after{content:"";display:table;clear:both}.g-d-12,.l-2cr-fluid.l-d-12 .c-1{float:left;*zoom:1;margin-right:20px;width:460px}.g-d-12:after,.l-2cr-fluid.l-d-12 .c-1:after{content:"";display:table;clear:both}.g-d-11,.l-2cr-fluid.l-d-11 .c-1{float:left;*zoom:1;margin-right:20px;width:420px}.g-d-11:after,.l-2cr-fluid.l-d-11 .c-1:after{content:"";display:table;clear:both}.g-d-10,.l-2cr-fluid.l-d-10 .c-1{float:left;*zoom:1;margin-right:20px;width:380px}.g-d-10:after,.l-2cr-fluid.l-d-10 .c-1:after{content:"";display:table;clear:both}.g-d-9,.l-2cr-fluid.l-d-9 .c-1{float:left;*zoom:1;margin-right:20px;width:340px}.g-d-9:after,.l-2cr-fluid.l-d-9 .c-1:after{content:"";display:table;clear:both}.g-d-8,.l-2c .c-1,.l-2cr .c-1,.l-2cr-fluid.l-d-8 .c-1{float:left;*zoom:1;margin-right:20px;width:300px}.g-d-8:after,.l-2c .c-1:after,.l-2cr .c-1:after,.l-2cr-fluid.l-d-8 .c-1:after{content:"";display:table;clear:both}.g-d-7,.l-2cr-fluid.l-d-7 .c-1{float:left;*zoom:1;margin-right:20px;width:260px}.g-d-7:after,.l-2cr-fluid.l-d-7 .c-1:after{content:"";display:table;clear:both}.g-d-6,.l-2cr-fluid.l-d-6 .c-1{float:left;*zoom:1;margin-right:20px;width:220px}.g-d-6:after,.l-2cr-fluid.l-d-6 .c-1:after{content:"";display:table;clear:both}.g-d-5,.l-2cr-fluid.l-d-5 .c-1{float:left;*zoom:1;margin-right:20px;width:180px}.g-d-5:after,.l-2cr-fluid.l-d-5 .c-1:after{content:"";display:table;clear:both}.g-d-4,.l-2cr-fluid.l-d-4 .c-1{float:left;*zoom:1;margin-right:20px;width:140px}.g-d-4:after,.l-2cr-fluid.l-d-4 .c-1:after{content:"";display:table;clear:both}.g-d-3,.l-2cr-fluid.l-d-3 .c-1{float:left;*zoom:1;margin-right:20px;width:100px}.g-d-3:after,.l-2cr-fluid.l-d-3 .c-1:after{content:"";display:table;clear:both}.g-d-2,.l-2cr-fluid.l-d-2 .c-1{float:left;*zoom:1;margin-right:20px;width:60px}.g-d-2:after,.l-2cr-fluid.l-d-2 .c-1:after{content:"";display:table;clear:both}.g-d-1,.l-2cr-fluid.l-d-1 .c-1{float:left;*zoom:1;margin-right:20px;width:20px}.g-d-1:after,.l-2cr-fluid.l-d-1 .c-1:after{content:"";display:table;clear:both}.g-d-0{float:left;*zoom:1;margin-right:20px;width:-20px}.g-d-0:after{content:"";display:table;clear:both}.g-d-24-td,.l-2c-fluid:not(.grp-cell).l-d-24 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-24 .c-1{float:left;*zoom:1;margin-left:0 !important;margin-right:0 !important;padding-right:0 !important;clear:both;width:940px;min-width:940px;float:none;display:table-cell}.g-d-24-td:after,.l-2c-fluid:not(.grp-cell).l-d-24 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-24 .c-1:after{content:"";display:table;clear:both}.g-d-23-td,.l-2c-fluid:not(.grp-cell).l-d-23 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-23 .c-1{float:left;*zoom:1;padding-right:20px;width:900px;min-width:900px;float:none;display:table-cell}.g-d-23-td:after,.l-2c-fluid:not(.grp-cell).l-d-23 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-23 .c-1:after{content:"";display:table;clear:both}.g-d-22-td,.l-2c-fluid:not(.grp-cell).l-d-22 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-22 .c-1{float:left;*zoom:1;padding-right:20px;width:860px;min-width:860px;float:none;display:table-cell}.g-d-22-td:after,.l-2c-fluid:not(.grp-cell).l-d-22 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-22 .c-1:after{content:"";display:table;clear:both}.g-d-21-td,.l-2c-fluid:not(.grp-cell).l-d-21 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-21 .c-1{float:left;*zoom:1;padding-right:20px;width:820px;min-width:820px;float:none;display:table-cell}.g-d-21-td:after,.l-2c-fluid:not(.grp-cell).l-d-21 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-21 .c-1:after{content:"";display:table;clear:both}.g-d-20-td,.l-2c-fluid:not(.grp-cell).l-d-20 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-20 .c-1{float:left;*zoom:1;padding-right:20px;width:780px;min-width:780px;float:none;display:table-cell}.g-d-20-td:after,.l-2c-fluid:not(.grp-cell).l-d-20 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-20 .c-1:after{content:"";display:table;clear:both}.g-d-19-td,.l-2c-fluid:not(.grp-cell).l-d-19 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-19 .c-1{float:left;*zoom:1;padding-right:20px;width:740px;min-width:740px;float:none;display:table-cell}.g-d-19-td:after,.l-2c-fluid:not(.grp-cell).l-d-19 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-19 .c-1:after{content:"";display:table;clear:both}.g-d-18-td,.l-2c-fluid:not(.grp-cell).l-d-18 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-18 .c-1{float:left;*zoom:1;padding-right:20px;width:700px;min-width:700px;float:none;display:table-cell}.g-d-18-td:after,.l-2c-fluid:not(.grp-cell).l-d-18 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-18 .c-1:after{content:"";display:table;clear:both}.g-d-17-td,.l-2c-fluid:not(.grp-cell).l-d-17 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-17 .c-1{float:left;*zoom:1;padding-right:20px;width:660px;min-width:660px;float:none;display:table-cell}.g-d-17-td:after,.l-2c-fluid:not(.grp-cell).l-d-17 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-17 .c-1:after{content:"";display:table;clear:both}.g-d-16-td,.l-2c-fluid:not(.grp-cell).l-d-16 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-16 .c-1{float:left;*zoom:1;padding-right:20px;width:620px;min-width:620px;float:none;display:table-cell}.g-d-16-td:after,.l-2c-fluid:not(.grp-cell).l-d-16 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-16 .c-1:after{content:"";display:table;clear:both}.g-d-15-td,.l-2c-fluid:not(.grp-cell).l-d-15 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-15 .c-1{float:left;*zoom:1;padding-right:20px;width:580px;min-width:580px;float:none;display:table-cell}.g-d-15-td:after,.l-2c-fluid:not(.grp-cell).l-d-15 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-15 .c-1:after{content:"";display:table;clear:both}.g-d-14-td,.l-2c-fluid:not(.grp-cell).l-d-14 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-14 .c-1{float:left;*zoom:1;padding-right:20px;width:540px;min-width:540px;float:none;display:table-cell}.g-d-14-td:after,.l-2c-fluid:not(.grp-cell).l-d-14 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-14 .c-1:after{content:"";display:table;clear:both}.g-d-13-td,.l-2c-fluid:not(.grp-cell).l-d-13 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-13 .c-1{float:left;*zoom:1;padding-right:20px;width:500px;min-width:500px;float:none;display:table-cell}.g-d-13-td:after,.l-2c-fluid:not(.grp-cell).l-d-13 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-13 .c-1:after{content:"";display:table;clear:both}.g-d-12-td,.l-2c-fluid:not(.grp-cell).l-d-12 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-12 .c-1{float:left;*zoom:1;padding-right:20px;width:460px;min-width:460px;float:none;display:table-cell}.g-d-12-td:after,.l-2c-fluid:not(.grp-cell).l-d-12 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-12 .c-1:after{content:"";display:table;clear:both}.g-d-11-td,.l-2c-fluid:not(.grp-cell).l-d-11 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-11 .c-1{float:left;*zoom:1;padding-right:20px;width:420px;min-width:420px;float:none;display:table-cell}.g-d-11-td:after,.l-2c-fluid:not(.grp-cell).l-d-11 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-11 .c-1:after{content:"";display:table;clear:both}.g-d-10-td,.l-2c-fluid:not(.grp-cell).l-d-10 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-10 .c-1{float:left;*zoom:1;padding-right:20px;width:380px;min-width:380px;float:none;display:table-cell}.g-d-10-td:after,.l-2c-fluid:not(.grp-cell).l-d-10 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-10 .c-1:after{content:"";display:table;clear:both}.g-d-9-td,.l-2c-fluid:not(.grp-cell).l-d-9 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-9 .c-1{float:left;*zoom:1;padding-right:20px;width:340px;min-width:340px;float:none;display:table-cell}.g-d-9-td:after,.l-2c-fluid:not(.grp-cell).l-d-9 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-9 .c-1:after{content:"";display:table;clear:both}.g-d-8-td,.l-2c-fluid:not(.grp-cell).l-d-8 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-8 .c-1{float:left;*zoom:1;padding-right:20px;width:300px;min-width:300px;float:none;display:table-cell}.g-d-8-td:after,.l-2c-fluid:not(.grp-cell).l-d-8 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-8 .c-1:after{content:"";display:table;clear:both}.g-d-7-td,.l-2c-fluid:not(.grp-cell).l-d-7 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-7 .c-1{float:left;*zoom:1;padding-right:20px;width:260px;min-width:260px;float:none;display:table-cell}.g-d-7-td:after,.l-2c-fluid:not(.grp-cell).l-d-7 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-7 .c-1:after{content:"";display:table;clear:both}.g-d-6-td,.l-2c-fluid:not(.grp-cell).l-d-6 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-6 .c-1{float:left;*zoom:1;padding-right:20px;width:220px;min-width:220px;float:none;display:table-cell}.g-d-6-td:after,.l-2c-fluid:not(.grp-cell).l-d-6 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-6 .c-1:after{content:"";display:table;clear:both}.g-d-5-td,.l-2c-fluid:not(.grp-cell).l-d-5 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-5 .c-1{float:left;*zoom:1;padding-right:20px;width:180px;min-width:180px;float:none;display:table-cell}.g-d-5-td:after,.l-2c-fluid:not(.grp-cell).l-d-5 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-5 .c-1:after{content:"";display:table;clear:both}.g-d-4-td,.l-2c-fluid:not(.grp-cell).l-d-4 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-4 .c-1{float:left;*zoom:1;padding-right:20px;width:140px;min-width:140px;float:none;display:table-cell}.g-d-4-td:after,.l-2c-fluid:not(.grp-cell).l-d-4 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-4 .c-1:after{content:"";display:table;clear:both}.g-d-3-td,.l-2c-fluid:not(.grp-cell).l-d-3 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-3 .c-1{float:left;*zoom:1;padding-right:20px;width:100px;min-width:100px;float:none;display:table-cell}.g-d-3-td:after,.l-2c-fluid:not(.grp-cell).l-d-3 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-3 .c-1:after{content:"";display:table;clear:both}.g-d-2-td,.l-2c-fluid:not(.grp-cell).l-d-2 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-2 .c-1{float:left;*zoom:1;padding-right:20px;width:60px;min-width:60px;float:none;display:table-cell}.g-d-2-td:after,.l-2c-fluid:not(.grp-cell).l-d-2 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-2 .c-1:after{content:"";display:table;clear:both}.g-d-1-td,.l-2c-fluid:not(.grp-cell).l-d-1 .c-1,.grp-module .l-2c-fluid.grp-cell.l-d-1 .c-1{float:left;*zoom:1;padding-right:20px;width:20px;min-width:20px;float:none;display:table-cell}.g-d-1-td:after,.l-2c-fluid:not(.grp-cell).l-d-1 .c-1:after,.grp-module .l-2c-fluid.grp-cell.l-d-1 .c-1:after{content:"";display:table;clear:both}.g-d-0-td{float:left;*zoom:1;padding-right:20px;width:-20px;min-width:-20px;float:none;display:table-cell}.g-d-0-td:after{content:"";display:table;clear:both}.g-d-24 input[type=text],.l-2c input[type=text],.l-2cr input[type=text],.l-2cr-fluid.l-d-24 .c-1 input[type=text],.g-d-24 input[type=password],.l-2c input[type=password],.l-2cr input[type=password],.l-2cr-fluid.l-d-24 .c-1 input[type=password],.g-d-24 select,.l-2c select,.l-2cr select,.l-2cr-fluid.l-d-24 .c-1 select,.g-d-24 textarea,.l-2c textarea,.l-2cr textarea,.l-2cr-fluid.l-d-24 .c-1 textarea{width:100%}.g-d-23 input[type=text],.l-2cr-fluid.l-d-23 .c-1 input[type=text],.g-d-23 input[type=password],.l-2cr-fluid.l-d-23 .c-1 input[type=password],.g-d-23 select,.l-2cr-fluid.l-d-23 .c-1 select,.g-d-23 textarea,.l-2cr-fluid.l-d-23 .c-1 textarea{width:100%}.g-d-22 input[type=text],.l-2cr-fluid.l-d-22 .c-1 input[type=text],.g-d-22 input[type=password],.l-2cr-fluid.l-d-22 .c-1 input[type=password],.g-d-22 select,.l-2cr-fluid.l-d-22 .c-1 select,.g-d-22 textarea,.l-2cr-fluid.l-d-22 .c-1 textarea{width:100%}.g-d-21 input[type=text],.l-2cr-fluid.l-d-21 .c-1 input[type=text],.g-d-21 input[type=password],.l-2cr-fluid.l-d-21 .c-1 input[type=password],.g-d-21 select,.l-2cr-fluid.l-d-21 .c-1 select,.g-d-21 textarea,.l-2cr-fluid.l-d-21 .c-1 textarea{width:100%}.g-d-20 input[type=text],.l-2cr-fluid.l-d-20 .c-1 input[type=text],.g-d-20 input[type=password],.l-2cr-fluid.l-d-20 .c-1 input[type=password],.g-d-20 select,.l-2cr-fluid.l-d-20 .c-1 select,.g-d-20 textarea,.l-2cr-fluid.l-d-20 .c-1 textarea{width:100%}.g-d-19 input[type=text],.l-2cr-fluid.l-d-19 .c-1 input[type=text],.g-d-19 input[type=password],.l-2cr-fluid.l-d-19 .c-1 input[type=password],.g-d-19 select,.l-2cr-fluid.l-d-19 .c-1 select,.g-d-19 textarea,.l-2cr-fluid.l-d-19 .c-1 textarea{width:100%}.g-d-18 input[type=text],.l-2cr-fluid.l-d-18 .c-1 input[type=text],.g-d-18 input[type=password],.l-2cr-fluid.l-d-18 .c-1 input[type=password],.g-d-18 select,.l-2cr-fluid.l-d-18 .c-1 select,.g-d-18 textarea,.l-2cr-fluid.l-d-18 .c-1 textarea{width:100%}.g-d-17 input[type=text],.l-2cr-fluid.l-d-17 .c-1 input[type=text],.g-d-17 input[type=password],.l-2cr-fluid.l-d-17 .c-1 input[type=password],.g-d-17 select,.l-2cr-fluid.l-d-17 .c-1 select,.g-d-17 textarea,.l-2cr-fluid.l-d-17 .c-1 textarea{width:100%}.g-d-16 input[type=text],.l-2c .c-2 input[type=text],.l-2cr .c-2 input[type=text],.l-2cr-fluid.l-d-16 .c-1 input[type=text],.g-d-16 input[type=password],.l-2c .c-2 input[type=password],.l-2cr .c-2 input[type=password],.l-2cr-fluid.l-d-16 .c-1 input[type=password],.g-d-16 select,.l-2c .c-2 select,.l-2cr .c-2 select,.l-2cr-fluid.l-d-16 .c-1 select,.g-d-16 textarea,.l-2c .c-2 textarea,.l-2cr .c-2 textarea,.l-2cr-fluid.l-d-16 .c-1 textarea{width:100%}.g-d-15 input[type=text],.l-2cr-fluid.l-d-15 .c-1 input[type=text],.g-d-15 input[type=password],.l-2cr-fluid.l-d-15 .c-1 input[type=password],.g-d-15 select,.l-2cr-fluid.l-d-15 .c-1 select,.g-d-15 textarea,.l-2cr-fluid.l-d-15 .c-1 textarea{width:100%}.g-d-14 input[type=text],.l-2cr-fluid.l-d-14 .c-1 input[type=text],.g-d-14 input[type=password],.l-2cr-fluid.l-d-14 .c-1 input[type=password],.g-d-14 select,.l-2cr-fluid.l-d-14 .c-1 select,.g-d-14 textarea,.l-2cr-fluid.l-d-14 .c-1 textarea{width:100%}.g-d-13 input[type=text],.l-2cr-fluid.l-d-13 .c-1 input[type=text],.g-d-13 input[type=password],.l-2cr-fluid.l-d-13 .c-1 input[type=password],.g-d-13 select,.l-2cr-fluid.l-d-13 .c-1 select,.g-d-13 textarea,.l-2cr-fluid.l-d-13 .c-1 textarea{width:100%}.g-d-12 input[type=text],.l-2cr-fluid.l-d-12 .c-1 input[type=text],.g-d-12 input[type=password],.l-2cr-fluid.l-d-12 .c-1 input[type=password],.g-d-12 select,.l-2cr-fluid.l-d-12 .c-1 select,.g-d-12 textarea,.l-2cr-fluid.l-d-12 .c-1 textarea{width:100%}.g-d-11 input[type=text],.l-2cr-fluid.l-d-11 .c-1 input[type=text],.g-d-11 input[type=password],.l-2cr-fluid.l-d-11 .c-1 input[type=password],.g-d-11 select,.l-2cr-fluid.l-d-11 .c-1 select,.g-d-11 textarea,.l-2cr-fluid.l-d-11 .c-1 textarea{width:100%}.g-d-10 input[type=text],.l-2cr-fluid.l-d-10 .c-1 input[type=text],.g-d-10 input[type=password],.l-2cr-fluid.l-d-10 .c-1 input[type=password],.g-d-10 select,.l-2cr-fluid.l-d-10 .c-1 select,.g-d-10 textarea,.l-2cr-fluid.l-d-10 .c-1 textarea{width:100%}.g-d-9 input[type=text],.l-2cr-fluid.l-d-9 .c-1 input[type=text],.g-d-9 input[type=password],.l-2cr-fluid.l-d-9 .c-1 input[type=password],.g-d-9 select,.l-2cr-fluid.l-d-9 .c-1 select,.g-d-9 textarea,.l-2cr-fluid.l-d-9 .c-1 textarea{width:100%}.g-d-8 input[type=text],.l-2c .c-1 input[type=text],.l-2cr .c-1 input[type=text],.l-2cr-fluid.l-d-8 .c-1 input[type=text],.g-d-8 input[type=password],.l-2c .c-1 input[type=password],.l-2cr .c-1 input[type=password],.l-2cr-fluid.l-d-8 .c-1 input[type=password],.g-d-8 select,.l-2c .c-1 select,.l-2cr .c-1 select,.l-2cr-fluid.l-d-8 .c-1 select,.g-d-8 textarea,.l-2c .c-1 textarea,.l-2cr .c-1 textarea,.l-2cr-fluid.l-d-8 .c-1 textarea{width:100%}.g-d-7 input[type=text],.l-2cr-fluid.l-d-7 .c-1 input[type=text],.g-d-7 input[type=password],.l-2cr-fluid.l-d-7 .c-1 input[type=password],.g-d-7 select,.l-2cr-fluid.l-d-7 .c-1 select,.g-d-7 textarea,.l-2cr-fluid.l-d-7 .c-1 textarea{width:100%}.g-d-6 input[type=text],.l-2cr-fluid.l-d-6 .c-1 input[type=text],.g-d-6 input[type=password],.l-2cr-fluid.l-d-6 .c-1 input[type=password],.g-d-6 select,.l-2cr-fluid.l-d-6 .c-1 select,.g-d-6 textarea,.l-2cr-fluid.l-d-6 .c-1 textarea{width:100%}.g-d-5 input[type=text],.l-2cr-fluid.l-d-5 .c-1 input[type=text],.g-d-5 input[type=password],.l-2cr-fluid.l-d-5 .c-1 input[type=password],.g-d-5 select,.l-2cr-fluid.l-d-5 .c-1 select,.g-d-5 textarea,.l-2cr-fluid.l-d-5 .c-1 textarea{width:100%}.g-d-4 input[type=text],.l-2cr-fluid.l-d-4 .c-1 input[type=text],.g-d-4 input[type=password],.l-2cr-fluid.l-d-4 .c-1 input[type=password],.g-d-4 select,.l-2cr-fluid.l-d-4 .c-1 select,.g-d-4 textarea,.l-2cr-fluid.l-d-4 .c-1 textarea{width:100%}.g-d-3 input[type=text],.l-2cr-fluid.l-d-3 .c-1 input[type=text],.g-d-3 input[type=password],.l-2cr-fluid.l-d-3 .c-1 input[type=password],.g-d-3 select,.l-2cr-fluid.l-d-3 .c-1 select,.g-d-3 textarea,.l-2cr-fluid.l-d-3 .c-1 textarea{width:100%}.g-d-2 input[type=text],.l-2cr-fluid.l-d-2 .c-1 input[type=text],.g-d-2 input[type=password],.l-2cr-fluid.l-d-2 .c-1 input[type=password],.g-d-2 select,.l-2cr-fluid.l-d-2 .c-1 select,.g-d-2 textarea,.l-2cr-fluid.l-d-2 .c-1 textarea{width:100%}.g-d-1 input[type=text],.l-2cr-fluid.l-d-1 .c-1 input[type=text],.g-d-1 input[type=password],.l-2cr-fluid.l-d-1 .c-1 input[type=password],.g-d-1 select,.l-2cr-fluid.l-d-1 .c-1 select,.g-d-1 textarea,.l-2cr-fluid.l-d-1 .c-1 textarea{width:100%}.g-d-0 input[type=text],.g-d-0 input[type=password],.g-d-0 select,.g-d-0 textarea{width:100%}.l-show,.h-show,.hp-show,.hl-show,.t-show,.tp-show,.tl-show{display:none !important}.d-hide{display:none !important}.d-show{display:block !important}a.d-show,abbr.d-show,acronym.d-show,audio.d-show,b.d-show,basefont.d-show,bdo.d-show,big.d-show,br.d-show,canvas.d-show,cite.d-show,code.d-show,command.d-show,datalist.d-show,dfn.d-show,em.d-show,embed.d-show,font.d-show,i.d-show,img.d-show,input.d-show,keygen.d-show,kbd.d-show,label.d-show,mark.d-show,meter.d-show,output.d-show,progress.d-show,q.d-show,rp.d-show,rt.d-show,ruby.d-show,s.d-show,samp.d-show,select.d-show,small.d-show,span.d-show,strike.d-show,strong.d-show,sub.d-show,sup.d-show,textarea.d-show,time.d-show,tt.d-show,u.d-show,var.d-show,video.d-show,wbr.d-show{display:inline !important}.g-d-c,.g-all-c{*zoom:1}.g-d-c:after,.g-all-c:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.g-d-c-fluid,.l-2c-fluid:not(.grp-cell),.l-2cr-fluid{position:relative;float:none;clear:both;display:table;table-layout:fixed;width:100%;*zoom:1}.g-d-c-fluid:after,.l-2c-fluid:not(.grp-cell):after,.l-2cr-fluid:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.g-d-c-fluid>*[class^=g-d],.l-2c-fluid:not(.grp-cell)>*[class^=g-d],.l-2cr-fluid>*[class^=g-d]{position:relative;display:table-cell;float:none;vertical-align:top}body:not(.rtl) .g-d-c-fluid,body:not(.rtl) .l-2c-fluid:not(.grp-cell),body:not(.rtl) .l-2cr-fluid{margin-right:0 !important;padding-right:0 !important}body:not(.rtl) .g-d-c-fluid>*[class^=g-d],body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d],body:not(.rtl) .l-2cr-fluid>*[class^=g-d]{pmargin-right:0 !important;padding-right:20px}body:not(.rtl) .g-d-c-fluid>*[class^=g-d].g-d-l,body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-d-l,body:not(.rtl) .l-2cr-fluid>*[class^=g-d].g-d-l,body:not(.rtl) .g-d-c-fluid>*[class^=g-d].g-all-l,body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-l,body:not(.rtl) .l-2cr-fluid>*[class^=g-d].g-all-l,body:not(.rtl) .g-d-c-fluid>*[class^=g-d].g-all-fl,body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-fl,body:not(.rtl) .l-2cr-fluid>*[class^=g-d].g-all-fl,body:not(.rtl) .l-2c .g-d-c-fluid>*[class^=g-d].c-2,.l-2c body:not(.rtl) .g-d-c-fluid>*[class^=g-d].c-2,body:not(.rtl) .l-2c .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2c body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body:not(.rtl) .l-2c .l-2cr-fluid>*[class^=g-d].c-2,.l-2c body:not(.rtl) .l-2cr-fluid>*[class^=g-d].c-2,body:not(.rtl) .l-2cr .g-d-c-fluid>*[class^=g-d].c-2,.l-2cr body:not(.rtl) .g-d-c-fluid>*[class^=g-d].c-2,body:not(.rtl) .l-2cr .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2cr body:not(.rtl) .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body:not(.rtl) .l-2cr .l-2cr-fluid>*[class^=g-d].c-2,.l-2cr body:not(.rtl) .l-2cr-fluid>*[class^=g-d].c-2{padding-right:0}body.rtl .g-d-c-fluid,body.rtl .l-2c-fluid:not(.grp-cell),body.rtl .l-2cr-fluid{margin-left:0 !important;padding-left:0 !important}body.rtl .g-d-c-fluid>*[class^=g-d],body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d],body.rtl .l-2cr-fluid>*[class^=g-d]{margin-left:0 !important;padding-left:20px}body.rtl .g-d-c-fluid>*[class^=g-d].g-d-l,body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-d-l,body.rtl .l-2cr-fluid>*[class^=g-d].g-d-l,body.rtl .g-d-c-fluid>*[class^=g-d].g-all-l,body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-l,body.rtl .l-2cr-fluid>*[class^=g-d].g-all-l,body.rtl .g-d-c-fluid>*[class^=g-d].g-all-fl,body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].g-all-fl,body.rtl .l-2cr-fluid>*[class^=g-d].g-all-fl,body.rtl .l-2c .g-d-c-fluid>*[class^=g-d].c-2,.l-2c body.rtl .g-d-c-fluid>*[class^=g-d].c-2,body.rtl .l-2c .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2c body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body.rtl .l-2c .l-2cr-fluid>*[class^=g-d].c-2,.l-2c body.rtl .l-2cr-fluid>*[class^=g-d].c-2,body.rtl .l-2cr .g-d-c-fluid>*[class^=g-d].c-2,.l-2cr body.rtl .g-d-c-fluid>*[class^=g-d].c-2,body.rtl .l-2cr .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,.l-2cr body.rtl .l-2c-fluid:not(.grp-cell)>*[class^=g-d].c-2,body.rtl .l-2cr .l-2cr-fluid>*[class^=g-d].c-2,.l-2cr body.rtl .l-2cr-fluid>*[class^=g-d].c-2{padding-left:0}.g-base-c{*zoom:1}.g-base-c:after{content:"";display:table;clear:both}.g-base-c.g-centered{float:none;margin:0 auto}.l-2c-fluid:not(.grp-cell) .c-1{margin-right:0;padding-right:20px;vertical-align:top}.l-2c-fluid:not(.grp-cell) .c-2{float:none;display:table-cell;width:100%;vertical-align:top}.grp-row>.l-2c-fluid:not(.grp-cell) .c-2{padding-right:0}.l-2cr-fluid .c-1{float:right !important;display:table-cell;margin-right:0 !important;padding-right:0 !important;margin-left:0 !important;padding-left:20px !important;vertical-align:top}.l-2cr-fluid .c-2{float:right !important;display:table-cell;margin-right:0 !important;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;vertical-align:top}.grp-module .l-2c-fluid .c-2{padding-right:10px}.grp-module .l-2c-fluid.grp-cell .c-1{display:table-cell;vertical-align:top}.grp-module .l-2c-fluid.grp-cell .c-2{display:table-cell;float:none;padding-right:0;width:auto !important;vertical-align:top}.grp-module .l-2c-fluid.grp-cell .c-2 *{white-space:normal} diff --git a/static/grappelli/stylesheets/mueller/screen.css b/static/grappelli/stylesheets/mueller/screen.css new file mode 100644 index 00000000..e69de29b diff --git a/static/grappelli/stylesheets/partials/custom/tinymce.css b/static/grappelli/stylesheets/partials/custom/tinymce.css new file mode 100644 index 00000000..2926e25e --- /dev/null +++ b/static/grappelli/stylesheets/partials/custom/tinymce.css @@ -0,0 +1 @@ +.tabs{position:relative;float:left;clear:both;width:100%;font-size:11px;line-height:normal;background:transparent}.tabs ul{margin:0;padding:0;list-style:none}.tabs ul li{float:left;margin:0 4px 0 0;padding:2px 0 2px 12px;line-height:18px;border:1px solid #d4d4d4;border-bottom:none;-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;border-top-left-radius:5px;-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;border-top-right-radius:5px;outline:0;background:#e0f0f5}.tabs ul li span{float:left;display:block;padding:0 10px 0 0;outline:0}.tabs ul li a{font-weight:bold;color:#666}.tabs ul li a:hover{color:#444}.tabs ul li.current{border-color:#c4c4c4;background:#ddd}.tabs ul li.current a{color:#444}.panel_wrapper{position:relative;float:none;clear:both}.panel_wrapper div.panel{display:none;position:relative;float:none;clear:both;padding-top:0}.panel_wrapper div.current{display:block;width:100%;height:auto !important;overflow:visible;padding-top:0}.tabs+.panel_wrapper{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0}.panel_wrapper>div>.grp-module:first-child{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0}h1,h2,h3,h4{color:#666;margin:0;padding:0;padding-top:5px}h3{font-size:14px}.title{margin-bottom:5px;font-size:12px;font-weight:bold;color:#666}p.helptext{margin:-5px 0 5px}#link .panel_wrapper,#link div.current{height:125px}#image .panel_wrapper,#image div.current{height:200px}#plugintable thead{font-weight:bold;background:#DDD}#plugintable,#about #plugintable td{border:1px solid #919B9C}#plugintable{width:96%;margin-top:10px}#pluginscontainer{height:290px;overflow:auto}#colorpicker #preview{float:right;width:50px;height:14px;line-height:1px;border:1px solid black;margin-left:5px}#colorpicker #colors{float:left;border:1px solid gray;cursor:crosshair}#colorpicker #light{border:1px solid gray;margin-left:5px;float:left;width:15px;height:150px;cursor:crosshair}#colorpicker #light div{overflow:hidden}#colorpicker #previewblock{float:right;padding-left:10px;height:20px}#colorpicker .panel_wrapper div.current{height:175px}#colorpicker #namedcolors{width:150px}#colorpicker #namedcolors a{display:block;float:left;width:10px;height:10px;margin:1px 1px 0 0;overflow:hidden}#colorpicker #colornamecontainer{margin-top:5px}#link .panel_wrapper,#link div.current{height:125px}#image .panel_wrapper,#image div.current{height:190px}legend{margin:20px 0 0;font-size:15px;font-weight:bold;color:#2B6FB6;display:none}legend+.grp-row{border-top:none !important}.required{font-weight:bold}label.msg{display:none}label.invalid{color:#EE0000;display:inline}input.invalid{border:1px solid #EE0000}label.additional{position:relative;display:inline;float:none;top:1px}.description label{margin:0 0 12px !important;padding:0 !important}#constrainlabel{display:inline;float:none;position:relative;top:1px !important}input[type=text],input[type=password],select{width:100% !important}input#src,input#href{width:100% !important;padding-right:28px}input.size,input.number{margin-right:1px;width:50px !important}input#width,input#height{text-align:center;vertical-align:middle;width:50px}input.radio{position:relative;margin:0 5px 13px 0}input.checkbox{position:relative;margin:0 5px 13px 0 !important}.c-2{vertical-align:baseline !important}.c-2>input[type=radio]:first-child,.c-2>input[type=checkbox]:first-child{top:5px !important}.c-2>input[type=radio]:first-child+label,.c-2>input[type=checkbox]:first-child+label{top:4px}.c-2>input[type=radio]:first-child+label+input[type=radio],.c-2>input[type=radio]:first-child+label+input[type=checkbox],.c-2>input[type=checkbox]:first-child+label+input[type=radio],.c-2>input[type=checkbox]:first-child+label+input[type=checkbox]{top:5px;margin-left:30px}.c-2>input[type=radio]:first-child+label+input[type=radio]+label,.c-2>input[type=radio]:first-child+label+input[type=checkbox]+label,.c-2>input[type=checkbox]:first-child+label+input[type=radio]+label,.c-2>input[type=checkbox]:first-child+label+input[type=checkbox]+label{top:4px}input.radio.additional,input.checkbox.additional{margin-left:10px !important}input#constrain{position:relative;margin:0 5px 0 0 !important}input+input#constrain{margin-left:32px !important}p.constrain{padding:5px 0 0 !important}.input_noborder{border:0}#textareaContainer,#iframecontainer{margin-bottom:5px;width:100% !important;border:1px solid #d4d4d4;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#textareaContainer{border:0}#iframecontainer{padding:2px 0}textarea#htmlSource{width:100% !important;height:100%;color:#444;font-family:'Courier New',Courier,monospace;font-size:12px;font-weight:normal}#iframecontainer iframe{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}input[name="href"]+div{position:absolute;top:0;right:0;display:inline-block}input[name="href"]+div a span{display:none}input[name="src"]+div{position:absolute;top:0;right:0;display:inline-block}input[name="src"]+div a span{display:none}.wordWrapCode{vertical-align:middle;border:1px none #000;background:transparent}.mceActionPanel{margin-top:5px}#charmap table{border:0}#charmap table td{padding:0 !important}#charmap table td.title,#charmap table td#charmapView{border:0 !important}#charmap table td.title>table,#charmap table td#charmapView>table{border-collapse:collapse}#charmap table tbody td{border-bottom:0}#charmap table td#charmapView{border:0 !important}#charmap table a{top:0 !important;display:block;padding:0;width:100%;height:100%;color:#444;font-size:12px;line-height:18px;text-decoration:none;border:none}#charmap table a:hover{color:#444;background:#e0f0f5;outline:1px solid #444 !important}#charmap table td#charmapView>table tr:first-child td.charmap:first-child a{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px}#charmap table td#charmapView>table tr:first-child td.charmap:last-child a{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}#charmap table td#charmapView>table tr:last-child td.charmap:first-child a{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px}#charmap table td#charmapView>table tr:last-child td.charmap:last-child a{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}#charmap table>table tr:last-child table td{border:0 !important}#charmapgroup{margin-right:10px}#charmapgroup table{border:1px solid #d4d4d4 !important;border-collapse:collapse;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;background:#fff}#charmapgroup table tr{height:18px !important}#charmapgroup table tr td.charmap{padding:0 !important;width:18px;height:18px;text-align:center;vertical-align:middle;border-left:1px solid #d4d4d4;border-bottom:1px solid #d4d4d4;cursor:pointer !important;outline:0 !important}#charmapgroup table tr td.charmap a:focus{color:#444;background:#eee;outline:1px solid #999}#charmapgroup table tr td.charmap a:focus:hover{background:#e0f0f5;outline:1px solid #444 !important}#charmapgroup table tr:first-child td.charmap{border-top:none}#charmapgroup table tr td.charmap:first-child{border-left:none}#charmapgroup table tr:last-child td.charmap{border-bottom:none}.selected-character{position:relative;float:left;margin-left:20px;width:80px}#codeV{height:80px;margin-bottom:5px;text-align:center;font-size:40px;line-height:80px !important;border:1px solid #d4d4d4 !important;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;background:#e0f0f5;color:#444}#codeN{font-size:10px;line-height:11px;font-family:Arial,Helvetica,sans-serif;text-align:center;color:#444}.legend{position:absolute;float:left;bottom:18px;margin-left:20px;padding:5px;width:70px;border:1px solid #d4d4d4;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}.legend span{color:#aaa;font-size:10px}#codeA,#codeB{color:#444}#codeA{margin-bottom:5px} diff --git a/static/grappelli/stylesheets/rtl.css b/static/grappelli/stylesheets/rtl.css new file mode 100644 index 00000000..d29429a8 --- /dev/null +++ b/static/grappelli/stylesheets/rtl.css @@ -0,0 +1 @@ +.grp-font-family{font-family:Arial,sans-serif}.grp-font-color{color:#444}.grp-font-color-quiet{color:#888}.grp-font-color-error{color:#bf3030}.grp-border-radius{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.grp-border-radius-s{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.grp-form-field-border-radius{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.grp-form-button-border-radius{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}.grp-margin-xl{margin:30px !important}.grp-margin-l{margin:20px !important}.grp-margin-m{margin:15px !important}.grp-margin{margin:10px !important}.grp-margin-s{margin:5px !important}.grp-margin-xs{margin:2px !important}.grp-margin-top-xl{margin-top:30px !important}.grp-margin-top-l{margin-top:20px !important}.grp-margin-top-m{margin-top:15px !important}.grp-margin-top{margin-top:10px !important}.grp-margin-top-s{margin-top:5px !important}.grp-margin-top-xs{margin-top:2px !important}.grp-margin-bottom-xl{margin-bottom:30px !important}.grp-margin-bottom-l{margin-bottom:20px !important}.grp-margin-bottom-m{margin-bottom:15px !important}.grp-margin-bottom{margin-bottom:10px !important}.grp-margin-bottom-s{margin-bottom:5px !important}.grp-margin-bottom-xs{margin-bottom:2px !important}.grp-margin-left-xl{margin-left:30px !important}.grp-margin-left-l{margin-left:20px !important}.grp-margin-left-m{margin-left:15px !important}.grp-margin-left{margin-left:10px !important}.grp-margin-left-s{margin-left:5px !important}.grp-margin-left-xs{margin-left:2px !important}.grp-margin-right-xl{margin-right:30px !important}.grp-margin-right-l{margin-right:20px !important}.grp-margin-right-m{margin-right:15px !important}.grp-margin-right{margin-right:10px !important}.grp-margin-right-s{margin-right:5px !important}.grp-margin-right-xs{margin-right:2px !important}.grp-margin-vertical-xl{margin-top:30px !important;margin-bottom:30px !important}.grp-margin-vertical-l{margin-top:20px !important;margin-bottom:20px !important}.grp-margin-vertical-m{margin-top:15px !important;margin-bottom:15px !important}.grp-margin-vertical{margin-top:10px !important;margin-bottom:10px !important}.grp-margin-vertical-s{margin-top:5px !important;margin-bottom:5px !important}.grp-margin-vertical-xs{margin-top:2px !important;margin-bottom:2px !important}.grp-margin-horizontal-xl{margin-left:30px !important;margin-right:30px !important}.grp-margin-horizontal-l{margin-left:20px !important;margin-right:20px !important}.grp-margin-horizontal-m{margin-left:15px !important;margin-right:15px !important}.grp-margin-horizontal{margin-left:10px !important;margin-right:10px !important}.grp-margin-horizontal-s{margin-left:5px !important;margin-right:5px !important}.grp-margin-horizontal-xs{margin-left:2px !important;margin-right:2px !important}.grp-no-margin{margin:0 !important}.grp-no-margin-top{margin-top:0 !important}.grp-no-margin-right{margin-right:0 !important}.grp-no-margin-bottom{margin-bottom:0 !important}.grp-no-margin-left{margin-left:0 !important}.grp-padding-xl{padding:30px !important}.grp-padding-l{padding:20px !important}.grp-padding-m{padding:15px !important}.grp-padding{padding:10px !important}.grp-padding-s{padding:5px !important}.grp-padding-xs{padding:2px !important}.grp-padding-top-xl{padding-top:30px !important}.grp-padding-top-l{padding-top:20px !important}.grp-padding-top-m{padding-top:15px !important}.grp-padding-top{padding-top:10px !important}.grp-padding-top-s{padding-top:5px !important}.grp-padding-top-xs{padding-top:2px !important}.grp-padding-bottom-xl{padding-bottom:30px !important}.grp-padding-bottom-l{padding-bottom:20px !important}.grp-padding-bottom-m{padding-bottom:15px !important}.grp-padding-bottom{padding-bottom:10px !important}.grp-padding-bottom-s{padding-bottom:5px !important}.grp-padding-bottom-xs{padding-bottom:2px !important}.grp-padding-left-xl{padding-left:30px !important}.grp-padding-left-l{padding-left:20px !important}.grp-padding-left-m{padding-left:15px !important}.grp-padding-left{padding-left:10px !important}.grp-padding-left-s{padding-left:5px !important}.grp-padding-left-xs{padding-left:2px !important}.grp-padding-right-xl{padding-right:30px !important}.grp-padding-right-l{padding-right:20px !important}.grp-padding-right-m{padding-right:15px !important}.grp-padding-right{padding-right:10px !important}.grp-padding-right-s{padding-right:5px !important}.grp-padding-right-xs{padding-right:2px !important}.grp-padding-vertical-xl{padding-top:30px !important;padding-bottom:30px !important}.grp-padding-vertical-l{padding-top:20px !important;padding-bottom:20px !important}.grp-padding-vertical-m{padding-top:15px !important;padding-bottom:15px !important}.grp-padding-vertical{padding-top:10px !important;padding-bottom:10px !important}.grp-padding-vertical-s{padding-top:5px !important;padding-bottom:5px !important}.grp-padding-vertical-xs{padding-top:2px !important;padding-bottom:2px !important}.grp-padding-horizontal-xl{padding-left:30px !important;padding-right:30px !important}.grp-padding-horizontal-l{padding-left:20px !important;padding-right:20px !important}.grp-padding-horizontal-m{padding-left:15px !important;padding-right:15px !important}.grp-padding-horizontal{padding-left:10px !important;padding-right:10px !important}.grp-padding-horizontal-s{padding-left:5px !important;padding-right:5px !important}.grp-padding-horizontal-xs{padding-left:2px !important;padding-right:2px !important}.grp-no-padding{padding:0 !important}.grp-no-padding-top{padding-top:0 !important}.grp-no-padding-right{padding-right:0 !important}.grp-no-padding-bottom{padding-bottom:0 !important}.grp-no-padding-left{padding-left:0 !important}.icons-sprite,.icons-add-another,.icons-back-link,.icons-breadcrumbs-rtl,.icons-breadcrumbs,.icons-date-hierarchy-back-rtl,.icons-date-hierarchy-back,.icons-datepicker,.icons-datetime-now,.icons-form-select,.icons-object-tools-add-link,.icons-object-tools-viewsite-link,.icons-pulldown-handler,.icons-pulldown-handler_selected,.icons-related-lookup-m2m,.icons-related-lookup,.icons-related-remove,.icons-searchbox,.icons-selector-add-m2m-horizontal,.icons-selector-add-m2m-vertical,.icons-selector-filter,.icons-selector-remove-m2m-horizontal,.icons-selector-remove-m2m-vertical,.icons-sort-remove,.icons-sorted-ascending,.icons-sorted-descending,.icons-status-no,.icons-status-unknown,.icons-status-yes,.icons-th-ascending,.icons-th-descending,.icons-timepicker,.icons-tools-add-handler,.icons-tools-arrow-down-handler,.icons-tools-arrow-up-handler,.icons-tools-close-handler,.icons-tools-delete-handler-predelete,.icons-tools-delete-handler,.icons-tools-drag-handler,.icons-tools-open-handler,.icons-tools-remove-handler,.icons-tools-trash-handler,.icons-tools-trash-list-toggle-handler,.icons-tools-viewsite-link,.icons-ui-datepicker-next,.icons-ui-datepicker-prev,body.rtl #grp-breadcrumbs>ul a,body.rtl .grp-date-hierarchy ul li a.grp-date-hierarchy-back,body.rtl .grp-pulldown-container .grp-pulldown-handler,body.rtl .grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler{background:url('../images/icons-s0e29227ce9.png') no-repeat}.icons-add-another{background-position:0 -1377px}.icons-add-another:hover,.icons-add-another.add-another_hover,.icons-add-another.add-another-hover{background-position:0 -1421px}.icons-back-link{background-position:0 -1119px}.icons-back-link:hover,.icons-back-link.back-link_hover,.icons-back-link.back-link-hover{background-position:0 -1162px}.icons-breadcrumbs-rtl{background-position:0 -727px}.icons-breadcrumbs-rtl:hover,.icons-breadcrumbs-rtl.breadcrumbs-rtl_hover,.icons-breadcrumbs-rtl.breadcrumbs-rtl-hover{background-position:0 -683px}.icons-breadcrumbs{background-position:0 -771px}.icons-breadcrumbs:hover,.icons-breadcrumbs.breadcrumbs_hover,.icons-breadcrumbs.breadcrumbs-hover{background-position:0 -815px}.icons-date-hierarchy-back-rtl{background-position:0 -859px}.icons-date-hierarchy-back-rtl:hover,.icons-date-hierarchy-back-rtl.date-hierarchy-back-rtl_hover,.icons-date-hierarchy-back-rtl.date-hierarchy-back-rtl-hover{background-position:0 -902px}.icons-date-hierarchy-back{background-position:0 -1033px}.icons-date-hierarchy-back:hover,.icons-date-hierarchy-back.date-hierarchy-back_hover,.icons-date-hierarchy-back.date-hierarchy-back-hover{background-position:0 -1076px}.icons-datepicker{background-position:0 -2172px}.icons-datepicker:hover,.icons-datepicker.datepicker_hover,.icons-datepicker.datepicker-hover{background-position:0 -2085px}.icons-datetime-now{background-position:0 -339px}.icons-datetime-now:hover,.icons-datetime-now.datetime-now_hover,.icons-datetime-now.datetime-now-hover{background-position:0 -468px}.icons-form-select{background-position:0 -1828px}.icons-object-tools-add-link{background-position:0 -989px}.icons-object-tools-viewsite-link{background-position:0 -945px}.icons-pulldown-handler{background-position:0 -2651px}.icons-pulldown-handler:hover,.icons-pulldown-handler.pulldown-handler_hover,.icons-pulldown-handler.pulldown-handler-hover{background-position:0 -2475px}.icons-pulldown-handler_selected{background-position:0 -2519px}.icons-related-lookup-m2m{background-position:0 -1664px}.icons-related-lookup-m2m:hover,.icons-related-lookup-m2m.related-lookup-m2m_hover,.icons-related-lookup-m2m.related-lookup-m2m-hover{background-position:0 -1750px}.icons-related-lookup{background-position:0 -1707px}.icons-related-lookup:hover,.icons-related-lookup.related-lookup_hover,.icons-related-lookup.related-lookup-hover{background-position:0 -1621px}.icons-related-remove{background-position:0 -597px}.icons-related-remove:hover,.icons-related-remove.related-remove_hover,.icons-related-remove.related-remove-hover{background-position:0 -640px}.icons-searchbox{background-position:0 0}.icons-selector-add-m2m-horizontal{background-position:0 -263px}.icons-selector-add-m2m-horizontal:hover,.icons-selector-add-m2m-horizontal.selector-add-m2m-horizontal_hover,.icons-selector-add-m2m-horizontal.selector-add-m2m-horizontal-hover{background-position:0 -231px}.icons-selector-add-m2m-vertical{background-position:0 -35px}.icons-selector-add-m2m-vertical:hover,.icons-selector-add-m2m-vertical.selector-add-m2m-vertical_hover,.icons-selector-add-m2m-vertical.selector-add-m2m-vertical-hover{background-position:0 -68px}.icons-selector-filter{background-position:0 -2347px}.icons-selector-remove-m2m-horizontal{background-position:0 -199px}.icons-selector-remove-m2m-horizontal:hover,.icons-selector-remove-m2m-horizontal.selector-remove-m2m-horizontal_hover,.icons-selector-remove-m2m-horizontal.selector-remove-m2m-horizontal-hover{background-position:0 -167px}.icons-selector-remove-m2m-vertical{background-position:0 -101px}.icons-selector-remove-m2m-vertical:hover,.icons-selector-remove-m2m-vertical.selector-remove-m2m-vertical_hover,.icons-selector-remove-m2m-vertical.selector-remove-m2m-vertical-hover{background-position:0 -134px}.icons-sort-remove{background-position:0 -511px}.icons-sort-remove:hover,.icons-sort-remove.sort-remove_hover,.icons-sort-remove.sort-remove-hover{background-position:0 -554px}.icons-sorted-ascending{background-position:0 -382px}.icons-sorted-descending{background-position:0 -425px}.icons-status-no{background-position:0 -1793px}.icons-status-unknown{background-position:0 -1551px}.icons-status-yes{background-position:0 -1586px}.icons-th-ascending{background-position:0 -2379px}.icons-th-descending{background-position:0 -2405px}.icons-timepicker{background-position:0 -1465px}.icons-timepicker:hover,.icons-timepicker.timepicker_hover,.icons-timepicker.timepicker-hover{background-position:0 -1508px}.icons-tools-add-handler{background-position:0 -2607px}.icons-tools-add-handler:hover,.icons-tools-add-handler.tools-add-handler_hover,.icons-tools-add-handler.tools-add-handler-hover{background-position:0 -3003px}.icons-tools-arrow-down-handler{background-position:0 -2563px}.icons-tools-arrow-down-handler:hover,.icons-tools-arrow-down-handler.tools-arrow-down-handler_hover,.icons-tools-arrow-down-handler.tools-arrow-down-handler-hover{background-position:0 -2695px}.icons-tools-arrow-up-handler{background-position:0 -2827px}.icons-tools-arrow-up-handler:hover,.icons-tools-arrow-up-handler.tools-arrow-up-handler_hover,.icons-tools-arrow-up-handler.tools-arrow-up-handler-hover{background-position:0 -2871px}.icons-tools-close-handler{background-position:0 -2215px}.icons-tools-close-handler:hover,.icons-tools-close-handler.tools-close-handler_hover,.icons-tools-close-handler.tools-close-handler-hover{background-position:0 -1997px}.icons-tools-delete-handler-predelete{background-position:0 -295px}.icons-tools-delete-handler{background-position:0 -2915px}.icons-tools-delete-handler:hover,.icons-tools-delete-handler.tools-delete-handler_hover,.icons-tools-delete-handler.tools-delete-handler-hover{background-position:0 -2431px}.icons-tools-drag-handler{background-position:0 -2259px}.icons-tools-drag-handler:hover,.icons-tools-drag-handler.tools-drag-handler_hover,.icons-tools-drag-handler.tools-drag-handler-hover{background-position:0 -2739px}.icons-tools-open-handler{background-position:0 -1909px}.icons-tools-open-handler:hover,.icons-tools-open-handler.tools-open-handler_hover,.icons-tools-open-handler.tools-open-handler-hover{background-position:0 -1953px}.icons-tools-remove-handler{background-position:0 -3047px}.icons-tools-remove-handler:hover,.icons-tools-remove-handler.tools-remove-handler_hover,.icons-tools-remove-handler.tools-remove-handler-hover{background-position:0 -3091px}.icons-tools-trash-handler{background-position:0 -2041px}.icons-tools-trash-handler:hover,.icons-tools-trash-handler.tools-trash-handler_hover,.icons-tools-trash-handler.tools-trash-handler-hover{background-position:0 -1865px}.icons-tools-trash-list-toggle-handler{background-position:0 -2128px}.icons-tools-trash-list-toggle-handler:hover,.icons-tools-trash-list-toggle-handler.tools-trash-list-toggle-handler_hover,.icons-tools-trash-list-toggle-handler.tools-trash-list-toggle-handler-hover{background-position:0 -2783px}.icons-tools-viewsite-link{background-position:0 -2303px}.icons-tools-viewsite-link:hover,.icons-tools-viewsite-link.tools-viewsite-link_hover,.icons-tools-viewsite-link.tools-viewsite-link-hover{background-position:0 -2959px}.icons-ui-datepicker-next{background-position:0 -1291px}.icons-ui-datepicker-next:hover,.icons-ui-datepicker-next.ui-datepicker-next_hover,.icons-ui-datepicker-next.ui-datepicker-next-hover{background-position:0 -1334px}.icons-ui-datepicker-prev{background-position:0 -1205px}.icons-ui-datepicker-prev:hover,.icons-ui-datepicker-prev.ui-datepicker-prev_hover,.icons-ui-datepicker-prev.ui-datepicker-prev-hover{background-position:0 -1248px}.icons-small-sprite,.icons-small-add-link,.icons-small-change-link,.icons-small-delete-link,.icons-small-filter-choice-selected,.icons-small-link-external,.icons-small-link-internal,.icons-small-sort-remove,body.rtl .grp-actions li.grp-add-link a,body.rtl .grp-actions li.grp-change-link a,body.rtl .grp-actions li.grp-delete-link a,body.rtl .grp-actions li.grp-delete-link>span:first-child,body.rtl .grp-listing li.grp-add-link a,body.rtl .grp-listing-small li.grp-add-link a,body.rtl .grp-listing li.grp-change-link a,body.rtl .grp-listing-small li.grp-change-link a,body.rtl .grp-listing li.grp-delete-link a,body.rtl .grp-listing li.grp-delete-link>span:first-child,body.rtl .grp-listing-small li.grp-delete-link a,body.rtl .grp-listing-small li.grp-delete-link>span:first-child,body.rtl .grp-filter .grp-row.grp-selected a{background:url('../images/icons-small-s7d28d7943b.png') no-repeat}.icons-small-add-link{background-position:0 -2085px}.icons-small-add-link:hover,.icons-small-add-link.add-link_hover,.icons-small-add-link.add-link-hover{background-position:0 -2502px}.icons-small-change-link{background-position:0 -3753px}.icons-small-change-link:hover,.icons-small-change-link.change-link_hover,.icons-small-change-link.change-link-hover{background-position:0 -4170px}.icons-small-delete-link{background-position:0 -2919px}.icons-small-filter-choice-selected{background-position:0 0}.icons-small-link-external{background-position:0 -417px}.icons-small-link-external:hover,.icons-small-link-external.link-external_hover,.icons-small-link-external.link-external-hover{background-position:0 -834px}.icons-small-link-internal{background-position:0 -1668px}.icons-small-link-internal:hover,.icons-small-link-internal.link-internal_hover,.icons-small-link-internal.link-internal-hover{background-position:0 -1251px}.icons-small-sort-remove{background-position:0 -3336px}body.rtl header#grp-header #grp-navigation h1#grp-admin-title{float:right}body.rtl header#grp-header #grp-navigation ul#grp-user-tools{float:left;margin:0 0 0 -10px;border-right:1px solid #343434;border-left:0 !important}body.rtl header#grp-header #grp-navigation ul#grp-user-tools li:last-child{border-right:1px solid #090909;border-left:0}body.rtl header#grp-header #grp-navigation ul#grp-user-tools li.grp-user-options-container:last-child{margin-right:0;margin-left:11px}body.rtl header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul{position:absolute;z-index:1010;display:block;margin:-1px -1px 0 0;width:202px}body.rtl header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul li{border-right:0 !important}body.rtl #grp-page-tools{float:left;right:0;margin-left:-10px}body.rtl #grp-page-tools li{float:right}body.rtl #grp-page-tools li:first-child{padding-right:5px;padding-left:0}body.rtl #grp-page-tools li:last-child{padding-left:5px;padding-right:0}body.rtl #grp-breadcrumbs{float:right}body.rtl #grp-breadcrumbs>ul{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;padding:5px 20px}body.rtl #grp-breadcrumbs>ul li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:right;padding-left:5px;padding-right:5px}body.rtl #grp-breadcrumbs>ul li:first-child,body.rtl #grp-breadcrumbs>ul li.first{padding-right:0}body.rtl #grp-breadcrumbs>ul li:last-child{padding-left:0}body.rtl #grp-breadcrumbs>ul li.last{padding-left:0}body.rtl #grp-breadcrumbs>ul a{padding-right:0;padding-left:15px;background-position:0 -727px}body.rtl #grp-breadcrumbs>ul a:hover,body.rtl #grp-breadcrumbs>ul a.breadcrumbs-rtl_hover,body.rtl #grp-breadcrumbs>ul a.breadcrumbs-rtl-hover{background-position:0 -683px}body.rtl .grp-submit-row>ul>li{float:left;margin-left:0;margin-right:10px}body.rtl .grp-submit-row>ul>li.grp-float-left{float:right !important;margin-left:10px;margin-right:0}body.rtl ul.grp-object-tools{float:left}body.rtl ul.grp-object-tools li{float:right;padding-right:5px;padding-left:5px}body.rtl ul.grp-object-tools li:first-child{padding-right:0}body.rtl ul.grp-object-tools li:last-child{padding-left:0}body.rtl ul.grp-object-tools li a.grp-add-link{padding-right:28px;padding-left:15px;background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-webkit-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-moz-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-o-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,linear-gradient(#999999,#888888)}body.rtl ul.grp-object-tools li a.grp-add-link:hover{background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-webkit-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-moz-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,-o-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 95% -989px no-repeat,linear-gradient(#36b0d9,#309bbf)}body.rtl ul.grp-object-tools li a.grp-viewsite-link,body.rtl ul.grp-object-tools li a[target="_blank"]{padding-right:28px;padding-left:15px;background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-webkit-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-moz-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-o-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,linear-gradient(#999999,#888888)}body.rtl ul.grp-object-tools li a.grp-viewsite-link:hover,body.rtl ul.grp-object-tools li a[target="_blank"]:hover{background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-webkit-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-moz-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,-o-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 95% -945px no-repeat,linear-gradient(#36b0d9,#309bbf)}body.rtl .grp-tools{float:left;padding-left:5px}body.rtl .grp-tools li{float:right;padding-right:1px;padding-left:1px}body.rtl .grp-tools li:first-child{padding-right:0}body.rtl .grp-tools li:last-child{padding-left:0}body.rtl .grp-tools-container .grp-tools{right:0}body.rtl .grp-module .grp-row>.grp-tools{right:0;margin-left:-9px}body.rtl .grp-group>h2+.grp-tools{right:0;margin-left:1px}body.rtl input[type="button"],body.rtl button,body.rtl a.fb_show,body.rtl a.related-lookup,body.rtl body.tinyMCE input[name="src"]+div a,body.rtl body.tinyMCE input[name="href"]+div a{margin-left:0;margin-right:-25px;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}body.rtl p.datetime{white-space:nowrap;position:relative;display:inline-block}body.rtl p.datetime input.vTimeField{margin-left:0;margin-right:6px}body.rtl div.grp-readonly+div.grp-readonly{margin-left:0;margin-right:20px}body.rtl a.related-lookup+strong{margin-left:0;margin-right:5px}body.rtl .grp-placeholder-related-fk,body.rtl .grp-placeholder-related-m2m,body.rtl .grp-placeholder-related-generic{margin-left:0;margin-right:123px}body.rtl .grp-placeholder-related-fk .grp-separator:after,body.rtl .grp-placeholder-related-m2m .grp-separator:after,body.rtl .grp-placeholder-related-generic .grp-separator:after{content:" ,"}body.rtl a.add-another{margin-left:0;margin-right:7px}body.rtl .grp-td a.add-another{float:left;margin-left:-10px;margin-right:7px}body.rtl .radiolist.inline+a.add-another,body.rtl .checkboxlist.inline+a.add-another{float:none;margin-left:-10px;margin-right:0}body.rtl .grp-actions{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;float:left}body.rtl .grp-actions li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:right;padding-left:5px;padding-right:5px}body.rtl .grp-actions li:first-child,body.rtl .grp-actions li.first{padding-right:0}body.rtl .grp-actions li:last-child{padding-left:0}body.rtl .grp-actions li.last{padding-left:0}body.rtl .grp-actions li.grp-add-link a,body.rtl .grp-actions li.grp-add-link>span:first-child,body.rtl .grp-actions li.grp-change-link a,body.rtl .grp-actions li.grp-change-link>span:first-child,body.rtl .grp-actions li.grp-delete-link a,body.rtl .grp-actions li.grp-delete-link>span:first-child{padding-right:20px;padding-left:0}body.rtl .grp-actions li.grp-add-link a{background-position:100% -2085px}body.rtl .grp-actions li.grp-add-link a:hover,body.rtl .grp-actions li.grp-add-link a.add-link_hover,body.rtl .grp-actions li.grp-add-link a.add-link-hover{background-position:100% -2502px}body.rtl .grp-actions li.grp-change-link a{background-position:100% -3753px}body.rtl .grp-actions li.grp-change-link a:hover,body.rtl .grp-actions li.grp-change-link a.change-link_hover,body.rtl .grp-actions li.grp-change-link a.change-link-hover{background-position:100% -4170px}body.rtl .grp-actions li.grp-delete-link a,body.rtl .grp-actions li.grp-delete-link>span:first-child{background-position:100% -2919px}body.rtl .grp-listing li.grp-add-link,body.rtl .grp-listing li.grp-change-link,body.rtl .grp-listing li.grp-delete-link,body.rtl .grp-listing-small li.grp-add-link,body.rtl .grp-listing-small li.grp-change-link,body.rtl .grp-listing-small li.grp-delete-link{padding-right:25px;padding-left:0}body.rtl .grp-listing li.grp-add-link a,body.rtl .grp-listing li.grp-add-link>span:first-child,body.rtl .grp-listing li.grp-change-link a,body.rtl .grp-listing li.grp-change-link>span:first-child,body.rtl .grp-listing li.grp-delete-link a,body.rtl .grp-listing li.grp-delete-link>span:first-child,body.rtl .grp-listing-small li.grp-add-link a,body.rtl .grp-listing-small li.grp-add-link>span:first-child,body.rtl .grp-listing-small li.grp-change-link a,body.rtl .grp-listing-small li.grp-change-link>span:first-child,body.rtl .grp-listing-small li.grp-delete-link a,body.rtl .grp-listing-small li.grp-delete-link>span:first-child{margin-right:-20px;margin-left:0;padding-right:20px;padding-left:0}body.rtl .grp-listing li.grp-add-link a,body.rtl .grp-listing-small li.grp-add-link a{background-position:100% -2085px}body.rtl .grp-listing li.grp-add-link a:hover,body.rtl .grp-listing li.grp-add-link a.add-link_hover,body.rtl .grp-listing li.grp-add-link a.add-link-hover,body.rtl .grp-listing-small li.grp-add-link a:hover,body.rtl .grp-listing-small li.grp-add-link a.add-link_hover,body.rtl .grp-listing-small li.grp-add-link a.add-link-hover{background-position:100% -2502px}body.rtl .grp-listing li.grp-change-link a,body.rtl .grp-listing-small li.grp-change-link a{background-position:100% -3753px}body.rtl .grp-listing li.grp-change-link a:hover,body.rtl .grp-listing li.grp-change-link a.change-link_hover,body.rtl .grp-listing li.grp-change-link a.change-link-hover,body.rtl .grp-listing-small li.grp-change-link a:hover,body.rtl .grp-listing-small li.grp-change-link a.change-link_hover,body.rtl .grp-listing-small li.grp-change-link a.change-link-hover{background-position:100% -4170px}body.rtl .grp-listing li.grp-delete-link a,body.rtl .grp-listing li.grp-delete-link>span:first-child,body.rtl .grp-listing-small li.grp-delete-link a,body.rtl .grp-listing-small li.grp-delete-link>span:first-child{background-position:100% -2919px}body.rtl .grp-module .grp-row:not(tr){float:right}body.rtl .grp-module .grp-row:not(tr).grp-cells .grp-cell{display:table-cell;vertical-align:top;position:relative;padding:8px 0 8px 20px;border-left:1px solid #fff;border-right:0}body.rtl .grp-module .grp-row:not(tr).grp-cells .grp-cell+.grp-cell{padding-left:20px;padding-right:0;border-right:1px solid #ddd;border-left:0}body.rtl .grp-module .grp-row:not(tr).grp-cells .grp-cell:last-of-type{padding-left:0;padding-right:20px;border-left:0 !important;border-right:1px solid #ddd !important}body.rtl .grp-tabular .grp-table .grp-th,body.rtl .grp-tabular .grp-table .grp-td{margin-right:0;border-left:1px solid #fff;border-right:1px solid #e0e0e0}body.rtl .grp-tabular .grp-table .grp-th:first-of-type,body.rtl .grp-tabular .grp-table .grp-td:first-of-type{padding-left:20px;padding-right:10px}body.rtl .grp-tabular .grp-table .grp-th:last-child,body.rtl .grp-tabular .grp-table .grp-td:last-child{padding-left:10px}body.rtl .grp-tabular .grp-table .grp-thead .grp-th,body.rtl .grp-tabular .grp-table .grp-thead .grp-td{background:none;border-top:0}body.rtl .grp-tabular .grp-table .grp-tbody .grp-th,body.rtl .grp-tabular .grp-table .grp-tbody .grp-td{border-bottom:1px solid #d4d4d4;border-top:1px solid #d4d4d4}body.rtl .grp-tabular .grp-table .grp-tbody .grp-th:last-of-type,body.rtl .grp-tabular .grp-table .grp-tbody .grp-td:last-of-type{border-left:1px solid #d4d4d4}body.rtl .grp-tabular .grp-table .grp-tbody .grp-th:last-child,body.rtl .grp-tabular .grp-table .grp-tbody .grp-td:last-child{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}body.rtl .grp-tabular .grp-table .grp-tbody .grp-th:first-of-type,body.rtl .grp-tabular .grp-table .grp-tbody .grp-td:first-of-type{border-left:1px solid #fff;border-right:1px solid #d4d4d4;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}body.rtl .grp-tabular .grp-table .grp-tbody .grp-th.grp-tools-container,body.rtl .grp-tabular .grp-table .grp-tbody .grp-td.grp-tools-container{padding-left:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;border-bottom-left-radius:2px}body.rtl .grp-tabular .grp-table .grp-tfoot .grp-td:last-of-type{border-right:0}body.rtl table thead th{border-right:1px solid #ccc;border-left:0}body.rtl table thead th:first-child{border-right:0}body.rtl table thead th:first-of-type{-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0}body.rtl table thead th:last-of-type{-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0}body.rtl table tbody tr td,body.rtl table tbody tr th{border-right:1px solid #e4e4e4}body.rtl table tbody tr td:first-child,body.rtl table tbody tr th:first-child{border-right:0 !important}body.rtl table tbody tr.grp-row-even td,body.rtl table tbody tr.grp-row-even th,body.rtl table tbody tr.grp-row-odd td,body.rtl table tbody tr.grp-row-odd th{border-left:0;border-right:1px solid #e0e0e0}body.rtl table tbody tr:last-child td:first-child,body.rtl table tbody tr:last-child th:first-child{-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}body.rtl table tbody tr:last-child td:last-child,body.rtl table tbody tr:last-child th:last-child{-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;border-bottom-left-radius:2px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0}body.rtl table tfoot td:first-child{border-right:0}body.rtl table td a.fb_show,body.rtl table td a.related-lookup,body.rtl table th a.fb_show,body.rtl table th a.related-lookup{margin:-5px -25px -11px 0}body.rtl table.grp-sortable thead th.sortable .grp-sortoptions{float:left;clear:left;margin:0 0 0 5px}body.rtl table.grp-sortable thead th.sortable .grp-sortoptions a{float:left}body.rtl table.grp-sortable thead th.sortable .grp-sortoptions span.grp-sortpriority{float:left}body.rtl table.grp-sortable thead th.sortable.sorted .grp-text a{padding-right:10px;padding-left:60px}body.rtl .grp-pagination ul{float:right}body.rtl .grp-pagination ul li{float:right;margin-left:1px;margin-right:0}body.rtl .grp-pagination ul li.grp-results{margin-left:4px;margin-right:0}body.rtl .grp-pagination ul li:last-child{clear:left}body.rtl .grp-date-hierarchy ul{float:right}body.rtl .grp-date-hierarchy ul li{float:right}body.rtl .grp-date-hierarchy ul li a.grp-date-hierarchy-back{padding-right:10px;padding-left:5px;background-position:100% -859px}body.rtl .grp-date-hierarchy ul li a.grp-date-hierarchy-back:hover,body.rtl .grp-date-hierarchy ul li a.grp-date-hierarchy-back.date-hierarchy-back-rtl_hover,body.rtl .grp-date-hierarchy ul li a.grp-date-hierarchy-back.date-hierarchy-back-rtl-hover{background-position:100% -902px}body.rtl input[type="text"].grp-search-field{margin-left:-5px;margin-right:0;padding-left:30px;padding-right:10px}body.rtl .grp-pulldown-container .grp-pulldown-handler{background-position:0 -2651px}body.rtl .grp-pulldown-container .grp-pulldown-handler:hover,body.rtl .grp-pulldown-container .grp-pulldown-handler.pulldown-handler_hover,body.rtl .grp-pulldown-container .grp-pulldown-handler.pulldown-handler-hover{background-position:0 -2475px}body.rtl .grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler{background-position:0 -2519px;background-color:#e1f0f5}body.rtl .grp-filter{*zoom:1}body.rtl .grp-filter .grp-row.grp-selected a{padding-right:17px;padding-left:10px;color:#444;background-position:100% 0}body.rtl .grp-filter:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}body.rtl li.grp-changelist-actions select{float:right;margin:1px 0 0 5px}body.rtl li.grp-changelist-actions li{margin-left:4px;margin-right:0;float:right !important}body.rtl li.grp-changelist-actions li:first-child{padding-right:0}body.rtl li.grp-changelist-actions li:last-child{padding-left:0}body.rtl .grp-row input[type="checkbox"]+label,body.rtl .grp-row input[type="radio"]+label{margin:0 5px 0 0}body.rtl select{padding:4px 2px 4px 3px}@media screen and (-webkit-min-device-pixel-ratio: 0){body.rtl select,body.rtl select:focus{padding:4px 5px 4px 28px;-webkit-appearance:textfield;background-image:url("../images/icons/form-select.png");background-position:0 50%;background-repeat:no-repeat}body.rtl select[multiple=multiple]{background-image:none}}body.rtl ul.radiolist.inline,body.rtl ul.checkboxlist.inline{float:right;padding-left:20px;padding-right:0}body.rtl ul.radiolist.inline li,body.rtl ul.checkboxlist.inline li{float:right;padding-left:20px;padding-right:0}body.rtl .grp-module.grp-tbody ul.radiolist.inline li,body.rtl .grp-module.grp-tbody ul.checkboxlist.inline li{float:right;padding-left:20px;padding-right:0}body.rtl .grp-autocomplete-wrapper-m2m a.grp-related-remove,body.rtl .grp-autocomplete-wrapper-m2m div.grp-loader,body.rtl .grp-autocomplete-wrapper-fk a.grp-related-remove,body.rtl .grp-autocomplete-wrapper-fk div.grp-loader{display:inline-block;position:absolute;left:24px !important;right:auto}body.rtl .grp-autocomplete-wrapper-m2m div.grp-loader,body.rtl .grp-autocomplete-wrapper-fk div.grp-loader{background:#fdfdfd url("../images/backgrounds/loading-small.gif") 50% 50% no-repeat scroll}body.rtl .grp-autocomplete-wrapper-m2m a.related-lookup,body.rtl .grp-autocomplete-wrapper-fk a.related-lookup{left:0;right:auto}body.rtl .grp-autocomplete-wrapper-m2m ul.grp-repr{float:right;padding-left:55px;padding-right:5px}body.rtl .grp-autocomplete-wrapper-m2m ul.grp-repr li{float:right}body.rtl .grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-repr{margin:3px 1px 0 5px}body.rtl .grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-repr a.grp-m2m-remove{padding-right:5px;padding-left:0}body.rtl .grp-autocomplete-wrapper-m2m a.related-lookup{left:-1px !important}body.rtl .grp-autocomplete-wrapper-m2m a.grp-related-remove+a.grp-related-lookup{-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0}body.rtl .grp-autocomplete-wrapper-m2m a.grp-related-remove,body.rtl .grp-autocomplete-wrapper-m2m a.grp-related-remove+div.grp-loader{left:23px !important;right:auto}body.rtl .grp-autocomplete-wrapper-fk input.ui-autocomplete-input{padding-left:55px;padding-right:5px}body.rtl td .grp-autocomplete-wrapper-m2m a.related-lookup,body.rtl td .grp-autocomplete-wrapper-fk a.related-lookup{margin-top:0 !important}body.rtl .selector{float:right}body.rtl .selector .selector-available,body.rtl .selector .selector-chosen{float:right}body.rtl .selector .selector-available h2,body.rtl .selector .selector-chosen h2{padding:7px 7px 6px 5px}body.rtl .selector ul.selector-chooser{float:right}body.rtl .selector .selector-filter{padding:3px 2px 2px 5px;background-position:10px 50%}body.rtl .selector .selector-filter input[type="text"]{float:right;margin-right:3px}body.rtl .selector select[multiple=multiple]{margin:0 -1px 0 0;padding-right:3px;padding-left:0}body.rtl .selector.stacked ul.selector-chooser{margin:4px 356px 0 0}body.rtl .selector.stacked ul.selector-chooser li{float:right}body.rtl caption,body.rtl th,body.rtl td{text-align:right}body.rtl .grp-float-left{float:right !important}body.rtl .grp-float-right{float:left !important}body.rtl.grp-filebrowser table td ul.grp-actions{right:-5px;left:0;margin:0 0 -1px -5px} diff --git a/static/grappelli/stylesheets/screen.css b/static/grappelli/stylesheets/screen.css new file mode 100644 index 00000000..b353dff2 --- /dev/null +++ b/static/grappelli/stylesheets/screen.css @@ -0,0 +1 @@ +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary{display:block}.grp-font-family,.grp-button,input[type="submit"],a.grp-button,button.grp-button,input[type=button].grp-button,.ui-datepicker,#ui-timepicker,.ui-autocomplete,body{font-family:Arial,sans-serif}.grp-font-color,body{color:#444}.grp-font-color-quiet{color:#888}.grp-font-color-error{color:#bf3030}.grp-border-radius{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.grp-border-radius-s{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.grp-form-field-border-radius{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.grp-form-button-border-radius{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}.grp-margin-xl{margin:30px !important}.grp-margin-l{margin:20px !important}.grp-margin-m{margin:15px !important}.grp-margin{margin:10px !important}.grp-margin-s{margin:5px !important}.grp-margin-xs{margin:2px !important}.grp-margin-top-xl{margin-top:30px !important}.grp-margin-top-l{margin-top:20px !important}.grp-margin-top-m{margin-top:15px !important}.grp-margin-top{margin-top:10px !important}.grp-margin-top-s{margin-top:5px !important}.grp-margin-top-xs{margin-top:2px !important}.grp-margin-bottom-xl{margin-bottom:30px !important}.grp-margin-bottom-l{margin-bottom:20px !important}.grp-margin-bottom-m{margin-bottom:15px !important}.grp-margin-bottom{margin-bottom:10px !important}.grp-margin-bottom-s{margin-bottom:5px !important}.grp-margin-bottom-xs{margin-bottom:2px !important}.grp-margin-left-xl{margin-left:30px !important}.grp-margin-left-l{margin-left:20px !important}.grp-margin-left-m{margin-left:15px !important}.grp-margin-left{margin-left:10px !important}.grp-margin-left-s{margin-left:5px !important}.grp-margin-left-xs{margin-left:2px !important}.grp-margin-right-xl{margin-right:30px !important}.grp-margin-right-l{margin-right:20px !important}.grp-margin-right-m{margin-right:15px !important}.grp-margin-right{margin-right:10px !important}.grp-margin-right-s{margin-right:5px !important}.grp-margin-right-xs{margin-right:2px !important}.grp-margin-vertical-xl{margin-top:30px !important;margin-bottom:30px !important}.grp-margin-vertical-l{margin-top:20px !important;margin-bottom:20px !important}.grp-margin-vertical-m{margin-top:15px !important;margin-bottom:15px !important}.grp-margin-vertical{margin-top:10px !important;margin-bottom:10px !important}.grp-margin-vertical-s{margin-top:5px !important;margin-bottom:5px !important}.grp-margin-vertical-xs{margin-top:2px !important;margin-bottom:2px !important}.grp-margin-horizontal-xl{margin-left:30px !important;margin-right:30px !important}.grp-margin-horizontal-l{margin-left:20px !important;margin-right:20px !important}.grp-margin-horizontal-m{margin-left:15px !important;margin-right:15px !important}.grp-margin-horizontal{margin-left:10px !important;margin-right:10px !important}.grp-margin-horizontal-s{margin-left:5px !important;margin-right:5px !important}.grp-margin-horizontal-xs{margin-left:2px !important;margin-right:2px !important}.grp-no-margin{margin:0 !important}.grp-no-margin-top{margin-top:0 !important}.grp-no-margin-right{margin-right:0 !important}.grp-no-margin-bottom{margin-bottom:0 !important}.grp-no-margin-left{margin-left:0 !important}.grp-padding-xl{padding:30px !important}.grp-padding-l{padding:20px !important}.grp-padding-m{padding:15px !important}.grp-padding{padding:10px !important}.grp-padding-s{padding:5px !important}.grp-padding-xs{padding:2px !important}.grp-padding-top-xl{padding-top:30px !important}.grp-padding-top-l{padding-top:20px !important}.grp-padding-top-m{padding-top:15px !important}.grp-padding-top{padding-top:10px !important}.grp-padding-top-s{padding-top:5px !important}.grp-padding-top-xs{padding-top:2px !important}.grp-padding-bottom-xl{padding-bottom:30px !important}.grp-padding-bottom-l{padding-bottom:20px !important}.grp-padding-bottom-m{padding-bottom:15px !important}.grp-padding-bottom{padding-bottom:10px !important}.grp-padding-bottom-s{padding-bottom:5px !important}.grp-padding-bottom-xs{padding-bottom:2px !important}.grp-padding-left-xl{padding-left:30px !important}.grp-padding-left-l{padding-left:20px !important}.grp-padding-left-m{padding-left:15px !important}.grp-padding-left{padding-left:10px !important}.grp-padding-left-s{padding-left:5px !important}.grp-padding-left-xs{padding-left:2px !important}.grp-padding-right-xl{padding-right:30px !important}.grp-padding-right-l{padding-right:20px !important}.grp-padding-right-m{padding-right:15px !important}.grp-padding-right{padding-right:10px !important}.grp-padding-right-s{padding-right:5px !important}.grp-padding-right-xs{padding-right:2px !important}.grp-padding-vertical-xl{padding-top:30px !important;padding-bottom:30px !important}.grp-padding-vertical-l{padding-top:20px !important;padding-bottom:20px !important}.grp-padding-vertical-m{padding-top:15px !important;padding-bottom:15px !important}.grp-padding-vertical{padding-top:10px !important;padding-bottom:10px !important}.grp-padding-vertical-s{padding-top:5px !important;padding-bottom:5px !important}.grp-padding-vertical-xs{padding-top:2px !important;padding-bottom:2px !important}.grp-padding-horizontal-xl{padding-left:30px !important;padding-right:30px !important}.grp-padding-horizontal-l{padding-left:20px !important;padding-right:20px !important}.grp-padding-horizontal-m{padding-left:15px !important;padding-right:15px !important}.grp-padding-horizontal{padding-left:10px !important;padding-right:10px !important}.grp-padding-horizontal-s{padding-left:5px !important;padding-right:5px !important}.grp-padding-horizontal-xs{padding-left:2px !important;padding-right:2px !important}.grp-no-padding{padding:0 !important}.grp-no-padding-top{padding-top:0 !important}.grp-no-padding-right{padding-right:0 !important}.grp-no-padding-bottom{padding-bottom:0 !important}.grp-no-padding-left{padding-left:0 !important}.icons-sprite,.icons-add-another,.icons-back-link,.icons-breadcrumbs-rtl,.icons-breadcrumbs,.icons-date-hierarchy-back-rtl,.icons-date-hierarchy-back,.icons-datepicker,.icons-datetime-now,.icons-form-select,.icons-object-tools-add-link,.icons-object-tools-viewsite-link,.icons-pulldown-handler,.icons-pulldown-handler_selected,.icons-related-lookup-m2m,.icons-related-lookup,.icons-related-remove,.icons-searchbox,.icons-selector-add-m2m-horizontal,.icons-selector-add-m2m-vertical,.icons-selector-filter,.icons-selector-remove-m2m-horizontal,.icons-selector-remove-m2m-vertical,.icons-sort-remove,.icons-sorted-ascending,.icons-sorted-descending,.icons-status-no,.icons-status-unknown,.icons-status-yes,.icons-th-ascending,.icons-th-descending,.icons-timepicker,.icons-tools-add-handler,.icons-tools-arrow-down-handler,.icons-tools-arrow-up-handler,.icons-tools-close-handler,.icons-tools-delete-handler-predelete,.icons-tools-delete-handler,.icons-tools-drag-handler,.icons-tools-open-handler,.icons-tools-remove-handler,.icons-tools-trash-handler,.icons-tools-trash-list-toggle-handler,.icons-tools-viewsite-link,.icons-ui-datepicker-next,.icons-ui-datepicker-prev,a.grp-back-link,a.grp-back-link:hover,a.fb_show,a.related-lookup,body.tinyMCE input[name="src"]+div a,body.tinyMCE input[name="href"]+div a,a.related-lookup.m2m,.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup,a.grp-related-remove,button.ui-datepicker-trigger,button.ui-timepicker-trigger,button.ui-datetime-now,.grp-search-button,a.add-another,img[src*="admin/img/icon-unknown"][src$=".gif"],img[src*="admin/img/icon-no"][src$=".gif"],img[src*="admin/img/icon-yes"][src$=".gif"],.grp-tools li a.grp-add-handler,.grp-tools li a.grp-delete-handler,.grp-predelete .grp-tools li a.grp-delete-handler,.grp-tools li a.grp-remove-handler,.grp-tools li a.grp-drag-handler,.grp-tools li a.grp-viewsite-link,.grp-tools li a.grp-open-handler,.grp-tools li a.grp-close-handler,.grp-tools li a.grp-arrow-down-handler,.grp-tools li a.grp-arrow-up-handler,.grp-tools li a.grp-trash-handler,.grp-tools li a.grp-trash-list-toggle-handler,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-ascending,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-descending,.grp-date-hierarchy ul li a.grp-date-hierarchy-back,.grp-pulldown-container .grp-pulldown-handler,.grp-pulldown-container .grp-pulldown-handler:hover,.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler,.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler:hover,body.grp-filebrowser table td.grp-sorted.grp-ascending a,body.grp-filebrowser table th.grp-sorted.grp-ascending a,body.grp-filebrowser table td.grp-sorted.grp-descending a,body.grp-filebrowser table th.grp-sorted.grp-descending a,.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next,#grp-breadcrumbs>ul a,#grp-breadcrumbs>ul a:hover,#grp-page-tools ul li a#grp-open-all,#grp-page-tools ul li a#grp-close-all{background:url('../images/icons-s0e29227ce9.png') no-repeat}.icons-add-another{background-position:0 -1377px}.icons-add-another:hover,.icons-add-another.add-another_hover,.icons-add-another.add-another-hover{background-position:0 -1421px}.icons-back-link{background-position:0 -1119px}.icons-back-link:hover,.icons-back-link.back-link_hover,.icons-back-link.back-link-hover{background-position:0 -1162px}.icons-breadcrumbs-rtl{background-position:0 -727px}.icons-breadcrumbs-rtl:hover,.icons-breadcrumbs-rtl.breadcrumbs-rtl_hover,.icons-breadcrumbs-rtl.breadcrumbs-rtl-hover{background-position:0 -683px}.icons-breadcrumbs{background-position:0 -771px}.icons-breadcrumbs:hover,.icons-breadcrumbs.breadcrumbs_hover,.icons-breadcrumbs.breadcrumbs-hover{background-position:0 -815px}.icons-date-hierarchy-back-rtl{background-position:0 -859px}.icons-date-hierarchy-back-rtl:hover,.icons-date-hierarchy-back-rtl.date-hierarchy-back-rtl_hover,.icons-date-hierarchy-back-rtl.date-hierarchy-back-rtl-hover{background-position:0 -902px}.icons-date-hierarchy-back{background-position:0 -1033px}.icons-date-hierarchy-back:hover,.icons-date-hierarchy-back.date-hierarchy-back_hover,.icons-date-hierarchy-back.date-hierarchy-back-hover{background-position:0 -1076px}.icons-datepicker{background-position:0 -2172px}.icons-datepicker:hover,.icons-datepicker.datepicker_hover,.icons-datepicker.datepicker-hover{background-position:0 -2085px}.icons-datetime-now{background-position:0 -339px}.icons-datetime-now:hover,.icons-datetime-now.datetime-now_hover,.icons-datetime-now.datetime-now-hover{background-position:0 -468px}.icons-form-select{background-position:0 -1828px}.icons-object-tools-add-link{background-position:0 -989px}.icons-object-tools-viewsite-link{background-position:0 -945px}.icons-pulldown-handler{background-position:0 -2651px}.icons-pulldown-handler:hover,.icons-pulldown-handler.pulldown-handler_hover,.icons-pulldown-handler.pulldown-handler-hover{background-position:0 -2475px}.icons-pulldown-handler_selected{background-position:0 -2519px}.icons-related-lookup-m2m{background-position:0 -1664px}.icons-related-lookup-m2m:hover,.icons-related-lookup-m2m.related-lookup-m2m_hover,.icons-related-lookup-m2m.related-lookup-m2m-hover{background-position:0 -1750px}.icons-related-lookup{background-position:0 -1707px}.icons-related-lookup:hover,.icons-related-lookup.related-lookup_hover,.icons-related-lookup.related-lookup-hover{background-position:0 -1621px}.icons-related-remove{background-position:0 -597px}.icons-related-remove:hover,.icons-related-remove.related-remove_hover,.icons-related-remove.related-remove-hover{background-position:0 -640px}.icons-searchbox{background-position:0 0}.icons-selector-add-m2m-horizontal{background-position:0 -263px}.icons-selector-add-m2m-horizontal:hover,.icons-selector-add-m2m-horizontal.selector-add-m2m-horizontal_hover,.icons-selector-add-m2m-horizontal.selector-add-m2m-horizontal-hover{background-position:0 -231px}.icons-selector-add-m2m-vertical{background-position:0 -35px}.icons-selector-add-m2m-vertical:hover,.icons-selector-add-m2m-vertical.selector-add-m2m-vertical_hover,.icons-selector-add-m2m-vertical.selector-add-m2m-vertical-hover{background-position:0 -68px}.icons-selector-filter{background-position:0 -2347px}.icons-selector-remove-m2m-horizontal{background-position:0 -199px}.icons-selector-remove-m2m-horizontal:hover,.icons-selector-remove-m2m-horizontal.selector-remove-m2m-horizontal_hover,.icons-selector-remove-m2m-horizontal.selector-remove-m2m-horizontal-hover{background-position:0 -167px}.icons-selector-remove-m2m-vertical{background-position:0 -101px}.icons-selector-remove-m2m-vertical:hover,.icons-selector-remove-m2m-vertical.selector-remove-m2m-vertical_hover,.icons-selector-remove-m2m-vertical.selector-remove-m2m-vertical-hover{background-position:0 -134px}.icons-sort-remove{background-position:0 -511px}.icons-sort-remove:hover,.icons-sort-remove.sort-remove_hover,.icons-sort-remove.sort-remove-hover{background-position:0 -554px}.icons-sorted-ascending{background-position:0 -382px}.icons-sorted-descending{background-position:0 -425px}.icons-status-no{background-position:0 -1793px}.icons-status-unknown{background-position:0 -1551px}.icons-status-yes{background-position:0 -1586px}.icons-th-ascending{background-position:0 -2379px}.icons-th-descending{background-position:0 -2405px}.icons-timepicker{background-position:0 -1465px}.icons-timepicker:hover,.icons-timepicker.timepicker_hover,.icons-timepicker.timepicker-hover{background-position:0 -1508px}.icons-tools-add-handler{background-position:0 -2607px}.icons-tools-add-handler:hover,.icons-tools-add-handler.tools-add-handler_hover,.icons-tools-add-handler.tools-add-handler-hover{background-position:0 -3003px}.icons-tools-arrow-down-handler{background-position:0 -2563px}.icons-tools-arrow-down-handler:hover,.icons-tools-arrow-down-handler.tools-arrow-down-handler_hover,.icons-tools-arrow-down-handler.tools-arrow-down-handler-hover{background-position:0 -2695px}.icons-tools-arrow-up-handler{background-position:0 -2827px}.icons-tools-arrow-up-handler:hover,.icons-tools-arrow-up-handler.tools-arrow-up-handler_hover,.icons-tools-arrow-up-handler.tools-arrow-up-handler-hover{background-position:0 -2871px}.icons-tools-close-handler{background-position:0 -2215px}.icons-tools-close-handler:hover,.icons-tools-close-handler.tools-close-handler_hover,.icons-tools-close-handler.tools-close-handler-hover{background-position:0 -1997px}.icons-tools-delete-handler-predelete{background-position:0 -295px}.icons-tools-delete-handler{background-position:0 -2915px}.icons-tools-delete-handler:hover,.icons-tools-delete-handler.tools-delete-handler_hover,.icons-tools-delete-handler.tools-delete-handler-hover{background-position:0 -2431px}.icons-tools-drag-handler{background-position:0 -2259px}.icons-tools-drag-handler:hover,.icons-tools-drag-handler.tools-drag-handler_hover,.icons-tools-drag-handler.tools-drag-handler-hover{background-position:0 -2739px}.icons-tools-open-handler{background-position:0 -1909px}.icons-tools-open-handler:hover,.icons-tools-open-handler.tools-open-handler_hover,.icons-tools-open-handler.tools-open-handler-hover{background-position:0 -1953px}.icons-tools-remove-handler{background-position:0 -3047px}.icons-tools-remove-handler:hover,.icons-tools-remove-handler.tools-remove-handler_hover,.icons-tools-remove-handler.tools-remove-handler-hover{background-position:0 -3091px}.icons-tools-trash-handler{background-position:0 -2041px}.icons-tools-trash-handler:hover,.icons-tools-trash-handler.tools-trash-handler_hover,.icons-tools-trash-handler.tools-trash-handler-hover{background-position:0 -1865px}.icons-tools-trash-list-toggle-handler{background-position:0 -2128px}.icons-tools-trash-list-toggle-handler:hover,.icons-tools-trash-list-toggle-handler.tools-trash-list-toggle-handler_hover,.icons-tools-trash-list-toggle-handler.tools-trash-list-toggle-handler-hover{background-position:0 -2783px}.icons-tools-viewsite-link{background-position:0 -2303px}.icons-tools-viewsite-link:hover,.icons-tools-viewsite-link.tools-viewsite-link_hover,.icons-tools-viewsite-link.tools-viewsite-link-hover{background-position:0 -2959px}.icons-ui-datepicker-next{background-position:0 -1291px}.icons-ui-datepicker-next:hover,.icons-ui-datepicker-next.ui-datepicker-next_hover,.icons-ui-datepicker-next.ui-datepicker-next-hover{background-position:0 -1334px}.icons-ui-datepicker-prev{background-position:0 -1205px}.icons-ui-datepicker-prev:hover,.icons-ui-datepicker-prev.ui-datepicker-prev_hover,.icons-ui-datepicker-prev.ui-datepicker-prev-hover{background-position:0 -1248px}.icons-small-sprite,.icons-small-add-link,.icons-small-change-link,.icons-small-delete-link,.icons-small-filter-choice-selected,.icons-small-link-external,.icons-small-link-internal,.icons-small-sort-remove,a.grp-link-external,a.grp-link-internal,.grp-actions li.grp-add-link a,.grp-actions li.grp-change-link a,.grp-actions li.grp-delete-link a,.grp-actions li.grp-delete-link>span:first-child,.grp-listing li.grp-add-link a,.grp-listing li.grp-change-link a,.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child,.grp-listing-small li.grp-add-link a,.grp-listing-small li.grp-change-link a,.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child,.grp-filter .grp-row.grp-selected a{background:url('../images/icons-small-s7d28d7943b.png') no-repeat}.icons-small-add-link{background-position:0 -2085px}.icons-small-add-link:hover,.icons-small-add-link.add-link_hover,.icons-small-add-link.add-link-hover{background-position:0 -2502px}.icons-small-change-link{background-position:0 -3753px}.icons-small-change-link:hover,.icons-small-change-link.change-link_hover,.icons-small-change-link.change-link-hover{background-position:0 -4170px}.icons-small-delete-link{background-position:0 -2919px}.icons-small-filter-choice-selected{background-position:0 0}.icons-small-link-external{background-position:0 -417px}.icons-small-link-external:hover,.icons-small-link-external.link-external_hover,.icons-small-link-external.link-external-hover{background-position:0 -834px}.icons-small-link-internal{background-position:0 -1668px}.icons-small-link-internal:hover,.icons-small-link-internal.link-internal_hover,.icons-small-link-internal.link-internal-hover{background-position:0 -1251px}.icons-small-sort-remove{background-position:0 -3336px}.grp-font-size-xl,h1,.h1{font-size:20px}.grp-font-size-l,h2{font-size:13px}.grp-font-size-m,h3{font-size:12px}.grp-font-size,h4,.grp-button,input[type="submit"],a.grp-button,button.grp-button,input[type=button].grp-button,body{font-size:12px}.grp-font-size-s,.grp-actions{font-size:11px}.grp-font-size-xs{font-size:10px}.grp-line-height-xl,h1,.h1{line-height:24px}.grp-line-height-l,h2{line-height:18px}.grp-line-height-m,h3{line-height:16px}.grp-line-height,h4,.grp-actions,.grp-button,input[type="submit"],a.grp-button,button.grp-button,input[type=button].grp-button,body{line-height:16px}.grp-line-height-s{line-height:14px}.grp-line-height-xs{line-height:13px}a{text-decoration:none;color:#309bbf}a:hover{color:#444}a.grp-back-link{display:inline-block;width:16px;height:16px;background-position:0 -1122px}a.grp-back-link:hover,a.grp-back-link.back-link_hover,a.grp-back-link.back-link-hover{background-position:0 -1165px}a.grp-back-link:hover{background-position:0 -1165px}a.grp-back-link.grp-icon-text{padding-left:24px;width:auto}a.grp-link-external{padding-left:18px;color:#62bbd9;background-position:0 -417px}a.grp-link-external:hover,a.grp-link-external.link-external_hover,a.grp-link-external.link-external-hover{background-position:0 -834px}a.grp-link-external:hover{color:#444}a.grp-link-internal{padding-left:18px;background-position:0 -1668px}a.grp-link-internal:hover,a.grp-link-internal.link-internal_hover,a.grp-link-internal.link-internal-hover{background-position:0 -1251px}h1,.h1{padding:20px 0 10px;font-weight:bold}h2{font-weight:bold}h3{font-weight:bold}h4{font-weight:bold}h1 span,h2 span,h3 span,h4 span{display:inline-block;margin-left:10px;font-weight:normal}em{font-style:italic}strong{font-weight:bold}.grp-float-left{float:left !important}.grp-float-right{float:right !important}.grp-transparent{border:0 !important;background-color:transparent !important}body.grp-doc article#grp-content section.grp-doc-section{margin-top:40px;border-top:5px solid #d94800}body.grp-doc article#grp-content section.grp-doc-section:first-child{margin-top:0}body.grp-doc span.anchor-helper{position:relative;top:-80px}body.grp-doc .grp-doc-code-source{padding-top:15px;border-top:1px dashed #c30}body.grp-doc .grp-doc-description{margin-bottom:20px}body.grp-doc .grp-doc-description h1{margin-top:30px;padding-top:40px;border-top:3px solid #c30}body.grp-doc .grp-doc-description h2{font-size:16px;line-height:16px;margin:40px 0 10px}body.grp-doc .grp-doc-description h3{font-size:16px;line-height:24px;margin:20px 0 10px}body.grp-doc .grp-doc-description p,body.grp-doc .grp-doc-description ul,body.grp-doc .grp-doc-description ol{margin:10px 0;font-size:14px;line-height:24px}body.grp-doc .grp-doc-description ul{list-style-type:disc}body.grp-doc .grp-doc-description ul li{margin-left:20px}body.grp-doc .grp-doc-description small{font-size:11px}body.grp-doc .grp-doc-class,body.grp-doc .grp-doc-id,body.grp-doc .grp-doc-dom,body.grp-doc .grp-doc-file,body.grp-doc .grp-doc-django{display:inline-block;margin:-2px 0;padding:0 5px;font-size:12px;font-weight:bold;line-height:18px;border:1px solid #d9d9c3;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;background:#f2f2e6}body.grp-doc .grp-doc-dom span:before{content:"<"}body.grp-doc .grp-doc-dom span:after{content:">"}body.grp-doc code{position:relative;display:inline-block;margin:0 5px;padding:0 10px 20px;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-size:11px;border:1px solid #d9d9c3;background:#f2f2e6;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body.grp-doc pre{margin:10px 0;padding:0}body.grp-doc pre code{display:block;margin:0;padding:0 20px 15px}p.grp-help{max-width:758px;padding:5px 0 0;color:#9a9a9a;font-size:11px !important;line-height:13px;white-space:normal !important}p.grp-help:first-child{margin-top:5px}.errorlist+p.grp-help{padding-top:2px}.grp-cells p.grp-help,.grp-td p.grp-help{max-width:278px}.grp-row p.grp-help:first-child,.grp-td p.grp-help:first-child{margin:-2px 0 8px}.grp-row p.grp-help{margin-bottom:-2px}.grp-description{font-size:11px}.grp-row img{font-size:1px;line-height:1px;vertical-align:middle}.fb_show+p.grp-help a{display:inline-block;padding:3px;font-size:0;line-height:0}.fb_show+p.grp-help a img{margin:0;font-size:0;line-height:0}p.file-upload{margin:6px 0 3px;font-size:11px;line-height:14px}p.file-upload span.clearable-file-input{display:block;margin:5px 0 -12px}p.file-upload span.clearable-file-input input{margin:1px 0 0}p.file-upload span.clearable-file-input label{margin:0 0 0 5px}tr p.file-upload{margin:1px 0 -2px;line-height:13px}p.preview{margin:5px 0 0}tr p.preview{margin:9px 0 -5px}p.preview a{display:inline-block;padding:3px;font-size:0;line-height:0;border:1px solid #309bbf;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}p.preview a:hover{border:1px solid #444}.grp-rte{font-size:13px;line-height:18px}.grp-rte h4{margin:5px 0}.grp-rte p,.grp-rte ul,.grp-rte ol,.grp-rte blockquote,.grp-rte dl,.grp-rte dt,.grp-rte dd{margin:10px 0}.grp-rte p:only-child,.grp-rte ul:only-child,.grp-rte ol:only-child,.grp-rte blockquote:only-child,.grp-rte dl:only-child,.grp-rte dt:only-child,.grp-rte dd:only-child{margin:5px 0}.grp-rte ul{margin-left:30px}.grp-rte ul li{margin-left:20px;list-style-type:disc;list-style-position:outside}.grp-rte ul li ul{margin-top:-5px !important}.grp-rte ul li ul li{list-style-type:circle}.grp-docutils .grp-module h4{padding:0;font-size:13px;border:0;background:none}.grp-docutils .grp-module h4 p{margin:0}.grp-docutils table p{margin:0 !important}.grp-docutils code,.grp-docutils pre{font-size:11px;font-family:"Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace}.grp-docutils pre.literal-block{margin:10px;padding:6px 8px;background:#fff}.grp-docutils .grp-group h2+.grp-row>p{padding:3px 10px 0}span.grp-anchor{position:relative;float:left;clear:both;top:-80px}.grp-nowrap{white-space:nowrap}p.datetime{white-space:nowrap !important}p.datetime br{display:none}p.datetime input.vTimeField{margin-left:6px}a.add-another img,a.related-lookup img{opacity:0}a.related-lookup img{display:none}.deletelink{padding-left:12px;background:url(../../admin/img/icon_deletelink.gif) 0 0.25em no-repeat}fieldset.grp-module .grp-row label{margin:6px 0 6px;display:inline-block;font-family:Arial,sans-serif;font-size:11px;line-height:13px;color:#444}fieldset.grp-module .grp-row label.required{font-weight:bold}input[type="text"],input[type="password"],input[type="url"],input[type="email"],input[type="number"],input[type="submit"],input[type="reset"],textarea,select{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}input[type="text"]:focus,input[type="text"].grp-state-focus,input[type="password"]:focus,input[type="password"].grp-state-focus,input[type="url"]:focus,input[type="url"].grp-state-focus,input[type="email"]:focus,input[type="email"].grp-state-focus,input[type="number"]:focus,input[type="number"].grp-state-focus,input[type="submit"]:focus,input[type="submit"].grp-state-focus,input[type="reset"]:focus,input[type="reset"].grp-state-focus,textarea:focus,textarea.grp-state-focus,select:focus,select.grp-state-focus{border:1px solid #aaa;-webkit-box-shadow:#ccc 0 0 6px;-moz-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.grp-errors input[type="text"],.grp-errors input[type="password"],.grp-errors input[type="url"],.grp-errors input[type="email"],.grp-errors input[type="number"],.grp-errors input[type="submit"],.grp-errors input[type="reset"],.grp-errors textarea,.grp-errors select{border-color:#bf3030}input[readonly],input[disabled],textarea[readonly],select[disabled]{border:1px solid #ccc !important;border-style:dotted !important;background:transparent !important}input[readonly]:focus,input[disabled]:focus,textarea[readonly]:focus,select[disabled]:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}div.grp-readonly{position:relative;display:inline-block;margin:0;padding:4px 5px 3px !important;min-width:106px;max-width:746px;min-height:16px;font-size:12px;line-height:16px;font-weight:bold;color:#555555;border:1px dotted #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}div.grp-readonly *{white-space:normal !important}div.grp-readonly pre{white-space:pre !important}div.grp-readonly+div.grp-readonly{margin-left:20px}div.grp-readonly:empty{margin-bottom:-5px !important}.grp-errors label{color:#bf3030 !important}.grp-errors ul.radiolist.inline label,.grp-errors ul.checkboxlist.inline label{color:#444 !important}.grp-errors input[type="text"],.grp-errors input[type="password"],.grp-errors input[type="url"],.grp-errors input[type="email"],.grp-errors input[type="number"],.grp-errors input[type="submit"],.grp-errors input[type="reset"],.grp-errors textarea,.grp-errors select{border-color:#bf3030 !important}.grp-errors .selector input,.grp-errors .selector select,.grp-errors .selector textarea{border:1px solid #ccc !important}.grp-errors ul.errorlist{padding:5px 0 0;color:#bf3030;font-size:11px !important;line-height:14px}select{padding:4px 3px 4px 2px;min-width:118px}@media screen and (-webkit-min-device-pixel-ratio: 0){select,select:focus{padding:4px 28px 4px 5px;-webkit-appearance:textfield;background-image:url("../images/icons/form-select.png");background-position:100% 50%;background-repeat:no-repeat}}select[multiple=multiple]{padding-right:5px;height:160px}@media screen and (-webkit-min-device-pixel-ratio: 0){select[multiple=multiple]{background-image:none}}textarea{vertical-align:top;padding:5px 5px;height:60px;overflow:auto}fieldset.monospace textarea{font-family:"Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace}.grp-row input[type=checkbox],.grp-row input[type=radio]{position:relative;top:1px}.grp-row input[type=checkbox]+label,.grp-row input[type=radio]+label{position:relative;margin:0 0 0 5px}input[type=text].grp-search-field{margin-right:-5px;padding-left:10px;padding-right:30px;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px;border-radius:20px}ul.radiolist,ul.checkboxlist{position:relative;float:none;display:inline-block;margin:5px 0 0;padding:0;font-size:11px;line-height:15px;font-weight:normal}ul.radiolist label,ul.checkboxlist label{float:none;display:inline-block;margin:0 !important;padding:0 !important;width:auto !important;white-space:nowrap}ul.radiolist li+li,ul.checkboxlist li+li{margin-top:2px}.grp-row>ul.radiolist,.grp-row>ul.checkboxlist{margin:0}ul.radiolist.inline,ul.checkboxlist.inline{position:relative;float:none;display:inline-block;margin:5px 0 0;padding:0;font-size:11px;line-height:15px;font-weight:normal;max-width:760px;float:left;display:inline;margin-top:5px;margin-bottom:3px;padding-right:20px}ul.radiolist.inline label,ul.checkboxlist.inline label{float:none;display:inline-block;margin:0 !important;padding:0 !important;width:auto !important;white-space:nowrap}ul.radiolist.inline li+li,ul.checkboxlist.inline li+li{margin-top:2px}ul.radiolist.inline li,ul.checkboxlist.inline li{float:left;display:inline;margin-top:0 !important;margin-bottom:2px;padding-right:20px}.grp-module.grp-tbody ul.radiolist.inline,.grp-module.grp-tbody ul.checkboxlist.inline{white-space:normal}.grp-module.grp-tbody ul.radiolist.inline li,.grp-module.grp-tbody ul.checkboxlist.inline li{position:relative;float:left;display:inline}.grp-row.grp-cells ul.radiolist.inline li,.grp-row.grp-cells ul.checkboxlist.inline li{float:none}.selector{position:relative;float:left;overflow:hidden;width:758px}.selector .selector-available,.selector .selector-chosen{float:left;width:366px;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#ddd}.selector .selector-available.stacked,.selector .selector-chosen.stacked{width:756px}.selector .selector-available h2,.selector .selector-chosen h2{padding:7px 5px 6px 7px;font-size:12px;line-height:13px;font-weight:bold}.selector .selector-available h2 img,.selector .selector-chosen h2 img{display:none}.selector ul.selector-chooser{float:left;margin:110px 2px 0;padding:0;width:18px}.selector .selector-chosen h2{border-bottom:0 !important}.selector .selector-filter{display:block !important;height:27px;padding:3px 5px 2px 2px;font-weight:bold;color:#666;border-top:1px solid #e4e4e4;border-bottom:1px solid #e4e4e4;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;line-height:25px;text-indent:25px;background:url("../images/icons/searchbox.png") 6px 50% no-repeat}.selector .selector-filter input[type=text]{position:relative;margin:0;width:326px !important;max-width:326px !important}.selector .selector-filter img{display:none}.selector .selector-filter h2+select{position:relative;top:-1px}.selector select[multiple=multiple]{margin:0 0 0 -1px;padding-left:3px;max-width:368px !important;width:368px !important;height:200px;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.selector .selector-chosen select[multiple=multiple]{height:235px}.selector a.selector-add{background-image:url("../images/icons/selector-add-m2m-horizontal.png")}.selector a.selector-add:hover{background-image:url("../images/icons/selector-add-m2m-horizontal_hover.png")}.selector a.selector-remove{background-image:url("../images/icons/selector-remove-m2m-horizontal.png")}.selector a.selector-remove:hover{background-image:url("../images/icons/selector-remove-m2m-horizontal_hover.png")}.selector a.selector-chooseall,.selector a.selector-clearall{display:block;margin:0;padding:2px 7px;font-size:11px;line-height:13px;font-weight:bold}.selector.stacked .selector-available,.selector.stacked .selector-chosen{width:756px}.selector.stacked .selector-filter input[type=text]{width:716px !important;max-width:716px !important}.selector.stacked .selector-chosen .selector-filter:after{content:" " url("../images/icons/selector-add-m2m-vertical_hover.png")}.selector.stacked select[multiple=multiple]{width:758px !important;max-width:758px !important}.selector.stacked ul.selector-chooser{margin:4px 0 0 356px;width:36px}.selector.stacked ul.selector-chooser li{float:left}.selector.stacked a.selector-add{background-image:url("../images/icons/selector-add-m2m-vertical.png")}.selector.stacked a.selector-add:hover{background-image:url("../images/icons/selector-add-m2m-vertical_hover.png")}.selector.stacked a.selector-remove{background-image:url("../images/icons/selector-remove-m2m-vertical.png")}.selector.stacked a.selector-remove:hover{background-image:url("../images/icons/selector-remove-m2m-vertical_hover.png")}.selector a.selector-add,.selector a.selector-remove{display:block;width:18px;height:18px;color:transparent !important;background-position:50% 0;background-repeat:no-repeat}ul.errorlist+.selector{margin-top:8px !important}p.errornote{position:relative;float:left;clear:both;margin:0 0 5px;padding:5px 10px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#fff;font-weight:bold;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#bf3030}p.errornote+ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal;margin:5px 0 0;margin:-5px 0 0}p.errornote+ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}p.errornote+ul.errorlist li{padding:5px 10px}p.errornote+ul.errorlist li+li{border-top:1px solid #bf3030}ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal}ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}ul.errorlist+ul.errorlist{padding-top:2px}.grp-row ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal;margin:0}.grp-row ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-row ul.errorlist li{padding:2px 0 0;border-top:0 !important}.grp-row ul.errorlist li:first-child{padding-top:0}.grp-tabular p.errornote{margin:2px 0 0}.grp-tabular p.errornote+ul.errorlist{margin:0}.grp-tabular ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal;margin:5px 0 0}.grp-tabular ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-tabular ul.errorlist li{padding:5px 10px}.grp-tabular ul.errorlist li+li{border-top:1px solid #bf3030}.grp-tabular .grp-tbody ul.errorlist{margin:0}.grp-tabular .grp-td ul.errorlist{clear:both;*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal;margin:0}.grp-tabular .grp-td ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-tabular .grp-td ul.errorlist li{padding:2px 0 0;border-top:0 !important}.grp-tabular .grp-td ul.errorlist li:first-child{padding-top:0}.grp-stacked p.errornote{margin:0}.grp-stacked p.errornote+ul.errorlist{margin:0}.grp-stacked ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal;margin:5px 0 0;margin:3px 0}.grp-stacked ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-stacked ul.errorlist li{padding:5px 10px}.grp-stacked ul.errorlist li+li{border-top:1px solid #bf3030}.grp-stacked h3+*+ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal;margin:0;margin:0 !important;padding:5px 10px 8px;border-top:1px solid #fff;border-bottom:1px solid #ddd}.grp-stacked h3+*+ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-stacked h3+*+ul.errorlist li{padding:2px 0 0;border-top:0 !important}.grp-stacked h3+*+ul.errorlist li:first-child{padding-top:0}.grp-stacked .grp-row ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;white-space:normal;margin:0}.grp-stacked .grp-row ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-stacked .grp-row ul.errorlist li{padding:2px 0 0;border-top:0 !important}.grp-stacked .grp-row ul.errorlist li:first-child{padding-top:0}.grp-errors a.add-another+ul.errorlist{clear:both}.grp-errors td.mceIframeContainer{border:1px solid #bf3030 !important;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}input[type=text],input[type=password],input[type="number"],.vDateField,.vTimeField,.vIntegerField,.vPositiveSmallIntegerField,.vManyToManyRawIdAdminField,.vForeignKeyRawIdAdminField{width:118px}input.grp-has-related-lookup,input.vDateField.hasDatepicker,input.vTimeField.hasTimepicker,input.vFileBrowseField{padding-right:24px !important}input[type="url"],input[type="email"],input.vTextField,input.vURLField,input.vFileBrowseField,textarea,.vLargeTextField,.vXMLLargeTextField{width:278px}.row select{min-width:118px}.vLargeTextField{height:118px}.grp-row input[type="url"],.grp-row input[type="email"],.grp-row .vTextField,.grp-row .vURLField,.grp-row .vFileBrowseField,.grp-row textarea,.grp-row .vLargeTextField,.grp-row .vXMLLargeTextField,.grp-autocomplete-wrapper-m2m{width:758px}.grp-row select{max-width:758px}.grp-autocomplete-wrapper-m2m ul.grp-repr,.grp-autocomplete-wrapper-m2m ul.grp-repr li{max-width:700px}.grp-changelist-results table input[type="url"],.grp-changelist-results table input[type="email"],.grp-changelist-results table .vTextField,.grp-changelist-results table .vURLField,.grp-changelist-results table .vFileBrowseField,.grp-changelist-results table textarea,.grp-changelist-results table .vLargeTextField,.grp-changelist-results table .vXMLLargeTextField,.grp-changelist-results table select{max-width:278px}.grp-module.grp-table select,.grp-module.grp-table .grp-autocomplete-wrapper-m2m,.grp-module.grp-table .grp-autocomplete-wrapper-fk{max-width:278px}.grp-module.grp-table .grp-autocomplete-wrapper-m2m,.grp-module.grp-table .grp-autocomplete-wrapper-fk{width:278px}.grp-module.grp-table .grp-autocomplete-wrapper-m2m ul.grp-repr,.grp-module.grp-table .grp-autocomplete-wrapper-m2m ul.grp-repr li{max-width:222px}.grp-cell input[type="url"],.grp-cell input[type="email"],.grp-cell input[type="number"],.grp-cell input[type=text],.grp-cell input[type=password],.grp-cell select,.grp-cell input[readonly],.grp-cell input[disabled],.grp-cell textarea[readonly],.grp-cell select[disabled],.grp-cell .grp-autocomplete-wrapper-m2m,.grp-cell .grp-autocomplete-wrapper-fk{max-width:278px}.grp-cell .grp-autocomplete-wrapper-m2m ul.grp-repr,.grp-cell .grp-autocomplete-wrapper-m2m ul.grp-repr li{max-width:220px}.grp-cell div.grp-readonly{max-width:266px}.grp-autocomplete-wrapper-m2m,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}.grp-autocomplete-wrapper-m2m:focus,.grp-autocomplete-wrapper-m2m.grp-state-focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input:focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input.grp-state-focus{border:1px solid #aaa;-webkit-box-shadow:#ccc 0 0 6px;-moz-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.grp-autocomplete-wrapper-m2m:focus,.grp-autocomplete-wrapper-m2m.grp-state-focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input:focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input.grp-state-focus{background-color:#e1f0f5}.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup{position:absolute;right:0}.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-m2m input:focus+a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup,.grp-autocomplete-wrapper-fk input:focus+a.related-lookup{border:1px solid #ccc !important}.grp-autocomplete-wrapper-m2m.grp-state-focus a.grp-related-remove,.grp-autocomplete-wrapper-m2m.grp-state-focus a.related-lookup,.grp-autocomplete-wrapper-fk.grp-state-focus a.grp-related-remove,.grp-autocomplete-wrapper-fk.grp-state-focus a.related-lookup{border:1px solid #aaa !important}.grp-autocomplete-wrapper-m2m a.grp-related-remove,.grp-autocomplete-wrapper-m2m div.grp-loader,.grp-autocomplete-wrapper-fk a.grp-related-remove,.grp-autocomplete-wrapper-fk div.grp-loader{display:inline-block;position:absolute;right:24px;top:0;font-size:0;line-height:0;width:23px;height:23px;border:1px solid #ccc}.grp-autocomplete-wrapper-m2m div.grp-loader,.grp-autocomplete-wrapper-fk div.grp-loader{background:#fdfdfd url("../images/backgrounds/loading-small.gif") 50% 50% no-repeat scroll}.grp-autocomplete-wrapper-m2m.grp-autocomplete-preremove input.ui-autocomplete-input,.grp-autocomplete-wrapper-m2m.grp-autocomplete-preremove li.grp-repr a,.grp-autocomplete-wrapper-fk.grp-autocomplete-preremove input.ui-autocomplete-input,.grp-autocomplete-wrapper-fk.grp-autocomplete-preremove li.grp-repr a{color:#bf3030 !important}.grp-autocomplete-wrapper-m2m li.grp-repr.grp-autocomplete-preremove a,.grp-autocomplete-wrapper-fk li.grp-repr.grp-autocomplete-preremove a{color:#bf3030 !important}.grp-autocomplete-wrapper-m2m{display:inline-block;position:relative;padding:0;height:auto !important;vertical-align:top;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow:visible}.grp-autocomplete-wrapper-m2m ul.grp-repr{float:left;padding-right:55px;width:100%;max-width:700px;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.grp-autocomplete-wrapper-m2m ul.grp-repr li{float:left;display:inline;overflow:hidden;white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;-o-text-overflow:ellipsis;text-overflow:ellipsis;max-width:700px}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-repr{margin:3px 5px 0 1px;font-weight:bold;line-height:18px}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-repr a.grp-m2m-remove{color:#555;padding-left:5px}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-search{margin-top:1px;margin-bottom:1px;background:transparent}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-search input[type=text]{margin:0 0 -1px;padding:0 4px;width:100px;height:22px;font-size:12px;line-height:16px;outline:0;border:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:transparent;cursor:text}.grp-autocomplete-wrapper-m2m a.related-lookup{top:-1px;right:-1px}.grp-autocomplete-wrapper-m2m a.grp-related-remove+a.grp-related-lookup{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}.grp-autocomplete-wrapper-m2m a.grp-related-remove,.grp-autocomplete-wrapper-m2m a.grp-related-remove+div.grp-loader{top:-1px;right:23px}.grp-autocomplete-wrapper-fk{display:inline-block;position:relative;width:auto !important;height:auto !important;margin:0 !important;padding:0 !important;vertical-align:top;font-size:0 !important;line-height:0 !important;background:transparent !important}.grp-autocomplete-wrapper-fk input.ui-autocomplete-input{padding-right:55px}.grp-errors .grp-autocomplete-wrapper-m2m,.grp-errors .grp-autocomplete-wrapper-fk input.ui-autocomplete-input,.grp-errors a.grp-related-remove{border-color:#bf3030 !important}#changelist table div.autocomplete-wrapper-fk a.grp-related-remove,#changelist table div.autocomplete-wrapper-m2m a.grp-related-remove,#changelist table div.autocomplete-wrapper-fk div.grp-loader,#changelist table div.autocomplete-wrapper-m2m div.grp-loader{top:-5px}.grp-autocomplete-wrapper-m2m .grp-autocomplete-hidden-field,.grp-autocomplete-wrapper-fk .grp-autocomplete-hidden-field{position:absolute !important;z-index:0 !important;padding:0 !important;width:1px !important;height:1px !important;font-size:0 !important;line-height:0 !important;color:transparent !important;border:0 !important;background:transparent !important}.grp-actions{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;float:right;font-weight:bold}.grp-actions li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}.grp-actions li:first-child,.grp-actions li.first{padding-left:0}.grp-actions li:last-child{padding-right:0}.grp-actions li.last{padding-right:0}.grp-actions li.grp-add-link a,.grp-actions li.grp-add-link>span:first-child,.grp-actions li.grp-change-link a,.grp-actions li.grp-change-link>span:first-child,.grp-actions li.grp-delete-link a,.grp-actions li.grp-delete-link>span:first-child{padding-left:20px;display:block;font-weight:bold}.grp-actions li.grp-add-link a{background-position:0 -2085px}.grp-actions li.grp-add-link a:hover,.grp-actions li.grp-add-link a.add-link_hover,.grp-actions li.grp-add-link a.add-link-hover{background-position:0 -2502px}.grp-actions li.grp-change-link a{background-position:0 -3753px}.grp-actions li.grp-change-link a:hover,.grp-actions li.grp-change-link a.change-link_hover,.grp-actions li.grp-change-link a.change-link-hover{background-position:0 -4170px}.grp-actions li.grp-delete-link a,.grp-actions li.grp-delete-link>span:first-child{background-position:0 -2919px}.grp-group{position:relative;float:left;clear:both;margin:0 -4px 5px;padding:2px;width:100%;border:2px solid #ccc;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;background:#fff}.grp-group.grp-closed{border:2px solid #ddd}.grp-group.grp-closed:hover{border:2px solid #ccc}.grp-module h2{padding:5px 10px 4px;text-shadow:0 1px 0 #f5f5f5;border-bottom:1px solid #ccc;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2U1ZTVlNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2RiZGJkYiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e5e5e5), color-stop(100%, #dbdbdb));background-image:-webkit-linear-gradient(#e5e5e5,#dbdbdb);background-image:-moz-linear-gradient(#e5e5e5,#dbdbdb);background-image:-o-linear-gradient(#e5e5e5,#dbdbdb);background-image:linear-gradient(#e5e5e5,#dbdbdb)}.grp-module h3{padding:5px 10px;text-shadow:0 1px 0 #f5f5f5;border-top:1px solid #f5f5f5;border-bottom:1px solid #ccc;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2U1ZTVlNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2RiZGJkYiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e5e5e5), color-stop(100%, #dbdbdb));background-image:-webkit-linear-gradient(#e5e5e5,#dbdbdb);background-image:-moz-linear-gradient(#e5e5e5,#dbdbdb);background-image:-o-linear-gradient(#e5e5e5,#dbdbdb);background-image:linear-gradient(#e5e5e5,#dbdbdb)}@media screen and (-webkit-min-device-pixel-ratio: 0){.grp-module h3{padding:5px 10px 4px}}.grp-module h4{padding:5px 10px;text-shadow:0 1px 0 #f5f5f5;border-top:1px solid #f5f5f5;border-bottom:1px solid #ccc;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VhZWFlYSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eaeaea), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eaeaea,#e0e0e0);background-image:-moz-linear-gradient(#eaeaea,#e0e0e0);background-image:-o-linear-gradient(#eaeaea,#e0e0e0);background-image:linear-gradient(#eaeaea,#e0e0e0)}@media screen and (-webkit-min-device-pixel-ratio: 0){.grp-module h4{padding:5px 10px 4px}}.grp-group>h2{padding:5px 10px 4px;text-shadow:0 1px 0 #f5f5f5;border-bottom:1px solid #ccc;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2U1ZTVlNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2RiZGJkYiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e5e5e5), color-stop(100%, #dbdbdb));background-image:-webkit-linear-gradient(#e5e5e5,#dbdbdb);background-image:-moz-linear-gradient(#e5e5e5,#dbdbdb);background-image:-o-linear-gradient(#e5e5e5,#dbdbdb);background-image:linear-gradient(#e5e5e5,#dbdbdb);border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.grp-group.grp-open>h2{margin-bottom:2px}.grp-group.grp-tabular.grp-open>h2{margin-bottom:0}.grp-group .grp-module>h3{border-top:0 !important;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.grp-group .grp-module>h3:only-child,.grp-group .grp-module>h3:last-child{border-bottom:0}.grp-module{position:relative;float:left;clear:both;margin:0 0 5px;padding:0;width:100%;border:1px solid #ccc;background:#eee;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.grp-module .grp-module{margin:0;border:0}.grp-module .grp-module+.grp-module{border-top:1px solid #d9d9d9;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0}.grp-change-form .grp-module:not(.grp-submit-row){min-width:960px}.grp-empty-form{display:none !important}.grp-collapse.grp-closed *,.grp-collapse.grp-closed .grp-row:not(tr).grp-cells,.grp-collapse.grp-closed .grp-table,.grp-collapse.grp-closed .grp-table *{display:none}.grp-collapse.grp-closed>.grp-collapse-handler,.grp-collapse.grp-closed>.grp-collapse-handler *,.grp-collapse.grp-closed .grp-tools,.grp-collapse.grp-closed .grp-tools *{display:block !important}.grp-collapse.grp-closed .grp-tools li *[style^="display: none"]{display:none !important}.grp-collapse .grp-collapse-handler{cursor:pointer}.grp-collapse h2.grp-collapse-handler{text-shadow:0 1px 0 #c4e9f5}.grp-collapse.grp-open>h2.grp-collapse-handler{border-bottom:1px solid #ccc;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ExZDRlNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2JjZGZlYiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a1d4e5), color-stop(100%, #bcdfeb));background-image:-webkit-linear-gradient(#a1d4e5,#bcdfeb);background-image:-moz-linear-gradient(#a1d4e5,#bcdfeb);background-image:-o-linear-gradient(#a1d4e5,#bcdfeb);background-image:linear-gradient(#a1d4e5,#bcdfeb)}.grp-collapse.grp-closed>h2.grp-collapse-handler{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2JjZGZlYiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ExZDRlNSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #bcdfeb), color-stop(100%, #a1d4e5));background-image:-webkit-linear-gradient(#bcdfeb,#a1d4e5);background-image:-moz-linear-gradient(#bcdfeb,#a1d4e5);background-image:-o-linear-gradient(#bcdfeb,#a1d4e5);background-image:linear-gradient(#bcdfeb,#a1d4e5)}.grp-collapse.grp-closed>h2.grp-collapse-handler:hover{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ExZDRlNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2JjZGZlYiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a1d4e5), color-stop(100%, #bcdfeb));background-image:-webkit-linear-gradient(#a1d4e5,#bcdfeb);background-image:-moz-linear-gradient(#a1d4e5,#bcdfeb);background-image:-o-linear-gradient(#a1d4e5,#bcdfeb);background-image:linear-gradient(#a1d4e5,#bcdfeb)}.grp-collapse.grp-module.grp-closed>h2.grp-collapse-handler{border-bottom:0}.grp-collapse h3.grp-collapse-handler{text-shadow:0 1px 0 #fff}.grp-collapse.grp-open>h3.grp-collapse-handler{border-top:1px solid #e2f2f7;border-bottom:1px solid #d9d9d9;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2NlZTlmMiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UxZjBmNSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #cee9f2), color-stop(100%, #e1f0f5));background-image:-webkit-linear-gradient(#cee9f2,#e1f0f5);background-image:-moz-linear-gradient(#cee9f2,#e1f0f5);background-image:-o-linear-gradient(#cee9f2,#e1f0f5);background-image:linear-gradient(#cee9f2,#e1f0f5)}.grp-collapse.grp-closed>h3.grp-collapse-handler{border-bottom:0;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2UxZjBmNSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2NlZTlmMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e1f0f5), color-stop(100%, #cee9f2));background-image:-webkit-linear-gradient(#e1f0f5,#cee9f2);background-image:-moz-linear-gradient(#e1f0f5,#cee9f2);background-image:-o-linear-gradient(#e1f0f5,#cee9f2);background-image:linear-gradient(#e1f0f5,#cee9f2)}.grp-collapse.grp-closed>h3.grp-collapse-handler:hover{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2NlZTlmMiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UxZjBmNSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #cee9f2), color-stop(100%, #e1f0f5));background-image:-webkit-linear-gradient(#cee9f2,#e1f0f5);background-image:-moz-linear-gradient(#cee9f2,#e1f0f5);background-image:-o-linear-gradient(#cee9f2,#e1f0f5);background-image:linear-gradient(#cee9f2,#e1f0f5)}.grp-module .grp-row:not(tr){position:relative;float:left;clear:both;padding:5px 10px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-top:1px solid #fff;border-bottom:1px solid #ddd}.grp-predelete .grp-module .grp-row:not(tr){border-bottom-color:#f2d4d4;border-top-color:#fcf4f4}.grp-module .grp-row:not(tr):first-child,.grp-module .grp-row:not(tr).grp-first{border-top:0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px}.grp-module .grp-row:not(tr):last-of-type,.grp-module .grp-row:not(tr).grp-last{border-bottom:0;-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;border-bottom-left-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}.grp-module .grp-row:not(tr).grp-cells{display:table-row;padding-top:0;padding-bottom:0}.grp-module .grp-row:not(tr).grp-cells .grp-cell{display:table-cell;vertical-align:top;position:relative;padding:8px 20px 8px 0;height:100%;white-space:nowrap;border-right:1px solid #ddd;overflow:visible}.grp-module .grp-row:not(tr).grp-cells .grp-cell+.grp-cell{padding-left:20px;border-left:1px solid #fff}.grp-module .grp-row:not(tr).grp-cells .grp-cell:last-of-type{padding-right:0;border-right:0 !important}.grp-module .grp-row+.grp-module>.grp-row:first-child,.grp-module h2+.grp-module>.grp-row:first-child,.grp-module .grp-module+.grp-module>.grp-row:first-child{border-top:1px solid #fff}fieldset.grp-module .grp-row{padding:8px 10px;overflow:hidden}.grp-listing{border-top:1px solid #fff}.grp-listing:first-child{border-top:0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px}.grp-listing li.grp-add-link a,.grp-listing li.grp-add-link>span:first-child,.grp-listing li.grp-change-link a,.grp-listing li.grp-change-link>span:first-child,.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child{padding-left:20px;display:block;font-weight:bold}.grp-listing li.grp-add-link a{background-position:0 -2085px}.grp-listing li.grp-add-link a:hover,.grp-listing li.grp-add-link a.add-link_hover,.grp-listing li.grp-add-link a.add-link-hover{background-position:0 -2502px}.grp-listing li.grp-change-link a{background-position:0 -3753px}.grp-listing li.grp-change-link a:hover,.grp-listing li.grp-change-link a.change-link_hover,.grp-listing li.grp-change-link a.change-link-hover{background-position:0 -4170px}.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child{background-position:0 -2919px}.grp-listing li.grp-add-link,.grp-listing li.grp-change-link,.grp-listing li.grp-delete-link{padding-left:25px}.grp-listing li.grp-add-link a,.grp-listing li.grp-add-link>span:first-child,.grp-listing li.grp-change-link a,.grp-listing li.grp-change-link>span:first-child,.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child{display:block;margin-left:-20px;padding-left:20px}.grp-listing-small{border-top:1px solid #fff;font-size:11px}.grp-listing-small:first-child{border-top:0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px}.grp-listing-small li.grp-add-link a,.grp-listing-small li.grp-add-link>span:first-child,.grp-listing-small li.grp-change-link a,.grp-listing-small li.grp-change-link>span:first-child,.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child{padding-left:20px;display:block;font-weight:bold}.grp-listing-small li.grp-add-link a{background-position:0 -2085px}.grp-listing-small li.grp-add-link a:hover,.grp-listing-small li.grp-add-link a.add-link_hover,.grp-listing-small li.grp-add-link a.add-link-hover{background-position:0 -2502px}.grp-listing-small li.grp-change-link a{background-position:0 -3753px}.grp-listing-small li.grp-change-link a:hover,.grp-listing-small li.grp-change-link a.change-link_hover,.grp-listing-small li.grp-change-link a.change-link-hover{background-position:0 -4170px}.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child{background-position:0 -2919px}.grp-listing-small li.grp-add-link,.grp-listing-small li.grp-change-link,.grp-listing-small li.grp-delete-link{padding-left:25px}.grp-listing-small li.grp-add-link a,.grp-listing-small li.grp-add-link>span:first-child,.grp-listing-small li.grp-change-link a,.grp-listing-small li.grp-change-link>span:first-child,.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child{display:block;margin-left:-20px;padding-left:20px}.grp-listing-small a+span,.grp-listing-small span+span{position:relative;display:block;line-height:11px;margin:-1px 0 3px}.grp-listing-small p{margin:2px 0 4px;line-height:13px}.grp-stacked .grp-module.grp-add-item,.grp-tabular .grp-module.grp-add-item{margin-bottom:0;height:28px;font-weight:bold;border-color:transparent;background:transparent}.grp-stacked .grp-module.grp-add-item>a,.grp-tabular .grp-module.grp-add-item>a{font-weight:bold;padding:5px 10px;position:relative;top:6px}.grp-group:not(.grp-tabular){padding-bottom:0}.grp-group:not(.grp-tabular) .grp-module{margin-bottom:2px}.grp-group:not(.grp-tabular) .grp-module .grp-module{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px;border-top:1px solid #fff}.grp-group:not(.grp-tabular) .grp-module.grp-predelete .grp-module{border-top-color:#fdf8f8}.grp-group:not(.grp-tabular) h2{margin-bottom:2px}.grp-group:not(.grp-tabular).grp-closed{padding-bottom:2px}.grp-group:not(.grp-tabular).grp-closed h2{margin-bottom:0}.grp-tabular .grp-table{display:table;margin:0 0 -2px;width:100%;border:0 none;border-collapse:separate;border-spacing:0 2px;background:none}@media screen and (-webkit-min-device-pixel-ratio: 0){.grp-tabular .grp-table{margin-bottom:-1px;border-spacing:0 1px !important}}.grp-tabular .grp-table .grp-tr{display:table-row}.grp-tabular .grp-table .grp-th,.grp-tabular .grp-table .grp-td{display:table-cell;float:none;height:100%;margin-right:0;overflow:hidden;padding:1px 20px;vertical-align:top;white-space:nowrap;border-left:1px solid #fff;border-right:1px solid #e0e0e0}.grp-tabular .grp-table .grp-th:first-of-type,.grp-tabular .grp-table .grp-td:first-of-type{padding-left:10px}.grp-tabular .grp-table .grp-thead{display:table-header-group;color:#aaa;font-size:11px;font-weight:bold}.grp-tabular .grp-table .grp-thead .grp-th,.grp-tabular .grp-table .grp-thead .grp-td{background:none;border-top:0}.grp-tabular .grp-table .grp-thead .grp-th:last-of-type,.grp-tabular .grp-table .grp-thead .grp-td:last-of-type{border-right:0}.grp-tabular .grp-table .grp-tbody{display:table-row-group;margin-top:0}.grp-tabular .grp-table .grp-tbody .grp-th,.grp-tabular .grp-table .grp-tbody .grp-td{padding-bottom:5px;padding-top:5px;border-bottom:1px solid #d4d4d4;border-top:1px solid #d4d4d4;background:#eee}.grp-tabular .grp-table .grp-tbody .grp-th:first-of-type,.grp-tabular .grp-table .grp-tbody .grp-td:first-of-type{border-left:1px solid #d4d4d4}.grp-tabular .grp-table .grp-tbody .grp-th:first-child,.grp-tabular .grp-table .grp-tbody .grp-td:first-child{-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;border-bottom-left-radius:2px}.grp-tabular .grp-table .grp-tbody .grp-th:last-of-type,.grp-tabular .grp-table .grp-tbody .grp-td:last-of-type{border-right:1px solid #d4d4d4;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}.grp-tabular .grp-table .grp-tbody .grp-th.grp-tools-container,.grp-tabular .grp-table .grp-tbody .grp-td.grp-tools-container{padding-left:0;width:100%;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-th,.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-td{border-right-color:#f2d4d4;border-left-color:#faf0f0;background:#f7e4e4}.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-th:first-of-type,.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-td:first-of-type{border-left:1px solid #d4d4d4}.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-th:last-of-type,.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-td:last-of-type{border-right:1px solid #d4d4d4}.grp-tabular .grp-table .grp-tfoot{display:table-footer-group;color:#aaa}.grp-tabular .grp-table .grp-tfoot .grp-td:last-of-type{border-right:0}.grp-tabular .grp-table .grp-module{float:none;clear:none;background:0;border:0}.grp-tabular .grp-module.grp-transparent{margin:2px 0 0}.grp-horizontal-list-container{margin:0;padding:0;border:0;overflow:hidden;*zoom:1}.grp-horizontal-list{margin:0;padding:0;border:0;overflow:hidden;*zoom:1}.grp-horizontal-list li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}.grp-horizontal-list li:first-child,.grp-horizontal-list li.first{padding-left:0}.grp-horizontal-list li:last-child{padding-right:0}.grp-horizontal-list li.last{padding-right:0}.grp-horizontal-list-right>li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:right;padding-left:5px;padding-right:5px}.grp-horizontal-list-right>li:first-child,.grp-horizontal-list-right>li.first{padding-right:0}.grp-horizontal-list-right>li:last-child{padding-left:0}.grp-horizontal-list-right>li.last{padding-left:0}.grp-predelete{background:#f7e4e4}.grp-predelete h2,.grp-collapse.grp-predelete>h2.grp-collapse-handler,.grp-predelete h3,.grp-collapse.grp-predelete>h3.grp-collapse-handler,.grp-predelete h4,.grp-collapse.grp-predelete .grp-collapse>h4.grp-collapse-handler{border-bottom-color:#f0cccc;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y3ZTRlNCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Y0ZDhkOCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f7e4e4), color-stop(100%, #f4d8d8));background-image:-webkit-linear-gradient(#f7e4e4,#f4d8d8);background-image:-moz-linear-gradient(#f7e4e4,#f4d8d8);background-image:-o-linear-gradient(#f7e4e4,#f4d8d8);background-image:linear-gradient(#f7e4e4,#f4d8d8)}.grp-collapse.grp-predelete>h2.grp-collapse-handler:hover,.grp-collapse.grp-predelete>h3.grp-collapse-handler:hover,.grp-predelete .grp-collapse>h4.grp-collapse-handler:hover,.grp-collapse.grp-open.grp-predelete>h2.grp-collapse-handler,.grp-collapse.grp-open.grp-predelete>h3.grp-collapse-handler,.grp-predelete .grp-collapse.grp-open>h4.grp-collapse-handler{border-bottom-color:#f0cccc;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y0ZDhkOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Y3ZTRlNCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f4d8d8), color-stop(100%, #f7e4e4));background-image:-webkit-linear-gradient(#f4d8d8,#f7e4e4);background-image:-moz-linear-gradient(#f4d8d8,#f7e4e4);background-image:-o-linear-gradient(#f4d8d8,#f7e4e4);background-image:linear-gradient(#f4d8d8,#f7e4e4)}.grp-predelete,.grp-predelete .grp-module,.grp-predelete .grp-th,.grp-predelete .grp-td{background:#f7e4e4}.button-state-blue,input[type=button],button,a.fb_show,a.related-lookup,body.tinyMCE input[name="src"]+div a,body.tinyMCE input[name="href"]+div a,a.related-lookup.m2m,.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup,button.ui-datepicker-trigger,button.ui-timepicker-trigger,button.ui-datetime-now,.grp-pulldown-container .grp-pulldown-handler:hover,.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler,.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler:hover{color:#fff;border:1px solid #ccc;background-color:#e1f0f5}.button-state-grey,input[type=button]:hover,button:hover,a.fb_show:hover,a.related-lookup:hover,body.tinyMCE input[name="src"]+div a:hover,body.tinyMCE input[name="href"]+div a:hover,a.related-lookup.m2m:hover,.grp-autocomplete-wrapper-m2m a.related-lookup:hover,.grp-autocomplete-wrapper-fk a.related-lookup:hover,button.ui-datepicker-trigger:hover,button.ui-timepicker-trigger:hover,button.ui-datetime-now:hover,.grp-pulldown-container .grp-pulldown-handler,.grp-pulldown-container .grp-pulldown-content,.grp-pulldown-container .grp-pulldown-content:hover{color:#444;border:1px solid #ccc;background-color:#eee}.button-state-dark-grey{color:#444;border:1px solid #ccc;border-color:#ccc;background-color:#dbdbdb}.button-state-white,a.grp-related-remove,a.grp-related-remove:hover{border:1px solid #ccc;background-color:#fdfdfd}.button-state-red{color:#fff;border:1px solid #ccc;background-color:#bf3030}.button-state-transparent{border:1px solid transparent;background-color:transparent;background-image:none}.grp-button{position:relative;display:inline-block;margin:0;padding:5px;height:28px;font-weight:bold;-webkit-border-radius:5px !important;-moz-border-radius:5px !important;-ms-border-radius:5px !important;-o-border-radius:5px !important;border-radius:5px !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top}@media screen and (-webkit-min-device-pixel-ratio: 0){.grp-button{padding:5px 10px}}input[type="submit"]{position:relative;display:inline-block;margin:0;padding:5px;height:28px;font-weight:bold;-webkit-border-radius:5px !important;-moz-border-radius:5px !important;-ms-border-radius:5px !important;-o-border-radius:5px !important;border-radius:5px !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top;color:#fff;border:1px solid #2b8aab;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzRmYjJkMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMwOWJiZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4fb2d3), color-stop(100%, #309bbf));background-image:-webkit-linear-gradient(#4fb2d3,#309bbf);background-image:-moz-linear-gradient(#4fb2d3,#309bbf);background-image:-o-linear-gradient(#4fb2d3,#309bbf);background-image:linear-gradient(#4fb2d3,#309bbf)}@media screen and (-webkit-min-device-pixel-ratio: 0){input[type="submit"]{padding:5px 10px}}input[type="submit"]:hover,input[type="submit"]:focus{color:#fff;border:1px solid #373737;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzVlNWU1ZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ0NDQ0NCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer input[type="submit"]:hover,.grp-fixed-footer input[type="submit"]:focus{color:#444;border:1px solid #c8c8c8;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button,button.grp-button,input[type=button].grp-button{position:relative;display:inline-block;margin:0;padding:5px;height:28px;font-weight:bold;-webkit-border-radius:5px !important;-moz-border-radius:5px !important;-ms-border-radius:5px !important;-o-border-radius:5px !important;border-radius:5px !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top;color:#fff;border:1px solid #2b8aab;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzRmYjJkMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMwOWJiZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4fb2d3), color-stop(100%, #309bbf));background-image:-webkit-linear-gradient(#4fb2d3,#309bbf);background-image:-moz-linear-gradient(#4fb2d3,#309bbf);background-image:-o-linear-gradient(#4fb2d3,#309bbf);background-image:linear-gradient(#4fb2d3,#309bbf);padding:5px 10px}@media screen and (-webkit-min-device-pixel-ratio: 0){a.grp-button,button.grp-button,input[type=button].grp-button{padding:5px 10px}}a.grp-button:hover,a.grp-button:focus,button.grp-button:hover,button.grp-button:focus,input[type=button].grp-button:hover,input[type=button].grp-button:focus{color:#fff;border:1px solid #373737;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzVlNWU1ZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ0NDQ0NCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button:hover,.grp-fixed-footer a.grp-button:focus,.grp-fixed-footer button.grp-button:hover,.grp-fixed-footer button.grp-button:focus,.grp-fixed-footer input[type=button].grp-button:hover,.grp-fixed-footer input[type=button].grp-button:focus{color:#444;border:1px solid #c8c8c8;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button.grp-delete-link,button.grp-button.grp-delete-link,input[type=button].grp-button.grp-delete-link{color:#fff;border:1px solid #ab2b2b;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2QzNGY0ZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2JmMzAzMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d34f4f), color-stop(100%, #bf3030));background-image:-webkit-linear-gradient(#d34f4f,#bf3030);background-image:-moz-linear-gradient(#d34f4f,#bf3030);background-image:-o-linear-gradient(#d34f4f,#bf3030);background-image:linear-gradient(#d34f4f,#bf3030)}a.grp-button.grp-delete-link:hover,a.grp-button.grp-delete-link:focus,button.grp-button.grp-delete-link:hover,button.grp-button.grp-delete-link:focus,input[type=button].grp-button.grp-delete-link:hover,input[type=button].grp-button.grp-delete-link:focus{color:#fff;border:1px solid #373737;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzVlNWU1ZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ0NDQ0NCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button.grp-delete-link:hover,.grp-fixed-footer a.grp-button.grp-delete-link:focus,.grp-fixed-footer button.grp-button.grp-delete-link:hover,.grp-fixed-footer button.grp-button.grp-delete-link:focus,.grp-fixed-footer input[type=button].grp-button.grp-delete-link:hover,.grp-fixed-footer input[type=button].grp-button.grp-delete-link:focus{color:#444;border:1px solid #c8c8c8;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button.grp-cancel-link,button.grp-button.grp-cancel-link,input[type=button].grp-button.grp-cancel-link{color:#fff;border:1px solid #7b7b7b;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2EyYTJhMiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg4ODg4OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a2a2a2), color-stop(100%, #888888));background-image:-webkit-linear-gradient(#a2a2a2,#888888);background-image:-moz-linear-gradient(#a2a2a2,#888888);background-image:-o-linear-gradient(#a2a2a2,#888888);background-image:linear-gradient(#a2a2a2,#888888)}a.grp-button.grp-cancel-link:hover,a.grp-button.grp-cancel-link:focus,button.grp-button.grp-cancel-link:hover,button.grp-button.grp-cancel-link:focus,input[type=button].grp-button.grp-cancel-link:hover,input[type=button].grp-button.grp-cancel-link:focus{color:#fff;border:1px solid #373737;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzVlNWU1ZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ0NDQ0NCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button.grp-cancel-link:hover,.grp-fixed-footer a.grp-button.grp-cancel-link:focus,.grp-fixed-footer button.grp-button.grp-cancel-link:hover,.grp-fixed-footer button.grp-button.grp-cancel-link:focus,.grp-fixed-footer input[type=button].grp-button.grp-cancel-link:hover,.grp-fixed-footer input[type=button].grp-button.grp-cancel-link:focus{color:#444;border:1px solid #c8c8c8;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button.grp-reset-link,button.grp-button.grp-reset-link,input[type=button].grp-button.grp-reset-link{color:#fff;border:1px solid #7b7b7b;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2EyYTJhMiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg4ODg4OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a2a2a2), color-stop(100%, #888888));background-image:-webkit-linear-gradient(#a2a2a2,#888888);background-image:-moz-linear-gradient(#a2a2a2,#888888);background-image:-o-linear-gradient(#a2a2a2,#888888);background-image:linear-gradient(#a2a2a2,#888888)}a.grp-button.grp-reset-link:hover,a.grp-button.grp-reset-link:focus,button.grp-button.grp-reset-link:hover,button.grp-button.grp-reset-link:focus,input[type=button].grp-button.grp-reset-link:hover,input[type=button].grp-button.grp-reset-link:focus{color:#fff;border:1px solid #373737;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzVlNWU1ZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzQ0NDQ0NCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button.grp-reset-link:hover,.grp-fixed-footer a.grp-button.grp-reset-link:focus,.grp-fixed-footer button.grp-button.grp-reset-link:hover,.grp-fixed-footer button.grp-button.grp-reset-link:focus,.grp-fixed-footer input[type=button].grp-button.grp-reset-link:hover,.grp-fixed-footer input[type=button].grp-button.grp-reset-link:focus{color:#444;border:1px solid #c8c8c8;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}input[type=button],button,a.fb_show,a.related-lookup,body.tinyMCE input[name="src"]+div a,body.tinyMCE input[name="href"]+div a{position:relative;display:inline-block;margin:0 0 0 -25px;padding:0;width:25px;height:25px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top}.grp-placeholder-related-fk,.grp-placeholder-related-m2m,.grp-placeholder-related-generic{position:relative;display:block;top:-24px;margin:0 0 -20px 123px;padding:0;font-weight:bold}table .grp-placeholder-related-fk,table .grp-placeholder-related-m2m,table .grp-placeholder-related-generic{top:-20px;margin-bottom:-25px}.grp-placeholder-related-fk .grp-placeholder-label:first-child,.grp-placeholder-related-m2m .grp-placeholder-label:first-child,.grp-placeholder-related-generic .grp-placeholder-label:first-child{display:inline-block;margin-top:4px}.grp-placeholder-related-fk .grp-placeholder-label:first-child *,.grp-placeholder-related-m2m .grp-placeholder-label:first-child *,.grp-placeholder-related-generic .grp-placeholder-label:first-child *{margin-top:-4px}table .grp-placeholder-related-fk .grp-placeholder-label:first-child,table .grp-placeholder-related-m2m .grp-placeholder-label:first-child,table .grp-placeholder-related-generic .grp-placeholder-label:first-child{margin-top:5px}table .grp-placeholder-related-fk .grp-placeholder-label:first-child *,table .grp-placeholder-related-m2m .grp-placeholder-label:first-child *,table .grp-placeholder-related-generic .grp-placeholder-label:first-child *{margin-top:-5px}.grp-placeholder-related-fk img,.grp-placeholder-related-m2m img,.grp-placeholder-related-generic img{vertical-align:top}.grp-errors .grp-placeholder-related-fk,.grp-errors .grp-placeholder-related-m2m,.grp-errors .grp-placeholder-related-generic{display:none}.grp-placeholder-related-fk .grp-separator:after,.grp-placeholder-related-m2m .grp-separator:after,.grp-placeholder-related-generic .grp-separator:after{content:", "}a.fb_show,a.related-lookup,body.tinyMCE input[name="src"]+div a,body.tinyMCE input[name="href"]+div a{display:inline-block;margin-bottom:-5px;background-position:0 -1707px}a.fb_show:hover,a.fb_show.related-lookup_hover,a.fb_show.related-lookup-hover,a.related-lookup:hover,a.related-lookup.related-lookup_hover,a.related-lookup.related-lookup-hover,body.tinyMCE input[name="src"]+div a:hover,body.tinyMCE input[name="src"]+div a.related-lookup_hover,body.tinyMCE input[name="src"]+div a.related-lookup-hover,body.tinyMCE input[name="href"]+div a:hover,body.tinyMCE input[name="href"]+div a.related-lookup_hover,body.tinyMCE input[name="href"]+div a.related-lookup-hover{background-position:0 -1621px}a.related-lookup+strong{position:relative;top:2px;margin-left:5px}a.related-lookup.m2m,.grp-autocomplete-wrapper-m2m a.related-lookup{background-position:0 -1664px}a.related-lookup.m2m:hover,a.related-lookup.m2m.related-lookup-m2m_hover,a.related-lookup.m2m.related-lookup-m2m-hover,.grp-autocomplete-wrapper-m2m a.related-lookup:hover,.grp-autocomplete-wrapper-m2m a.related-lookup.related-lookup-m2m_hover,.grp-autocomplete-wrapper-m2m a.related-lookup.related-lookup-m2m-hover{background-position:0 -1750px}.grp-autocomplete-wrapper-fk a.related-lookup{background-position:0 -1707px}.grp-autocomplete-wrapper-fk a.related-lookup:hover,.grp-autocomplete-wrapper-fk a.related-lookup.related-lookup_hover,.grp-autocomplete-wrapper-fk a.related-lookup.related-lookup-hover{background-position:0 -1621px}a.grp-related-remove{background-position:0 -597px}a.grp-related-remove:hover,a.grp-related-remove.related-remove_hover,a.grp-related-remove.related-remove-hover{background-position:0 -640px}button.ui-datepicker-trigger{background-position:0 -2172px}button.ui-datepicker-trigger:hover,button.ui-datepicker-trigger.datepicker_hover,button.ui-datepicker-trigger.datepicker-hover{background-position:0 -2085px}button.ui-timepicker-trigger{background-position:0 -1465px}button.ui-timepicker-trigger:hover,button.ui-timepicker-trigger.timepicker_hover,button.ui-timepicker-trigger.timepicker-hover{background-position:0 -1508px}button.ui-timepicker-trigger+button.ui-datetime-now{margin-left:6px !important;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}button.ui-datetime-now{background-position:0 -339px}button.ui-datetime-now:hover,button.ui-datetime-now.datetime-now_hover,button.ui-datetime-now.datetime-now-hover{background-position:0 -468px}.grp-search-button{background-position:0 -1707px;border-color:transparent !important;background-color:transparent !important}.grp-search-button:hover,.grp-search-button.related-lookup_hover,.grp-search-button.related-lookup-hover{background-position:0 -1621px}a.add-another{position:relative;display:inline-block;margin-left:3px;width:18px;height:18px;vertical-align:top;font-size:11px;line-height:16px;background-position:0 -1377px}a.add-another:hover,a.add-another.add-another_hover,a.add-another.add-another-hover{background-position:0 -1421px}.grp-row a.add-another{top:-7px}.grp-row ul.radiolist+a.add-another,.grp-row ul.checkboxlist+a.add-another{top:3px}p.grp-help+*+a.add-another{float:right;top:-20px;margin-bottom:-20px}.grp-td a.add-another{float:none}.grp-td select+a.add-another{top:-6px}.radiolist.inline+a.add-another,.checkboxlist.inline+a.add-another{float:left;margin-left:-20px;margin-right:-10000px}.grp-row.grp-cells ul.radiolist.inline+a.add-another,.grp-row.grp-cells ul.checkboxlist.inline+a.add-another{float:none;margin-right:0}input:focus+button,.vDateField:focus+span a,.vTimeField:focus+span a,input:focus+a.fb_show,input:focus+a.related-lookup,input:focus+*+a.related-lookup,input:focus+a.add-another,.grp-state-focus a.related-lookup,body.tinyMCE input[name="src"]:focus+div a,body.tinyMCE input[name="href"]:focus+div a{border:1px solid #aaa !important}input:focus+.grp-search-button{border-color:transparent !important}.grp-errors input+button,.grp-errors .vDateField+span a,.grp-errors .vTimeField+span a,.grp-errors input+a.fb_show,.grp-errors input+a.related-lookup,.grp-errors input+*+a.related-lookup,.grp-errors input+a.add-another,.grp-errors .grp-state-focus a.related-lookup,.grp-errors a.grp-related-remove,.grp-errors .grp-state-focus a.related-remove{border-color:#bf3030 !important}img[src*="admin/img/icon-unknown"][src$=".gif"],img[src*="admin/img/icon-no"][src$=".gif"],img[src*="admin/img/icon-yes"][src$=".gif"]{position:relative;height:0;width:0;top:0;margin:-2px 0;padding:8px;font-size:0}img[src*="admin/img/icon-unknown"][src$=".gif"]{background-position:0 -1551px}img[src*="admin/img/icon-no"][src$=".gif"]{background-position:0 -1793px}img[src*="admin/img/icon-yes"][src$=".gif"]{background-position:0 -1586px}.grp-object-tools{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;position:relative;float:right;top:-40px;margin:0 0 -40px}.grp-object-tools li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}.grp-object-tools li:first-child,.grp-object-tools li.first{padding-left:0}.grp-object-tools li:last-child{padding-right:0}.grp-object-tools li.last{padding-right:0}.grp-object-tools li a{display:block;padding:4px 15px;font-weight:bold;-webkit-border-radius:30px;-moz-border-radius:30px;-ms-border-radius:30px;-o-border-radius:30px;border-radius:30px;color:#fff;border:1px solid #777;opacity:.5;background:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzk5OTk5OSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg4ODg4OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:-webkit-linear-gradient(#999999,#888888);background:-moz-linear-gradient(#999999,#888888);background:-o-linear-gradient(#999999,#888888);background:linear-gradient(#999999,#888888)}.grp-object-tools li a.grp-state-focus{opacity:1}.grp-object-tools li a:hover{opacity:1 !important;border:1px solid #2987a6 !important;background:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzM2YjBkOSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMwOWJiZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:-webkit-linear-gradient(#36b0d9,#309bbf);background:-moz-linear-gradient(#36b0d9,#309bbf);background:-o-linear-gradient(#36b0d9,#309bbf);background:linear-gradient(#36b0d9,#309bbf)}.grp-object-tools li a.grp-add-link{padding-left:28px;background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzk5OTk5OSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg4ODg4OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-webkit-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-moz-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-o-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,linear-gradient(#999999,#888888)}.grp-object-tools li a.grp-add-link:hover{background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzM2YjBkOSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMwOWJiZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-webkit-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-moz-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,-o-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 0 -989px no-repeat,linear-gradient(#36b0d9,#309bbf)}.grp-object-tools li a.grp-viewsite-link,.grp-object-tools li a[target="_blank"]{padding-left:28px;background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzk5OTk5OSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg4ODg4OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-webkit-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-moz-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-o-linear-gradient(#999999,#888888);background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,linear-gradient(#999999,#888888)}.grp-object-tools li a.grp-viewsite-link:hover,.grp-object-tools li a[target="_blank"]:hover{background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzM2YjBkOSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMwOWJiZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-webkit-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-moz-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,-o-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s0e29227ce9.png') 0 -945px no-repeat,linear-gradient(#36b0d9,#309bbf)}.grp-tools{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;position:relative;float:right;top:-24px;margin:0 0 -24px;padding-right:5px;height:24px;white-space:nowrap}.grp-tools li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:1px;padding-right:1px}.grp-tools li:first-child,.grp-tools li.first{padding-left:0}.grp-tools li:last-child{padding-right:0}.grp-tools li.last{padding-right:0}.grp-tools-container .grp-tools li{float:none !important;display:inline-block}.grp-tools li a,.grp-tools li span{display:block;width:24px;height:24px}.grp-tools li a.grp-icon-text,.grp-tools li a.grp-text,.grp-tools li span.grp-icon-text,.grp-tools li span.grp-text{padding-left:24px;padding-right:6px;width:auto;line-height:24px;color:#444}.grp-tools li a.grp-icon-text:hover,.grp-tools li a.grp-text:hover,.grp-tools li span.grp-icon-text:hover,.grp-tools li span.grp-text:hover{color:#309bbf}.grp-tools li a.grp-text,.grp-tools li span.grp-text{padding-left:8px}.grp-tools li a.grp-add-handler{background-position:0 -2607px}.grp-tools li a.grp-add-handler:hover,.grp-tools li a.grp-add-handler.tools-add-handler_hover,.grp-tools li a.grp-add-handler.tools-add-handler-hover{background-position:0 -3003px}.grp-tools li a.grp-delete-handler{background-position:0 -2915px}.grp-tools li a.grp-delete-handler:hover,.grp-tools li a.grp-delete-handler.tools-delete-handler_hover,.grp-tools li a.grp-delete-handler.tools-delete-handler-hover{background-position:0 -2431px}.grp-predelete .grp-tools li a.grp-delete-handler{background-position:0 -295px}.grp-tools li a.grp-remove-handler{background-position:0 -3047px}.grp-tools li a.grp-remove-handler:hover,.grp-tools li a.grp-remove-handler.tools-remove-handler_hover,.grp-tools li a.grp-remove-handler.tools-remove-handler-hover{background-position:0 -3091px}.grp-tools li a.grp-drag-handler{background-position:0 -2259px}.grp-tools li a.grp-drag-handler:hover,.grp-tools li a.grp-drag-handler.tools-drag-handler_hover,.grp-tools li a.grp-drag-handler.tools-drag-handler-hover{background-position:0 -2739px}.grp-tools li a.grp-viewsite-link{background-position:0 -2303px}.grp-tools li a.grp-viewsite-link:hover,.grp-tools li a.grp-viewsite-link.tools-viewsite-link_hover,.grp-tools li a.grp-viewsite-link.tools-viewsite-link-hover{background-position:0 -2959px}.grp-tools li a.grp-open-handler{background-position:0 -1909px}.grp-tools li a.grp-open-handler:hover,.grp-tools li a.grp-open-handler.tools-open-handler_hover,.grp-tools li a.grp-open-handler.tools-open-handler-hover{background-position:0 -1953px}.grp-tools li a.grp-close-handler{background-position:0 -2215px}.grp-tools li a.grp-close-handler:hover,.grp-tools li a.grp-close-handler.tools-close-handler_hover,.grp-tools li a.grp-close-handler.tools-close-handler-hover{background-position:0 -1997px}.grp-tools li a.grp-arrow-down-handler{background-position:0 -2563px}.grp-tools li a.grp-arrow-down-handler:hover,.grp-tools li a.grp-arrow-down-handler.tools-arrow-down-handler_hover,.grp-tools li a.grp-arrow-down-handler.tools-arrow-down-handler-hover{background-position:0 -2695px}.grp-tools li a.grp-arrow-up-handler{background-position:0 -2827px}.grp-tools li a.grp-arrow-up-handler:hover,.grp-tools li a.grp-arrow-up-handler.tools-arrow-up-handler_hover,.grp-tools li a.grp-arrow-up-handler.tools-arrow-up-handler-hover{background-position:0 -2871px}.grp-tools li a.grp-trash-handler{background-position:0 -2041px}.grp-tools li a.grp-trash-handler:hover,.grp-tools li a.grp-trash-handler.tools-trash-handler_hover,.grp-tools li a.grp-trash-handler.tools-trash-handler-hover{background-position:0 -1865px}.grp-tools li a.grp-trash-list-toggle-handler{background-position:0 -2128px}.grp-tools li a.grp-trash-list-toggle-handler:hover,.grp-tools li a.grp-trash-list-toggle-handler.tools-trash-list-toggle-handler_hover,.grp-tools li a.grp-trash-list-toggle-handler.tools-trash-list-toggle-handler-hover{background-position:0 -2783px}.grp-tools input{position:absolute;top:-30px}.grp-tools span{color:transparent !important;cursor:default !important}.grp-module>h2+.grp-tools{top:-26px;right:1px;margin-bottom:-26px}.grp-module .grp-row>.grp-tools{top:-4px;right:-9px}.grp-module>h3+.grp-tools{top:-25px;margin-bottom:-25px}.grp-module.grp-closed>h3+.grp-tools{top:-24px;margin-bottom:-24px}fieldset.grp-module .grp-row>.grp-tools{top:0}.grp-group>h2+.grp-tools{top:-28px;right:1px;margin-bottom:-28px}.grp-group.grp-closed>h2+.grp-tools{top:-26px;right:1px;margin-bottom:-26px}.grp-group.grp-tabular h2+.grp-tools{top:-27px;right:1px;margin-bottom:-27px}.grp-tools-container .grp-tools{top:0;right:-20px;margin-bottom:0}.grp-module.grp-add-item .grp-tools{top:2px}table{margin:0;padding:0;border-spacing:none;border-collapse:separate;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}table td,table th{vertical-align:text-top;padding:10px;font-size:11px;line-height:15px}table td.nowrap,table th.nowrap{white-space:nowrap}table thead th{vertical-align:top;padding:6px 10px 6px;font-size:11px;line-height:12px;color:#888;white-space:nowrap;border-left:1px solid #ccc;border-bottom:1px solid #ccc;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}table thead th:first-child{border-left:0}table thead th:first-of-type{-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px}table thead th:last-of-type{-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px}table thead th a{display:block;margin:-6px -10px;padding:6px 10px;height:100%;color:#59afcc}table thead th a:hover{color:#444}table tfoot td{vertical-align:top;padding:6px 10px 6px;font-size:11px;line-height:12px;color:#888;white-space:nowrap}table tbody tr td,table tbody tr th{border-bottom:1px solid #e0e0e0;border-left:1px solid #e4e4e4;vertical-align:top}table tbody tr td:first-child,table tbody tr th:first-child{border-left:0 !important}table tbody tr th{font-size:12px;font-weight:bold}table tbody tr.grp-row-even td,table tbody tr.grp-row-even th,table tbody tr.grp-alt td,table tbody tr.grp-alt th{border-left:1px solid #e0e0e0;background:#f4f4f4}table tbody tr.grp-row-odd td,table tbody tr.grp-row-odd th{background:#fff}table tbody tr.grp-selected{background:#ffd}table tbody tr.grp-row-label td{border-bottom:0;color:#666}table tbody tr:last-child td,table tbody tr:last-child th{border-bottom:0}table tbody tr:last-child td:first-child,table tbody tr:last-child th:first-child{-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;border-bottom-left-radius:2px}table tbody tr:last-child td:last-child,table tbody tr:last-child th:last-child{-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}table tbody tr a.related-lookup+strong{top:0}table tbody tr.grp-errors td,table tbody tr.grp-errors th{padding-top:6px;padding-bottom:0}table tbody tr.grp-errors td ul.errorlist,table tbody tr.grp-errors th ul.errorlist{margin:0 0 3px !important}table tfoot td{border-bottom:0;border-top:1px solid #d4d4d4}table tfoot td:first-child{border-left:0}@media screen and (-webkit-min-device-pixel-ratio: 0){table td>a:first-child,table th>a:first-child{position:relative;top:1px}}table td>input[type="checkbox"],table td>input[type="radio"],table th>input[type="checkbox"],table th>input[type="radio"]{margin:0}table td>input[type="file"],table td>input[type="checkbox"],table td>input[type="radio"],table td>select,table td p input[type="text"],table th>input[type="file"],table th>input[type="checkbox"],table th>input[type="radio"],table th>select,table th p input[type="text"]{position:relative;margin-top:-7px !important;margin-bottom:-5px !important}table td>input[type="text"],table td>input[type="password"],table td>input[type="url"],table td>input[type="email"],table td>input[type="number"],table td>select,table td p input[type="text"],table td p input[type="url"],table td p input[type="email"],table td p input[type="number"],table th>input[type="text"],table th>input[type="password"],table th>input[type="url"],table th>input[type="email"],table th>input[type="number"],table th>select,table th p input[type="text"],table th p input[type="url"],table th p input[type="email"],table th p input[type="number"]{vertical-align:top;margin-top:-5px !important;margin-bottom:-5px !important}table td>textarea,table td div.grp-readonly,table th>textarea,table th div.grp-readonly{position:relative;margin:-5px 0 -5px !important}table td ul.radiolist,table td ul.checkboxlist,table th ul.radiolist,table th ul.checkboxlist{margin:-3px 0 -5px}table td ul.radiolist.inline,table td ul.checkboxlist.inline,table th ul.radiolist.inline,table th ul.checkboxlist.inline{margin:-3px 0 -5px;white-space:normal !important;max-width:400px}table td a.fb_show,table td a.related-lookup,table td .ui-datepicker-trigger,table td .ui-timepicker-trigger,table th a.fb_show,table th a.related-lookup,table th .ui-datepicker-trigger,table th .ui-timepicker-trigger{margin:-5px 0 -11px -25px}table td .grp-autocomplete-wrapper-m2m,table td .grp-autocomplete-wrapper-fk,table th .grp-autocomplete-wrapper-m2m,table th .grp-autocomplete-wrapper-fk{margin:-5px 0 !important}table td .grp-autocomplete-wrapper-m2m a.related-lookup,table td .grp-autocomplete-wrapper-fk a.related-lookup,table th .grp-autocomplete-wrapper-m2m a.related-lookup,table th .grp-autocomplete-wrapper-fk a.related-lookup{top:0;margin-top:0}table td a.add-another,table th a.add-another{top:-13px;margin-bottom:-5px}table td ul.radiolist.inline+a.add-another,table td ul.checkboxlist.inline+a.add-another,table th ul.radiolist.inline+a.add-another,table th ul.checkboxlist.inline+a.add-another{top:-5px}table td>ul.errorlist,table th>ul.errorlist{margin:8px 0 -7px !important}table td>ul.errorlist:first-child,table th>ul.errorlist:first-child{margin:-2px 0 8px !important}table.grp-sortable thead th{margin:0;padding:0}table.grp-sortable thead th div.grp-text span{display:block;padding:6px 10px;white-space:nowrap}table.grp-sortable thead th div.grp-text span input[type="checkbox"]{margin:-6px 0 !important}table.grp-sortable thead th.sortable{white-space:nowrap}table.grp-sortable thead th.sortable .grp-text{position:relative;z-index:400;display:block;margin:0;padding:0;white-space:nowrap}table.grp-sortable thead th.sortable .grp-text a{margin:0;padding:6px 10px;display:block}table.grp-sortable thead th.sortable .grp-sortoptions{position:relative;z-index:410;display:block;float:right;clear:right;margin:0 5px 0 0px;width:50px;white-space:nowrap}table.grp-sortable thead th.sortable .grp-sortoptions a{position:relative;float:right;display:inline-block;margin:0;padding:0}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-ascending,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-descending{width:21px;height:24px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove{visibility:hidden;background-position:0 -511px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove:hover,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove.sort-remove_hover,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove.sort-remove-hover{background-position:0 -554px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-ascending{background-position:0 -382px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-descending{background-position:0 -425px}table.grp-sortable thead th.sortable .grp-sortoptions:hover a.grp-sortremove{visibility:visible}table.grp-sortable thead th.sortable .grp-sortoptions span.grp-sortpriority{position:relative;float:right;display:block;padding:6px 0 0;height:16px;font-weight:bold}table.grp-sortable thead th.sortable:hover{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e0e0e0), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#e0e0e0,#eeeeee);background-image:-moz-linear-gradient(#e0e0e0,#eeeeee);background-image:-o-linear-gradient(#e0e0e0,#eeeeee);background-image:linear-gradient(#e0e0e0,#eeeeee)}table.grp-sortable thead th.sortable.sorted.ascending{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e0e0e0), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#e0e0e0,#eeeeee);background-image:-moz-linear-gradient(#e0e0e0,#eeeeee);background-image:-o-linear-gradient(#e0e0e0,#eeeeee);background-image:linear-gradient(#e0e0e0,#eeeeee)}table.grp-sortable thead th.sortable.sorted.ascending:hover{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}table.grp-sortable thead th.sortable.sorted.descending{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}table.grp-sortable thead th.sortable.sorted.descending:hover{background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e0e0e0), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#e0e0e0,#eeeeee);background-image:-moz-linear-gradient(#e0e0e0,#eeeeee);background-image:-o-linear-gradient(#e0e0e0,#eeeeee);background-image:linear-gradient(#e0e0e0,#eeeeee)}table.grp-sortable thead th.sortable.sorted a{color:#444;font-weight:bold}table.grp-sortable thead th.sortable.sorted .grp-text a{padding-right:60px}thead th.optional{font-weight:normal !important}tr.row-label td{margin-top:-1px;padding-top:2px;padding-bottom:0;font-size:9px}table.xfull,table.grp-full-width{width:100%}table.orderable tbody tr td:hover{cursor:move}table.orderable tbody tr td:first-child{padding-left:14px;background-image:url("../images/backgrounds/nav-grabber.gif");background-repeat:repeat-y}table.orderable-initalized .order-cell,body>tr>td.order-cell{display:none}table#grp-change-history{width:100%}table#grp-change-history tbody th{width:160px}table#grp-change-history tbody td,table#grp-change-history tbody th{background:#eee}table.grp-full{width:100%}.grp-module>table.grp-full{border:0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.model-index table th{padding:7px 10px 8px}.grp-pagination ul{margin:0;padding:0;border:0;overflow:hidden;*zoom:1}.grp-pagination ul li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0}.grp-pagination ul li:first-child,.grp-pagination ul li.first{padding-left:0}.grp-pagination ul li:last-child{padding-right:0}.grp-pagination ul li.last{padding-right:0}.grp-pagination ul li{margin-right:1px;border:1px solid #fff;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.grp-pagination ul li a,.grp-pagination ul li span{display:inline-block;padding:4px 8px 4px;min-width:25px;font-size:11px;font-weight:bold;text-align:center;border:1px solid;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.grp-pagination ul li a{color:#59afcc;border-color:#d9d9d9}.grp-pagination ul li a:hover{color:#444;border-color:#bdbdbd;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}.grp-pagination ul li span{color:#444;border-color:#bdbdbd;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2UwZTBlMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}.grp-pagination ul li.grp-results{margin-right:4px}.grp-pagination ul li.grp-separator{border-color:transparent}.grp-pagination ul li.grp-separator span{padding:4px 0;min-width:10px;font-size:14px;border-color:transparent;background:transparent}.grp-pagination ul li.grp-showall{margin-left:4px}.grp-pagination ul li:last-child{clear:right}.grp-date-hierarchy ul{position:relative;float:left;clear:both;font-size:11px;line-height:16px;font-weight:bold}.grp-date-hierarchy ul li{position:relative;float:left}.grp-date-hierarchy ul li a,.grp-date-hierarchy ul li span{padding:2px 5px}.grp-date-hierarchy ul li a.grp-date-hierarchy-back{color:#59afcc;padding-left:10px;background-position:0 -1033px}.grp-date-hierarchy ul li a.grp-date-hierarchy-back:hover,.grp-date-hierarchy ul li a.grp-date-hierarchy-back.date-hierarchy-back_hover,.grp-date-hierarchy ul li a.grp-date-hierarchy-back.date-hierarchy-back-hover{background-position:0 -1076px}.grp-date-hierarchy ul li a.grp-date-hierarchy-back:hover{color:#444}form#grp-changelist-search{margin:1px 0 0;border:1px solid #fff;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px;border-radius:20px}.grp-pulldown-container{position:relative;top:0;width:inherit;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;margin:-1px 0 0}.grp-pulldown-container .grp-pulldown-handler{display:block;margin:0;font-weight:bold;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;cursor:pointer;background-position:100% -2651px;-webkit-background-size:auto !important;color:#309bbf}.grp-pulldown-container .grp-pulldown-handler:hover,.grp-pulldown-container .grp-pulldown-handler.pulldown-handler_hover,.grp-pulldown-container .grp-pulldown-handler.pulldown-handler-hover{background-position:100% -2475px}.grp-pulldown-container .grp-pulldown-handler:hover{color:#444;background-position:100% -2475px}.grp-pulldown-container.grp-pulldown-state-open{z-index:910;float:left;clear:both;-webkit-box-shadow:0 10px 50px #333;-moz-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333}.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler{color:#444;text-shadow:0 1px 0 #fff;-moz-border-radius-bottomleft:0 !important;-webkit-border-bottom-left-radius:0 !important;border-bottom-left-radius:0 !important;-moz-border-radius-bottomright:0 !important;-webkit-border-bottom-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom:1px solid #ccc !important;background-position:100% -2519px}.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler:hover{color:#444;background-position:100% -2519px}.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-content{float:left;clear:both}.grp-pulldown-container .grp-pulldown-content{padding:0;width:100%;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;border-top:1px solid #fff !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#444}.grp-pulldown-container .grp-pulldown-content:hover{color:#444}#grp-filters{position:relative}#grp-filters.grp-module{z-index:800}.grp-filter{position:relative;float:left;clear:both;width:100%;*zoom:1}.grp-filter:not(.grp-module){height:28px}.grp-filter .grp-pulldown-container{border:1px solid #fff}.grp-filter .grp-module:first-child h3{border-top:0}.grp-filter .grp-row label{display:inline-block;font-family:Arial,sans-serif;font-size:11px;line-height:13px;color:#444;display:block;margin:0 0 2px;color:#888;font-weight:bold}.grp-filter .grp-row label.required{font-weight:bold}.grp-filter .grp-row select{width:100% !important;max-width:100% !important}.grp-filter .grp-row a{display:block;margin:-5px -10px;padding:2px 10px;color:#59afcc;font-size:11px}.grp-filter .grp-row a:hover{color:#444}.grp-filter .grp-row.grp-selected a{padding-left:17px;color:#444;background-position:0 0}.grp-filter:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}li.grp-changelist-actions{padding:5px 0 !important;background:transparent !important}li.grp-changelist-actions select{position:relative;float:left;margin:1px 5px 0 0}li.grp-changelist-actions .grp-horizontal-list{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;margin:-1px 0}li.grp-changelist-actions .grp-horizontal-list li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0}li.grp-changelist-actions .grp-horizontal-list li:first-child,li.grp-changelist-actions .grp-horizontal-list li.first{padding-left:0}li.grp-changelist-actions .grp-horizontal-list li:last-child{padding-right:0}li.grp-changelist-actions .grp-horizontal-list li.last{padding-right:0}li.grp-changelist-actions .grp-horizontal-list li{margin-right:4px;border:1px solid #333;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px}li.grp-changelist-actions .grp-horizontal-list .grp-button{padding:5px 10px 4px;height:27px;-webkit-border-radius:3px !important;-moz-border-radius:3px !important;-ms-border-radius:3px !important;-o-border-radius:3px !important;border-radius:3px !important}li.grp-changelist-actions .grp-horizontal-list a{opacity:1 !important;color:#59afcc;font-weight:bold;border:1px solid #111;background:#222}li.grp-changelist-actions .grp-horizontal-list a:hover{color:#fff;border:1px solid #222;background:#555}li.grp-changelist-actions .grp-horizontal-list span{color:#bbb !important;cursor:default !important;border:1px solid #111 !important;background:#222 !important}li.grp-changelist-actions li.grp-all,li.grp-changelist-actions li.grp-question,li.grp-changelist-actions li.grp-clear-selection{display:none}.grp-submit-row.grp-fixed-footer>ul>li.grp-changelist-actions{padding:5px 0 !important}.grp-changelist-results{background:#eee url("../images/backgrounds/changelist-results.png") repeat scroll !important}.grp-result-overflow-scroll .grp-changelist-results{overflow:auto;overflow-y:hidden;-ms-overflow-y:hidden}.grp-result-overflow-scroll .grp-changelist-results table{border-right:0 !important}body.grp-change-list table{margin:-1px !important}body.grp-change-list table tr.grp-selected th,body.grp-change-list table tr.grp-selected td{background:#ffd}body.grp-delete-confirmation ul.grp-nested-list{position:relative;float:left;clear:both;width:100%;margin:-2px 0 2px}body.grp-delete-confirmation ul.grp-nested-list li{font-size:12px;font-weight:normal}body.grp-delete-confirmation ul.grp-nested-list li>ul li>ul{margin-left:6px}body.grp-delete-confirmation ul.grp-nested-list li>ul li>ul>li{margin:5px 0 5px -4px;padding-left:10px;border-left:4px solid #ddd}body.grp-delete-confirmation ul.grp-nested-list li+li{margin-top:5px}body.grp-delete-confirmation ul.grp-nested-list>li{margin-left:0;font-size:14px;font-weight:bold;position:relative;float:left;clear:both;margin:0 0 5px;padding:0;width:100%;border:1px solid #ccc;background:#eee;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-top:2px !important;margin-bottom:0 !important;padding:8px 10px}body.grp-delete-confirmation ul.grp-nested-list>li .grp-module{margin:0;border:0}body.grp-delete-confirmation ul.grp-nested-list>li .grp-module+.grp-module{border-top:1px solid #d9d9d9;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0}body.grp-delete-confirmation ul.grp-nested-list>li+li{margin-top:0}body.grp-delete-confirmation ul.grp-nested-list>li>ul{margin-top:8px;border-top:1px solid #ddd}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li{margin-top:0 !important;padding-top:8px;padding-bottom:8px;font-size:13px;font-weight:bold;border-top:1px solid #fff;border-bottom:1px solid #ddd}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li:last-child{padding-bottom:0;border-bottom:0}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li>ul{margin-top:8px}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li>ul>li{font-weight:bold}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li>ul>li>ul li ul li{color:#888}body.grp-filebrowser table td>a:first-child,body.grp-filebrowser table th>a:first-child{position:relative;top:0}body.grp-filebrowser table td.grp-sorted a,body.grp-filebrowser table th.grp-sorted a{padding-right:30px;color:#444;font-weight:bold}body.grp-filebrowser table td.grp-sorted.grp-ascending a,body.grp-filebrowser table th.grp-sorted.grp-ascending a{background-position:100% -382px}body.grp-filebrowser table td.grp-sorted.grp-descending a,body.grp-filebrowser table th.grp-sorted.grp-descending a{background-position:100% -425px}body.grp-filebrowser table td{padding:10px 10px 8px}body.grp-filebrowser table td ul.grp-actions{position:relative;top:-1px;left:-5px;margin:0 -5px -1px 0}.grp-module.ui-widget{border:none}.ui-widget-content{border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{font-weight:bold}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{font-weight:bold}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{font-weight:bold}.ui-sortable{position:relative;float:left;clear:both;width:100%}.ui-sortable .ui-sortable-helper,.ui-sortable .ui-sortable-placeholder{opacity:.8}.ui-sortable .ui-sortable-helper{margin:0;width:100% !important;height:auto !important;overflow:visible}.ui-sortable .grp-module.ui-sortable-placeholder{border:1px solid #ccc !important;background:transparent url("../images/backgrounds/ui-sortable-placeholder.png") 0 0 repeat scroll !important}.grp-group.grp-stacked .ui-sortable-placeholder{margin:0 0 2px}.grp-group.grp-stacked .ui-sortable-placeholder:first-child{margin-top:0}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-placeholder{overflow:hidden}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-placeholder .grp-th,.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-placeholder .grp-td{padding-top:0 !important;padding-bottom:0 !important;background:transparent !important}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-helper{border-top:0 !important}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-helper .grp-th,.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-helper .grp-td{background:#ffffcc !important}.grp-group.grp-stacked .ui-sortable-helper,.grp-group.grp-stacked .ui-sortable-helper .grp-module,.grp-group.grp-stacked .ui-sortable-helper h2,.grp-group.grp-stacked .ui-sortable-helper h3,.grp-group.grp-stacked .ui-sortable-helper h4,.grp-group.grp-stacked .grp-collapse.grp-predelete.ui-sortable-helper>h3.grp-collapse-handler,.grp-group.grp-stacked .grp-collapse.grp-open.predelete.ui-sortable-helper>h3.grp-collapse-handler,.grp-group.grp-stacked .grp-collapse.grp-predelete.ui-sortable-helper h4.grp-collapse-handler,.grp-group.grp-stacked .grp-collapse.grp-open.grp-predelete.ui-sortable-helper h4.grp-collapse-handler{background:#ffffcc !important}.datetime br{display:none}.datetimeshortcuts{width:40px;position:relative;margin-left:10px}.datetimeshortcuts a{margin-left:0 !important}.ui-datepicker{position:absolute;display:none;margin:-1px 0 0 !important;padding:3px 3px 0;width:auto !important;font-size:12px;border:1px solid #888;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#eee;-webkit-box-shadow:0 10px 50px #333;-moz-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333}.ui-datepicker input,.ui-datepicker select,.ui-datepicker textarea,.ui-datepicker button{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}.ui-datepicker input:focus,.ui-datepicker input.grp-state-focus,.ui-datepicker select:focus,.ui-datepicker select.grp-state-focus,.ui-datepicker textarea:focus,.ui-datepicker textarea.grp-state-focus,.ui-datepicker button:focus,.ui-datepicker button.grp-state-focus{border:1px solid #aaa;-webkit-box-shadow:#ccc 0 0 6px;-moz-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.ui-datepicker .ui-widget-content{background:#eee;color:#222222}.ui-datepicker .ui-widget-content a{color:#444}.ui-datepicker .ui-widget-header{padding:2px 0;height:25px;background:#cccccc;color:#222222;font-weight:bold}.ui-datepicker .ui-widget-header a{color:#444}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0;border:1px solid #bdbdbd}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:4px;width:20px;height:30px;background-color:transparent;background-position:50% 50%;background-repeat:no-repeat;cursor:pointer}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:none}.ui-datepicker .ui-datepicker-prev{left:2px;background-position:0 -1205px}.ui-datepicker .ui-datepicker-prev:hover,.ui-datepicker .ui-datepicker-prev.ui-datepicker-prev_hover,.ui-datepicker .ui-datepicker-prev.ui-datepicker-prev-hover{background-position:0 -1248px}.ui-datepicker .ui-datepicker-next{right:4px;background-position:0 -1291px}.ui-datepicker .ui-datepicker-next:hover,.ui-datepicker .ui-datepicker-next.ui-datepicker-next_hover,.ui-datepicker .ui-datepicker-next.ui-datepicker-next-hover{background-position:0 -1334px}.ui-datepicker .ui-datepicker-prev-hover{left:2px;border:none}.ui-datepicker .ui-datepicker-next-hover{right:4px;border:none}.ui-datepicker .ui-datepicker-title{margin:3px 27px 2px;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{float:left;font-size:1em;margin:-3px 0 -1px !important;padding:4px 3px 4px 2px;min-width:30px;border:1px solid #bbb}.ui-datepicker .ui-datepicker-title select.ui-datepicker-month-year{width:100%}.ui-datepicker .ui-datepicker-title select.ui-datepicker-month,.ui-datepicker .ui-datepicker-title select.ui-datepicker-year{width:49%}.ui-datepicker .ui-datepicker-title select.ui-datepicker-year{float:right}@media screen and (-webkit-min-device-pixel-ratio: 0){.ui-datepicker .ui-datepicker-title select,.ui-datepicker .ui-datepicker-title select:focus{padding:4px 28px 4px 5px;-webkit-appearance:textfield;background-image:url("../images/icons/form-select.png");background-position:100% 50%;background-repeat:no-repeat}}.ui-datepicker table{width:100%;font-size:11px;margin:0 0 2px;border:0}.ui-datepicker table th{padding:5px 0;text-align:center;color:#888;font-weight:bold;border:0;background:transparent}.ui-datepicker table td{min-width:25px;border:0;padding:1px}.ui-datepicker table td span,.ui-datepicker table td a{padding:3px 0 3px;margin:0 !important;text-align:center;display:block;color:#444;font-size:11px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.ui-datepicker table td span.ui-state-default,.ui-datepicker table td a.ui-state-default{color:#444;border-color:#ccc}.ui-datepicker table td span.ui-state-hover,.ui-datepicker table td a.ui-state-hover{color:#fff !important;border-color:transparent !important;background:#444 !important}.ui-datepicker table td span.ui-state-active,.ui-datepicker table td a.ui-state-active{background:#fff}.ui-datepicker table td span.ui-state-highlight,.ui-datepicker table td a.ui-state-highlight{border-color:#bababa;background:#d6d6d6}.ui-datepicker .ui-datepicker-buttonpane{position:relative;float:left;clear:both;background-image:none;width:100%;margin:5px 0 1px;padding:0;border:0}.ui-datepicker .ui-datepicker-buttonpane button{float:left;margin:3px 0;padding:4px 5px 5px;height:25px;color:#aaa;font-size:11px;border:1px solid #c7c7c7;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:transparent;cursor:pointer}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:right;opacity:1 !important;color:#444;font-weight:bold;background:#cee9f2}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current.ui-state-hover{color:#fff !important;border-color:#444 !important;background:#444 !important}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-first .ui-datepicker-title{margin-right:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-first table{margin-right:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title{margin-right:5px !important;margin-left:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-middle table{margin-right:5px !important;margin-left:3px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-title{margin-left:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-last table{margin-left:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-buttonpane{border:none}.ui-datepicker.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-row-break{clear:both;width:100%;font-size:0em}.ui-datepicker-append{margin-left:6px;color:#999;font-size:10px}.ui-datepicker td.ui-state-disabled{padding:1px;text-align:center}.ui-datepicker td.ui-state-disabled span{background:#ccc;color:#555 !important;font-weight:bold;font-size:11px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}button.ui-datepicker-close{float:left !important;margin-right:4px !important}#ui-timepicker{position:absolute;display:none;margin:-1px 0 0 !important;padding:5px 3px 3px 5px;width:216px;font-size:12px;border:1px solid #888;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#eee;-webkit-box-shadow:0 10px 50px #333;-moz-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333}#ui-timepicker input,#ui-timepicker select,#ui-timepicker textarea,#ui-timepicker button{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}#ui-timepicker input:focus,#ui-timepicker input.grp-state-focus,#ui-timepicker select:focus,#ui-timepicker select.grp-state-focus,#ui-timepicker textarea:focus,#ui-timepicker textarea.grp-state-focus,#ui-timepicker button:focus,#ui-timepicker button.grp-state-focus{border:1px solid #aaa;-webkit-box-shadow:#ccc 0 0 6px;-moz-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}#ui-timepicker .ui-widget-content{background:#eee;color:#222222}#ui-timepicker .ui-widget-content a{color:#444}#ui-timepicker .ui-widget-header{padding:2px 0;height:25px;background:#cccccc;color:#222222;font-weight:bold}#ui-timepicker .ui-widget-header a{color:#444}#ui-timepicker ul{position:relative;float:left;clear:both;width:auto}#ui-timepicker ul li.row{position:relative;float:left;display:block;margin:0 2px 2px 0;padding:2px 10px 1px;width:30px;font-size:11px;text-align:center;border:0;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;cursor:pointer}#ui-timepicker ul li.row.ui-state-default{color:#444;border:1px solid #c7c7c7 !important;background:#e1f0f5}#ui-timepicker ul li.row.ui-state-default:hover{color:#fff;border:1px solid #666 !important;background:#444}#ui-timepicker ul li.row.ui-state-active{border:1px solid #bababa !important;background:#d6d6d6}.ui-menu{z-index:1000;display:block;margin:0;padding:2px;list-style:none}.ui-menu li:first-child span{display:block;padding:1px 4px;color:#888;font-weight:bold}.ui-menu li:first-child+li{margin-top:3px}.ui-menu li>span.error{display:block;margin:0;padding:5px 5px 5px;color:#bf3030}.ui-menu li.ui-menu-item{margin:0;padding:0;width:100%}.ui-menu li.ui-menu-item a{display:block;margin:0 !important;padding:3px 4px;color:#444;font-weight:bold !important;border:1px solid #c7c7c7;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;background:#cee9f2;cursor:pointer}.ui-menu li.ui-menu-item a:hover,.ui-menu li.ui-menu-item a.ui-state-hover,.ui-menu li.ui-menu-item a.ui-state-active{color:#fff;border:1px solid #333;background:#444}.ui-menu li.ui-menu-item+li.ui-menu-item{margin-top:2px;border-top:0 !important}.ui-menu .ui-menu{margin-top:-3px}.ui-autocomplete{position:absolute;cursor:default;margin:-1px 0 0 !important;padding:3px;font-size:12px;border:1px solid #888;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#eee;-webkit-box-shadow:0 10px 50px #333;-moz-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.ui-autocomplete input,.ui-autocomplete select,.ui-autocomplete textarea,.ui-autocomplete button{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}.ui-autocomplete input:focus,.ui-autocomplete input.grp-state-focus,.ui-autocomplete select:focus,.ui-autocomplete select.grp-state-focus,.ui-autocomplete textarea:focus,.ui-autocomplete textarea.grp-state-focus,.ui-autocomplete button:focus,.ui-autocomplete button.grp-state-focus{border:1px solid #aaa;-webkit-box-shadow:#ccc 0 0 6px;-moz-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.ui-autocomplete .ui-widget-content{background:#eee;color:#222222}.ui-autocomplete .ui-widget-content a{color:#444}.ui-autocomplete .ui-widget-header{padding:2px 0;height:25px;background:#cccccc;color:#222222;font-weight:bold}.ui-autocomplete .ui-widget-header a{color:#444}* html .ui-autocomplete{width:1px}body{position:relative;float:left;clear:both;overflow:hidden;*zoom:1;padding:0;width:100%;height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;overflow:visible}.grp-column.grp-centered{position:relative;display:block;float:none !important;margin:0 auto !important}.grp-span-fluid{float:none;display:table-cell;width:10000px}body.grp-login #grp-header,body.grp-login #grp-context-navigation,body.grp-login #grp-content-title{display:none}body.grp-login #grp-content{top:140px}body.grp-login .grp-module-login{border:0 !important;-webkit-border-radius:6px;-moz-border-radius:6px;-ms-border-radius:6px;-o-border-radius:6px;border-radius:6px;background:#222 !important}body.grp-login .grp-module-login>.grp-row{padding:10px;border-top:1px solid #333 !important;border-bottom:1px solid #000 !important}body.grp-login .grp-module-login>.grp-row label{color:#fff}body.grp-login .grp-module-login h1{font-size:18px;padding:35px 0 0;border:1px solid #111;border-bottom:0;-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzMzMzMzMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzIyMjIyMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(#333333,#222222);background-image:-moz-linear-gradient(#333333,#222222);background-image:-o-linear-gradient(#333333,#222222);background-image:linear-gradient(#333333,#222222)}body.grp-login .grp-module-login h1 span{display:block;margin:0;color:#eee}body.grp-login .grp-module-login h1 span.grp-admin-title{padding:5px 10px 7px;font-weight:bold}body.grp-login .grp-module-login h1 span.grp-admin-title a{color:#eee}body.grp-login .grp-module-login h1 span.grp-admin-title a:hover{color:#4fb2d3}body.grp-login .grp-module-login h1 span.grp-current-page{margin:0 -1px;padding:5px 11px 4px;border-top:0;border-bottom:0;border-left:1px solid #2c8eaf;border-right:1px solid #2c8eaf;color:#fff;font-size:13px;font-weight:bold;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzRmYjJkMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMwOWJiZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4fb2d3), color-stop(100%, #309bbf));background-image:-webkit-linear-gradient(#4fb2d3,#309bbf);background-image:-moz-linear-gradient(#4fb2d3,#309bbf);background-image:-o-linear-gradient(#4fb2d3,#309bbf);background-image:linear-gradient(#4fb2d3,#309bbf)}body.grp-login .grp-module-login h1+.grp-row{border:0;border-top:1px solid #333}body.grp-login .grp-module-login .grp-module{border:1px solid #ccc;border-top:1px solid #f6f6f6;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0}body.grp-login .grp-module-login .grp-module .grp-row{padding-bottom:12px}body.grp-login .grp-module-login .grp-module .grp-row:first-child{border-top:0}body.grp-login .grp-module-login .grp-module .grp-row.grp-connected{margin-top:-5px;padding-top:0;border-top:1px solid #eee;background:#eee}body.grp-login .grp-module-login .grp-module .grp-row.grp-error-row{margin:0 -1px;padding:0;border-left:1px solid #af2c2c;border-right:1px solid #af2c2c;border-bottom:1px solid #ab2b2b;border-top:1px solid #ce3b3b;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}body.grp-login .grp-module-login .grp-module .grp-row.grp-error-row:first-child{margin-top:-1px;border-top:0;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0}body.grp-login .grp-module-login .grp-module label{margin:0 0 4px}body.grp-login .grp-module-login .grp-module label:first-child{margin-top:-2px}body.grp-login .grp-module-login .grp-module .grp-description{margin:3px 0 -3px;font-size:13px;line-height:15px}body.grp-login .grp-module-login .grp-module ul.errorlist{margin:5px 0 0;padding:0}body.grp-login .grp-module-login .grp-module ul.errorlist:last-child{margin-bottom:-2px}body.grp-login .grp-module-login .grp-module .errornote{margin:0;padding:9px 10px 7px;font-size:13px;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}body.grp-login .grp-module-login .grp-module .errornote+.errornote{margin-top:-3px;padding-top:0}body.grp-login .grp-module.grp-submit-row,body.grp-login .grp-module.grp-submit-row ul{padding:0;border:0;background:transparent}body.grp-login .grp-module.grp-submit-row li,body.grp-login .grp-module.grp-submit-row ul li{float:right;background:transparent}header#grp-header{position:fixed;z-index:1000;float:left;clear:both;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}header#grp-header #grp-navigation{position:relative;float:left;clear:both;width:100%;padding:0 20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#fff;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzMzMzMzMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzIyMjIyMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(#333333,#222222);background-image:-moz-linear-gradient(#333333,#222222);background-image:-o-linear-gradient(#333333,#222222);background-image:linear-gradient(#333333,#222222);overflow:hidden;*zoom:1;overflow:visible}header#grp-header #grp-navigation h1#grp-admin-title{position:relative;float:left;margin:0;padding:10px 0;font-size:12px;line-height:16px}header#grp-header #grp-navigation a{color:#4fb2d3}header#grp-header #grp-navigation a:hover{color:#fff}header#grp-header #grp-navigation ul li.grp-collapse{position:relative;z-index:1000}header#grp-header #grp-navigation ul li.grp-collapse>ul{display:none}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul{position:absolute;z-index:1010;display:block;margin:-1px 0 0 -1px;width:202px;border-top:1px solid #090909;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;background:#222}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul li{border-top:1px solid #3c3c3c;border-bottom:1px solid #090909}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul li:last-child{border-bottom:0}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul li a{display:block;padding:5px 10px}header#grp-header #grp-navigation ul#grp-user-tools{margin:0 -10px 0 0;border-left:1px solid #090909}header#grp-header #grp-navigation ul#grp-user-tools>li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0;border-left:1px solid #343434;border-right:1px solid #090909}header#grp-header #grp-navigation ul#grp-user-tools>li:first-child,header#grp-header #grp-navigation ul#grp-user-tools>li.first{padding-left:0}header#grp-header #grp-navigation ul#grp-user-tools>li:last-child{padding-right:0}header#grp-header #grp-navigation ul#grp-user-tools>li.last{padding-right:0}header#grp-header #grp-navigation ul#grp-user-tools>li.grp-user-options-container{width:200px}header#grp-header #grp-navigation ul#grp-user-tools>li.grp-user-options-container:last-child{margin-right:11px}header#grp-header #grp-navigation ul#grp-user-tools>li:last-child{border-right:0}header#grp-header #grp-navigation ul#grp-user-tools>li a{display:block;padding:10px}header#grp-header #grp-user-tools{position:relative;float:right;font-weight:bold}#grp-content{position:relative;float:left;clear:both;top:80px;padding:0 20px 120px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#grp-context-navigation{position:relative;float:left;clear:both;width:100%;font-weight:bold;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #ccc;background:#eee}#grp-breadcrumbs{float:left}#grp-breadcrumbs>ul{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;padding:5px 20px;text-shadow:0 1px 0 #f5f5f5}#grp-breadcrumbs>ul li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}#grp-breadcrumbs>ul li:first-child,#grp-breadcrumbs>ul li.first{padding-left:0}#grp-breadcrumbs>ul li:last-child{padding-right:0}#grp-breadcrumbs>ul li.last{padding-right:0}#grp-breadcrumbs>ul a{display:block;padding-right:15px;background-position:100% -771px}#grp-breadcrumbs>ul a:hover,#grp-breadcrumbs>ul a.breadcrumbs_hover,#grp-breadcrumbs>ul a.breadcrumbs-hover{background-position:100% -815px}#grp-breadcrumbs>ul a:hover{background-position:100% -815px}#grp-page-tools{float:right;right:20px}#grp-page-tools #grp-toc-handler{display:none}#grp-page-tools #grp-toc-content{display:none}#grp-page-tools ul{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;padding:0 20px;overflow:visible}#grp-page-tools ul li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}#grp-page-tools ul li:first-child,#grp-page-tools ul li.first{padding-left:0}#grp-page-tools ul li:last-child{padding-right:0}#grp-page-tools ul li.last{padding-right:0}#grp-page-tools ul li{position:relative;padding:1px 0 0}#grp-page-tools ul li a{display:block;padding:4px 5px 4px 0}#grp-page-tools ul li a.grp-tool{padding:0;width:18px;height:24px}#grp-page-tools ul li a#grp-open-all{background-position:0 -1909px}#grp-page-tools ul li a#grp-open-all:hover,#grp-page-tools ul li a#grp-open-all.tools-open-handler_hover,#grp-page-tools ul li a#grp-open-all.tools-open-handler-hover{background-position:0 -1953px}#grp-page-tools ul li a#grp-close-all{background-position:0 -2215px}#grp-page-tools ul li a#grp-close-all:hover,#grp-page-tools ul li a#grp-close-all.tools-close-handler_hover,#grp-page-tools ul li a#grp-close-all.tools-close-handler-hover{background-position:0 -1997px}.grp-messagelist{position:relative;float:none;clear:both;padding:0 0 20px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.grp-messagelist li{font-weight:bold;padding:5px 10px;border:1px solid #8ccde2;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#b5deec}.grp-messagelist li.grp-success{border:1px solid #b7e28c;background:#d1ecb5}.grp-messagelist li.grp-warning{border:1px solid #f3d988;background:#f8e8b7}.grp-messagelist li.grp-error{border:1px solid #e7a1a1;background:#ecb5b5}.grp-messagelist li+li{margin-top:2px}.grp-submit-row{padding:0;border:0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background:transparent;min-width:auto}.grp-submit-row>ul{margin-top:10px;overflow:visible}.grp-submit-row>ul>li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:right;padding-left:0;padding-right:0;margin-left:10px;-webkit-border-radius:7px;-moz-border-radius:7px;-ms-border-radius:7px;-o-border-radius:7px;border-radius:7px}.grp-submit-row>ul>li:first-child,.grp-submit-row>ul>li.first{padding-right:0}.grp-submit-row>ul>li:last-child{padding-left:0}.grp-submit-row>ul>li.last{padding-left:0}.grp-submit-row>ul>li.grp-float-left{margin-left:0;margin-right:10px}.grp-submit-row>ul>li input[type=button]{margin:0;width:auto;display:block}.grp-submit-row>ul>li input.grp-button,.grp-submit-row>ul>li a.grp-button,.grp-submit-row>ul>li button.grp-button{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=75);opacity:0.75}.grp-submit-row>ul>li input.grp-button.grp-default,.grp-submit-row>ul>li a.grp-button.grp-default,.grp-submit-row>ul>li button.grp-button.grp-default{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.grp-submit-row>ul>li input.grp-button:hover,.grp-submit-row>ul>li input.grp-button:focus,.grp-submit-row>ul>li a.grp-button:hover,.grp-submit-row>ul>li a.grp-button:focus,.grp-submit-row>ul>li button.grp-button:hover,.grp-submit-row>ul>li button.grp-button:focus{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.grp-submit-row>ul>li button.grp-button{width:auto}.grp-submit-row>ul>li .grp-button{-webkit-box-shadow:0 0 10px #bbb;-moz-box-shadow:0 0 10px #bbb;box-shadow:0 0 10px #bbb}.grp-submit-row.grp-fixed-footer>ul{margin-top:0}.grp-submit-row.grp-fixed-footer>ul>li{margin-bottom:5px;padding:5px !important;background:#444}.grp-submit-row.grp-fixed-footer>ul>li .grp-button{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.grp-fixed-footer{position:fixed;z-index:900;float:left;bottom:0;left:0;margin:0;padding:10px 20px 5px;width:100%;border:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#fff;background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzMzMzMzMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzIyMjIyMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background-size:100%;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(#333333,#222222);background-image:-moz-linear-gradient(#333333,#222222);background-image:-o-linear-gradient(#333333,#222222);background-image:linear-gradient(#333333,#222222)}body.grp-popup #grp-navigation{display:none}body.grp-popup #grp-breadcrumbs{top:0}body.grp-popup #grp-content{top:20px}@media only screen and (max-device-width: 600px) and (max-device-height: 600px){html header#grp-header{position:static;width:100%;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}html #grp-content{top:0;padding-bottom:0}html .grp-fixed-footer{position:static;padding-left:20px;padding-right:20px;width:100%;margin:60px -20px 0 -20px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}} diff --git a/static/grappelli/tinymce/changelog.txt b/static/grappelli/tinymce/changelog.txt new file mode 100644 index 00000000..69b7ae50 --- /dev/null +++ b/static/grappelli/tinymce/changelog.txt @@ -0,0 +1,477 @@ +Version 3.5.8 (2012-11-20) + Fixed bug where html5 data attributes where stripped from contents. + Fixed bug where toolbar was annouced multiple times with JAWS on Firefox. + Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode. + Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty. + Fixed bug with auto detection logic for youtube urls in the media plugin. + Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery. + Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks. + Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element. + Fixed bug where toggling of blockquotes when using br enter mode would produce an exception. + Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level. + Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8. +Version 3.5.7 (2012-09-20) + Changed table row properties dialog to not update multiple rows when row type is header or footer. + Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of -- + Changing toolbars to have a toolbar role for FF keyboard navigation works correctly. + Fixed bug where applying formatting to an empty block element would produce redundant spans. + Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return. + Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors. + Fixed bug where some white space would be removed after inline elements before block elements. + Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents. + Fixed bug where noscript elements would loose it's contents on older IE versions. + Fixed bug where backspace inside empty blockquote wouldn't delete it properly. + Fixed bug where custom elements with . in their names wouldn't work properly. + Fixed bug where the custom_elements option didn't properly setup the block elements schema structure. + Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements. + Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it. + Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents. + Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s. + Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used. + Fixed issue with missing autofocus attribute on input element when using the HTML5 schema. + Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI. +Version 3.5.6 (2012-07-26) + Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents. + Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position. + Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected. + Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio. + Fixed so force_p_newlines option works again since some users want mixed mode paragraphs. + Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor. + Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko. +Version 3.5.5 (2012-07-19) + Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko. + Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas. + Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO. + Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO. + Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell. + Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false. + Fixed bug where scrollbars aren't visible in fullscreen when window is resized. + Fixed bug with updating the border size using the advimage dialog on IE 9. + Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element. + Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE. + Fixed bug where autolink plugin would produce an exception for specific html see bug #5365 + Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format. +Version 3.5.4.1 (2012-06-24) + Fixed issue with Shift+A selecting all contents on Chrome. +Version 3.5.4 (2012-06-21) + Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge. + Added image resizing for WebKit browsers by faking the whole resize behavior. + Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly. + Fixed bug where media plugin wouldn't use placeholder size for the object/video elements. + Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2. + Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded. + Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents. + Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values. +Version 3.5.3 (2012-06-19) + Added missing wbr element to HTML5 schema. + Added new mceToggleFormat command. Enabled you to toggle a specific format on/off. + Fixed bug where undo/redo state didn't update correctly after executing an execCommand call. + Fixed bug where the editor would get auto focused on IE running in quirks mode. + Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block. + Fixed bug where backspace would navigate back when selecting control types on IE. + Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI. + Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed. + Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers. + Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block. + Fixed bug where it wasn't possible to block events using the handle_event_callback option. + Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly. + Fixed bug where keyboard navigation didn't work correctly on split buttons. + Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in. + Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete. + Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE. + Fixed so paragraphs gets created if you press enter inside a form element. +Version 3.5.2 (2012-05-31) + Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats. + Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors. + Changed the default theme to be advanced instead of simple since most users uses the advanced theme. + Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified. + Changed the theme_advanced_toolbar_align default value to "left". + Changed the theme_advanced_toolbar_location default value to "top". + Changed the theme_advanced_statusbar_location default value to "bottom". + Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible. + Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic. + Fixed bug where the border attribute was missing in the HTML5 schema. + Fixed bug where the legacyoutput plugin would use inline styles for font color. + Fixed bug where editing of anchor names wouldn't produce an undo level. + Fixed bug where the table plugin would delete the last empty block element in the editor. + Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row. + Fixed bug with pressing enter in IE while having a select list focused would produce a JS error. + Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu. + Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog. +Version 3.5.1.1 (2012-05-25) + Fixed bug with control creation where plugin specific controls didn't work as expected. +Version 3.5.1 (2012-05-25) + Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney. + Added support for overriding the theme rendering logic by using a custom function. + Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode. + Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty. + Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string. + Fixed bug where named anchors wouldn't work properly when schema was set to HTML5. + Fixed bug where HTML5 datalist options wasn't correctly parsed or indented. + Fixed bug where linking would add anchors around block elements when the HTML5 schema was used. + Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com. + Optimized initialization and reduced rendering flicker by hiding the target element while initializing. +Version 3.5.0.1 (2012-05-10) + Fixed bug where selection normalization logic would break the selections of parent elements using the element path. + Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation. + Fixed bug where the autolink plugin would produce an error on older IE versions when pressing enter. + Fixed bug where old IE versions would throw an error during initialization when the editor was placed in an size restricted div. +Version 3.5 (2012-05-03) + Fixed menu rendering issue if the document was in rtl mode. + Fixed bug where the hide function would throw an error about a missing variable. + Fixed bug where autolink wouldn't convert URLs when hitting enter on IE due to the new enter key logic. + Fixed bug where formatting using shortcuts like ctrl+b wouldn't work properly the first time. + Fixed bug where selection.setContent after a formatter call wouldn't generate formatted contents. + Fixed bug where whitespace would be removed before/after invalid_elements when they where removed. + Fixed bug where updating styles using the theme image dialog in non inline mode on IE9 would produce errors. + Fixed bug where IE 8 would produce an error when using the contextmenu plugin. + Fixed bug where delete/backspace could remove contents of noneditable elements. + Fixed so background color in style preview gets computed from body element if the current style element is transparent. +Version 3.5b3 (2012-03-29) + Added cancel button to colour picker dialog. + Added figure and figcaption to the html5 visualblocks plugin. + Added default alignment options for the figure element. + Fixed bug where empty inline elements within block elements would sometimes produce a br child element. + Fixed bug where urls pointing to the same domain as the current one would cause undefined errors. Patch contributed by Paul Giberson. + Fixed bug where enter inside an editable element inside an non editable element would split the element. + Fixed bug where cut/copy/paste of noneditable elements didn't work. + Fixed bug where backspace would sometimes produce font elements on WebKit. + Fixed bug where WebKit would produce spans out of various inline elements when using backspace. + Fixed bug where IE9 wouldn't properly update image styles when images where resized. + Fixed bug where drag/drop of noneditable elements didn't work correctly. + Fixed bug where applying formatting to all contents wouldn't work correctly when an end point was inside an empty bock. Patch contributed by Jose Luiz. + Fixed bug where IE10 removed the scopeName from the DOM element interface and there for it produced an undefined string in element path. + Fixed bug where the caret would be placed at an incorrect location if you applied block formatting while having the caret at the end of the block. + Fixed bug where applying column changes using the cell dialog would only update the first column. Patch contributed by krzyko. + Fixed bug where the visualblocks plugin would force editor focus if it was turned on by default. + Fixed bug where the tabfocus plugin would tab to iframes these are now ignored. + Fixed bug where format drop down list wouldn't show the currently active format for a parent element. + Fixed bug where paste of plain text in IE 9 would remove the new line characters from text. + Fixed bug where the menu buttons/split button menus wouldn't be opened at the right location on older IE versions. + Fixed bug where Gecko browsers wouldn't properly display the right format when having the selection as specific places. + Fixed bug where shift+enter inside the body when having forced_root_blocks set to false would throw an error. + Fixed bug where the jQuery plugin would break the attr method of jQuery 1.7.2. Patch contributed by Markus Kemmerling. + Fixed so options like content_css accepts and array as well as a comma separated string as input. + Restructured the internal logic to make it more separate from Editor.js. + Updated the Sizzle engine to the latest version. +Version 3.5b2 (2012-03-15) + Rewrote the enter key logic to normalize browser behavior. + Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option. + Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node. + Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls. + Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection. + Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string. + Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default. +Version 3.5b1 (2012-03-08) + Added new event class that is faster and enables support for faking events. + Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema. + Added new schema option and support for the HTML5 schema. + Added new visualblocks plugin that shows html5 blocks with visual borders. + Added new types and selector options to make it easier to create editor instances with different configs. + Added new preview of formatting options in various listboxes. + Added new preview_styles option that enables control over what gets previewed. + Fixed bug where content css would be loaded twice into iframe. + Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed. + Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined. + Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting. + Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing. +Version 3.4.9 (2012-02-23) + Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete. + Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents. + Fixed bug where pressing enter on end of list item with a heading would create a new item with heading. + Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled. + Fixed bug in Gecko where undo wasn't added when focus was lost. + Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line. + Fixed bug where right-click on formatted text in IE selected the entire line. + Fixed bug where text ending with space could not be unformatted in IE. + Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used. + Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts. + Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config. + Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser. + Fixed bug where content css files where loaded twice into the iframe. + Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse. +Version 3.4.8 (2012-02-02) + Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text. + Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked. + Fixed bug where wrong text align buttons are active when multiple block elements are selected. + Fixed bug where selected link not showing in target field of link dialog in some selection cases. + Use settings for remove_trailing_br so this can be turned off instead of hard coding the value. + Fixed bug in IE where the media plugin displayed null text when some values aren't filled in. + Added API method 'onSetAttrib' that fires when the attribute value on a node changes. + Fix font size dropdown value not being updated when text already has a font size in the advanced template. + Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times. + Fixed bug where caret cannot be placed after table if table is at end of document in IE. + Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur. + Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly. + Fixed bug where a stranded bullet point would get created in WebKit. + Fixed bug where selecting text in a blockquote and pressing backspace toggles the style. + Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property. + Fix white space in between spans from being deleted. + Fixed bug where scrollbars where visible in the character map dialog on Gecko. + Fixed issue with missing translation for one of the emoticons. + Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev. + Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout. + Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace. + Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber. + Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu. +Version 3.4.7 (2011-11-03) + Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office. + Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text. + Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row. + Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10. + Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph. + Fix new list items in IE8 not displayed on a new line when list contains nested list items. + Clear formatting in table cell breaks the cell. + Made media type list localisable. + Fix out of memory error when using prototype in media dialog. + Fixed bug where could not add a space in the middle of a th cell. + Fixed bug where adding a bullet between two existing bullets adds an extra one + Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in. + Fixed bug where pressing enter on an empty list item does not outdent properly in FF + Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell + Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox. + Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph. + Fixed bug where deleting part of the link text can cause a link with no destination to be saved. + Fixed bug where css style border widths wasn't handled correctly in table dialog. + Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop. + Fixed bug where scripts with custom script types wasn't properly passed though the editor. + Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled. + Made emoticons dialog use the keyboard naviation. + Added navigation instructions to the symbols dialog. + Added ability to set default values for the media plugin. + Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties. + Fixed bug where the symbols dialog was not accessible. + Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility. + Fixed bug where the advanced color picker wasn't working properly on FF 7. + Fixed issue where the advanced color picker was producing uppercase hex codes. + Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements. + Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit. + Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes. +Version 3.4.6 (2011-09-29) + Fixed bug where list items were being created for empty divs. + Added support in Media plugin for audio media using the embed tag + Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read. + Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers) + Fixed bug where classid attribute was not being checked from embed objects. + Fixed bug in jsrobot tests with intermittently failing. + Fixed bug where anchors wasn't updated properly if you edited them using IE 8. + Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor. + Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them. + Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin. + Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin. + Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin. + Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko. + Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly. + Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers. +Version 3.4.5 (2011-09-06) + Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes. + Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved. + Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats. + Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly. + Fixed bug in WebKit where console messages would be logged when deleting an empty document. + Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list + Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements. + Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases. + Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM. + Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized. + Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control. + Fixed bug where adjacent links would get merged on IE due to bugs in their link command. + Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe. + Fixed bug where floated images in WebKit wouldn't get properly linked. + Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode. + Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P. + Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit. + Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit. + Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7. + Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit. + Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents. + Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text. + Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled. + Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin. + Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped. +Version 3.4.4 (2011-08-04) + Added new html5 audio support. Patch contributed by Ronald M. Clifford. + Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin. + Fixed selection to match visual selection before applying formatting changes. + Fixed browser specific bugs in lists for WebKit and IE. + Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel. + Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser. + Fixed bug where formatting change would be lost after pressing enter. + Fixed bug in WebKit where deleting across blocks would add extra styles. + Fixed bug where moving cursor vertically in tables in WebKit wasn't working. + Fixed bug in IE where deleting would cause error in console. + Fixed bug where the formatter was not applying formats across list elements. + Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed. + Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden. + Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko. + Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements. + Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event. + Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them. + Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog. + Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location. +Version 3.4.3.2 (2011-06-30) + Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit. + Fixed bugs in tests in firefox5 and WebKit. + Fixed bug where selection of table cells would produce an exception on Gecko. + Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden. + Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup. + Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection. + Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes. + Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document. + Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them. + Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed. + Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element. + Fixed performance issue with the noneditable plugin where it would enable/disable controls to often. +Version 3.4.3.1 (2011-06-16) + Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin. + Fixed bug where custom buttons were not being rendered correctly when in high contrast mode. + Added support for iOS 5 that now supporting contentEditable in it's latest beta. + Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output. + Fixed bug where custom_elements option wasn't working properly on IE browsers. + Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements. + Fixed bug where attributes with wasn't properly encoded as XML entities. +Version 3.4.3 (2011-06-09) + Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location. + Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly. + Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8. + Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs. + Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied. + Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page. + Fixed bug where applying a heading style to a list item would cascade style to children list items. + Fixed bug where Editor loses focus when backspacing and changing styles in WebKit. + Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided. + Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari. + Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk. + Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded. + Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ). + Added possibility to change properties of all table cells in a column. + Added external_image_list option to get images list from user-defined variable or function. + Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome. + Fixed bug where table size inputs were to small for values with size units. + Fixed bug where table cell/row size input values were not validated. + Fixed bug where menu item line-height would be set to wrong value by external styles. + Fixed bug where hasUndo() would return wrong answer. + Fixed bug where page title would be set to undefined by fullpage plugin. + Fixed bug where HTML5 video properties were not updated in embedded media settings. + Fixed bug where HTML comment on the first line would cause an error. + Fixed bug where spellchecker menu was positioned incorrectly on IE. + Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list. + Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped. + Fixed bug where numeric entities with leading zeros would produce incorrect decoding. + Fixed bug where hexadecimal entities wasn't properly decoded. + Fixed bug where bookmarks wasn't properly stored/restored on undo/redo. + Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents. + Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements. + Fixed so contentEditable is used for the body of the editor if it's supported. + Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null. + Fixed performance issue with mceInsertCommand and inserting very simple contents. + Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic. + Fixed performance issue with table plugin where it checked for selected cells to often. + Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers. + Fixed bug where Gecko would remove single paragraphs if there where contents before/after it. + Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin. +Version 3.4.2 (2011-04-07) + Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text. + Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz. + Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers. + Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser. + Fixed bug where blocks containing a single anchor element would be treated as empty. + Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed. + Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed. + Fixed bug where image border color/style values were overwritten by advimage plugin. + Fixed bug where setting border in advimage plugin would throw error in IE. + Fixed bug where empty anchors list in link settings wasn't hidden. + Fixed bug where xhtmlextras popups were missing localized popup-size parameters. + Fixed bug where the context menu wouldn't select images on WebKit browsers. + Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior. + Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control. + Fixed bug where contextmenu wasn't disabled on noneditable elements. + Fixed bug where getStyle function would trigger error when called on element without style property. + Fixed bug where editor fail to load if Javascript Compressor was used. + Fixed bug where list-style-type=lower-greek would produce errors in IE<8. + Fixed bug where spellchecker plugin would produce errors on IE6-7. + Fixed bug where theme_advanced_containers configuration option causes error. + Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value. + Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size. + Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog. +Version 3.4.1 (2011-03-24) + Added significantly improved list handling via the new 'lists' plugin. + Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default. + Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color. + Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour. + Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled. + Fixed bug where selection locations on undo/redo didn't work correctly on specific contents. + Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe. + Fixed bug where some ascii numeric entities wasn't properly decoded. + Fixed bug where some non western language codes wasn't properly decoded/encoded. + Fixed bug where undo levels wasn't created when deleting contents on IE. + Fixed bug where the initial undo levels bookmark wasn't updated correctly. + Fixed bug where search/replace wouldn't be scoped to editor instances on IE8. + Fixed bug where IE9 would produce two br elements after block elements when pasting. + Fixed bug where IE would place the caret at an incorrect position after a paste operation. + Fixed bug where a paste operation using the keyboard would add an extra undo level. + Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted. + Fixed bug where the table plugin couldn't correctly handle invalid table structures. + Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin. + Fixed bug where toggle states on some of the list boxes didn't update correctly. + Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10. + Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin. + Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid. + Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme. + Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome. + Fixed bug with references to non-existing images in css of fullpage plugin. + Fixed bug where item could be unselected in spellchecker's language selector. + Fixed bug where some mispelled words could be not highlighted using spellchecker plugin. + Fixed bug where spellchecking would merge some words on IE. + Fixed bug where spellchecker context menu was not always positioned correctly. + Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled. + Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents. + Fixed bug where selecting the whole table would enable table tools for cells and rows. + Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin. + Fixed bug where setting text color in fullpage plugin doesn't work. + Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly. + Fixed bug where black spade suit character was not included in special character selector. + Fixed bug where setting invalid values for table cell size would throw an error in IE. + Fixed bug where spellchecking would remove whitespace characters from PRE block in IE. + Fixed bug where HR was inserted inside P elements instead of splitting them. + Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes. + Fixed bug where bullet lists weren't always detected correctly. + Fixed bug where deleting some paragraphs on IE would cause an exception. + Fixed bug where the json encoder logic wouldn't properly encode \ characters. + Fixed bug where the onChange event would be fired when the editor was first initialized. + Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class. + Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences. + Fixed issue where styles were not included when using the full page plugin. + Fixed issue where drag/drop operations wasn't properly added to the undo levels. + Fixed issue where colors wasn't correctly applied to elements with underline decoration. + Fixed issue where deleting some paragraphs on IE would cause an exception. +Version 3.4 (2011-03-10) + Added accessibility example with various accessibility options contributed by Ephox. + Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin. + Fixed bug where the image.htm had some strange td artifacts probably due to auto merging. + Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method. + Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent. + Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode. + Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode. + Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode. + Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox. + Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme. + Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x. + Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right. + Fixed bug where the formatter would align images when the selection range was collapsed. + Fixed bug where the image button would be active when the selection range was collapsed. + Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic. + Fixed bug where the table cell/row dialogs would produce empty attributes. + Fixed bug where the tfoot wouldn't be added to the top of the table. + Fixed bug where the formatter would merge siblings with white space between them. + Fixed bug where pasting headers and paragraphs would produce an extra paragraph. + Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color. + Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting. + Fixed bug where multiple BR elements at end of block elements where removed. + Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages. + Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode. + Fixed bug where the search/replace plugin wouldn't work correctly on IE 9. + Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox. + Fixed so the values entered in the color picker are forced to hex values. + Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade. + Removed obsolete calls in various plugins to the mceBeginUndoLevel command. diff --git a/static/grappelli/tinymce/examples/accessibility.html b/static/grappelli/tinymce/examples/accessibility.html new file mode 100644 index 00000000..69059403 --- /dev/null +++ b/static/grappelli/tinymce/examples/accessibility.html @@ -0,0 +1,101 @@ + + + +Full featured example + + + + + + + + + +
            +
            +

            Full featured example, with Accessibility settings enabled

            + +

            + This page has got the TinyMCE set up to work with configurations related to accessiblity enabled. + In particular +

              +
            • the content_css is set to false, to ensure that all default browser styles are used,
            • +
            • the browser_preferred_colors dialog option is used to ensure that default css is used for dialogs,
            • +
            • and the detect_highcontrast option has been set to ensure that highcontrast mode in Windows browsers + is detected and the toolbars are displayed in a high contrast mode.
            • +
            +

            + + +
            + +
            + +
            + + +
            +
            + + + + diff --git a/static/grappelli/tinymce/examples/css/content.css b/static/grappelli/tinymce/examples/css/content.css new file mode 100644 index 00000000..a76c38a2 --- /dev/null +++ b/static/grappelli/tinymce/examples/css/content.css @@ -0,0 +1,105 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} + +/* Basic formats */ + +.bold { + font-weight: bold; +} + +.italic { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +/* Global align classes */ + +.left { + text-align: inherit; +} + +.center { + text-align: center; +} + +.right { + text-align: right; +} + +.full { + text-align: justify +} + +/* Image and table specific aligns */ + +img.left, table.left { + float: left; + text-align: inherit; +} + +img.center, table.center { + margin-left: auto; + margin-right: auto; + text-align: inherit; +} + +img.center { + display: block; +} + +img.right, table.right { + float: right; + text-align: inherit; +} diff --git a/static/grappelli/tinymce/examples/css/word.css b/static/grappelli/tinymce/examples/css/word.css new file mode 100644 index 00000000..049a39fb --- /dev/null +++ b/static/grappelli/tinymce/examples/css/word.css @@ -0,0 +1,53 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +p {margin:0; padding:0;} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} diff --git a/static/grappelli/tinymce/examples/custom_formats.html b/static/grappelli/tinymce/examples/custom_formats.html new file mode 100644 index 00000000..ba9d1eb0 --- /dev/null +++ b/static/grappelli/tinymce/examples/custom_formats.html @@ -0,0 +1,111 @@ + + + +Custom formats example + + + + + + + + + +
            +
            +

            Custom formats example

            + +

            + This example shows you how to override the default formats for bold, italic, underline, strikethough and alignment to use classes instead of inline styles. + There are more examples on how to use TinyMCE in the Wiki. +

            + + +
            + +
            + + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
            + + +
            +
            + + + diff --git a/static/grappelli/tinymce/examples/full.html b/static/grappelli/tinymce/examples/full.html new file mode 100644 index 00000000..84b76ca7 --- /dev/null +++ b/static/grappelli/tinymce/examples/full.html @@ -0,0 +1,101 @@ + + + +Full featured example + + + + + + + + + +
            +
            +

            Full featured example

            + +

            + This page shows all available buttons and plugins that are included in the TinyMCE core package. + There are more examples on how to use TinyMCE in the Wiki. +

            + + +
            + +
            + + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
            + + +
            +
            + + + + diff --git a/static/grappelli/tinymce/examples/index.html b/static/grappelli/tinymce/examples/index.html new file mode 100644 index 00000000..6ebfbea5 --- /dev/null +++ b/static/grappelli/tinymce/examples/index.html @@ -0,0 +1,10 @@ + + + + TinyMCE examples + + + + + + diff --git a/static/grappelli/tinymce/examples/lists/image_list.js b/static/grappelli/tinymce/examples/lists/image_list.js new file mode 100644 index 00000000..7ba049a2 --- /dev/null +++ b/static/grappelli/tinymce/examples/lists/image_list.js @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url" +// option is defined in TinyMCE init. + +var tinyMCEImageList = new Array( + // Name, URL + ["Logo 1", "media/logo.jpg"], + ["Logo 2 Over", "media/logo_over.jpg"] +); diff --git a/static/grappelli/tinymce/examples/lists/link_list.js b/static/grappelli/tinymce/examples/lists/link_list.js new file mode 100644 index 00000000..0d464331 --- /dev/null +++ b/static/grappelli/tinymce/examples/lists/link_list.js @@ -0,0 +1,10 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url" +// option is defined in TinyMCE init. + +var tinyMCELinkList = new Array( + // Name, URL + ["Moxiecode", "http://www.moxiecode.com"], + ["Freshmeat", "http://www.freshmeat.com"], + ["Sourceforge", "http://www.sourceforge.com"] +); diff --git a/static/grappelli/tinymce/examples/lists/media_list.js b/static/grappelli/tinymce/examples/lists/media_list.js new file mode 100644 index 00000000..2e049587 --- /dev/null +++ b/static/grappelli/tinymce/examples/lists/media_list.js @@ -0,0 +1,14 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCEMediaList = [ + // Name, URL + ["Some Flash", "media/sample.swf"], + ["Some Quicktime", "media/sample.mov"], + ["Some AVI", "media/sample.avi"], + ["Some RealMedia", "media/sample.rm"], + ["Some Shockwave", "media/sample.dcr"], + ["Some Video", "media/sample.mp4"], + ["Some FLV", "media/sample.flv"] +]; \ No newline at end of file diff --git a/static/grappelli/tinymce/examples/lists/template_list.js b/static/grappelli/tinymce/examples/lists/template_list.js new file mode 100644 index 00000000..e06d3578 --- /dev/null +++ b/static/grappelli/tinymce/examples/lists/template_list.js @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCETemplateList = [ + // Name, URL, Description + ["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."], + ["Layout", "templates/layout1.htm", "HTML Layout."] +]; \ No newline at end of file diff --git a/static/grappelli/tinymce/examples/media/logo.jpg b/static/grappelli/tinymce/examples/media/logo.jpg new file mode 100644 index 00000000..ad535d67 Binary files /dev/null and b/static/grappelli/tinymce/examples/media/logo.jpg differ diff --git a/static/grappelli/tinymce/examples/media/logo_over.jpg b/static/grappelli/tinymce/examples/media/logo_over.jpg new file mode 100644 index 00000000..79fcd884 Binary files /dev/null and b/static/grappelli/tinymce/examples/media/logo_over.jpg differ diff --git a/static/grappelli/tinymce/examples/media/sample.avi b/static/grappelli/tinymce/examples/media/sample.avi new file mode 100644 index 00000000..238bb688 Binary files /dev/null and b/static/grappelli/tinymce/examples/media/sample.avi differ diff --git a/static/grappelli/tinymce/examples/media/sample.dcr b/static/grappelli/tinymce/examples/media/sample.dcr new file mode 100644 index 00000000..353b3ce6 Binary files /dev/null and b/static/grappelli/tinymce/examples/media/sample.dcr differ diff --git a/static/grappelli/tinymce/examples/media/sample.flv b/static/grappelli/tinymce/examples/media/sample.flv new file mode 100644 index 00000000..799d137e Binary files /dev/null and b/static/grappelli/tinymce/examples/media/sample.flv differ diff --git a/static/grappelli/tinymce/examples/media/sample.mov b/static/grappelli/tinymce/examples/media/sample.mov new file mode 100644 index 00000000..9c0a0932 Binary files /dev/null and b/static/grappelli/tinymce/examples/media/sample.mov differ diff --git a/static/grappelli/tinymce/examples/media/sample.ram b/static/grappelli/tinymce/examples/media/sample.ram new file mode 100644 index 00000000..e2ce04cf --- /dev/null +++ b/static/grappelli/tinymce/examples/media/sample.ram @@ -0,0 +1 @@ +http://streaming.uga.edu/samples/ayp_lan.rm \ No newline at end of file diff --git a/static/grappelli/tinymce/examples/media/sample.rm b/static/grappelli/tinymce/examples/media/sample.rm new file mode 100644 index 00000000..8947706e Binary files /dev/null and b/static/grappelli/tinymce/examples/media/sample.rm differ diff --git a/static/grappelli/tinymce/examples/media/sample.swf b/static/grappelli/tinymce/examples/media/sample.swf new file mode 100644 index 00000000..9f5fc4ac Binary files /dev/null and b/static/grappelli/tinymce/examples/media/sample.swf differ diff --git a/static/grappelli/tinymce/examples/menu.html b/static/grappelli/tinymce/examples/menu.html new file mode 100644 index 00000000..e48650ab --- /dev/null +++ b/static/grappelli/tinymce/examples/menu.html @@ -0,0 +1,18 @@ + + + +Menu + + + +

            Examples

            +Full featured +Simple theme +Skin support +Word processor +Custom formats +Accessibility Options + + diff --git a/static/grappelli/tinymce/examples/simple.html b/static/grappelli/tinymce/examples/simple.html new file mode 100644 index 00000000..70720caa --- /dev/null +++ b/static/grappelli/tinymce/examples/simple.html @@ -0,0 +1,47 @@ + + + +Simple theme example + + + + + + + + + +
            +

            Simple theme example

            + +

            + This page shows you the simple theme and it's core functionality you can extend it by changing the code use the advanced theme if you need to configure/add more buttons etc. + There are more examples on how to use TinyMCE in the Wiki. +

            + + + + +
            + + +
            + + + diff --git a/static/grappelli/tinymce/examples/skins.html b/static/grappelli/tinymce/examples/skins.html new file mode 100644 index 00000000..c1508588 --- /dev/null +++ b/static/grappelli/tinymce/examples/skins.html @@ -0,0 +1,216 @@ + + + +Skin support example + + + + + + + + + +
            +

            Skin support example

            + +

            + This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins//ui.css + There are more examples on how to use TinyMCE in the Wiki. +

            + + + + +
            + + + +
            + + + +
            + + + +
            + + +
            + + + diff --git a/static/grappelli/tinymce/examples/templates/layout1.htm b/static/grappelli/tinymce/examples/templates/layout1.htm new file mode 100644 index 00000000..a38df3e6 --- /dev/null +++ b/static/grappelli/tinymce/examples/templates/layout1.htm @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +
            Column 1Column 2
            Username: {$username}Staffid: {$staffid}
            diff --git a/static/grappelli/tinymce/examples/templates/snippet1.htm b/static/grappelli/tinymce/examples/templates/snippet1.htm new file mode 100644 index 00000000..b2520bea --- /dev/null +++ b/static/grappelli/tinymce/examples/templates/snippet1.htm @@ -0,0 +1 @@ +This is just some code. diff --git a/static/grappelli/tinymce/examples/word.html b/static/grappelli/tinymce/examples/word.html new file mode 100644 index 00000000..d827b6fe --- /dev/null +++ b/static/grappelli/tinymce/examples/word.html @@ -0,0 +1,72 @@ + + + +Word processor example + + + + + + + + + +
            +

            Word processor example

            + +

            + This page shows you how to configure TinyMCE to work more like common word processors. + There are more examples on how to use TinyMCE in the Wiki. +

            + + + + +
            + + +
            + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/langs/de.js b/static/grappelli/tinymce/jscripts/tiny_mce/langs/de.js new file mode 100644 index 00000000..14944062 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n({de:{common:{"more_colors":"Weitere Farben","invalid_data":"Fehler: Sie haben ung\u00fcltige Werte eingegeben (rot markiert).","popup_blocked":"Leider hat Ihr Popup-Blocker ein Fenster unterbunden, das f\u00fcr den Betrieb dieses Programms n\u00f6tig ist. Bitte deaktivieren Sie den Popup-Blocker f\u00fcr diese Seite.","clipboard_no_support":"Wird derzeit in Ihrem Browser nicht unterst\u00fctzt. Bitte benutzen Sie stattdessen die Tastenk\u00fcrzel.","clipboard_msg":"Kopieren, Ausschneiden und Einf\u00fcgen sind im Mozilla Firefox nicht m\u00f6glich.\nM\u00f6chten Sie mehr \u00fcber dieses Problem erfahren?","not_set":"- unbestimmt -","class_name":"CSS-Klasse",browse:"Durchsuchen",close:"Schlie\u00dfen",cancel:"Abbrechen",update:"Aktualisieren",insert:"Einf\u00fcgen",apply:"\u00dcbernehmen","edit_confirm":"M\u00f6chten Sie diesen Text jetzt bearbeiten?","invalid_data_number":"{#field} muss eine Zahl sein","invalid_data_min":"{#field} muss eine Zahl gr\u00f6\u00dfer als {#min} sein","invalid_data_size":"{#field} muss eine Zahl oder ein Prozentwert sein",value:"(Wert)"},contextmenu:{full:"Blocksatz",right:"Rechtsb\u00fcndig",center:"Zentriert",left:"Linksb\u00fcndig",align:"Ausrichtung"},insertdatetime:{"day_short":"So,Mo,Di,Mi,Do,Fr,Sa,So","day_long":"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag","months_short":"Jan,Feb,M\u00e4r,Apr,Mai,Juni,Juli,Aug,Sept,Okt,Nov,Dez","months_long":"Januar,Februar,M\u00e4rz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember","inserttime_desc":"Zeit einf\u00fcgen","insertdate_desc":"Datum einf\u00fcgen","time_fmt":"%H:%M:%S","date_fmt":"%d.%m.%Y"},print:{"print_desc":"Drucken"},preview:{"preview_desc":"Vorschau"},directionality:{"rtl_desc":"Schrift von rechts nach links","ltr_desc":"Schrift von links nach rechts"},layer:{content:"Neue Ebene...","absolute_desc":"Absolute Positionierung","backward_desc":"Nach hinten legen","forward_desc":"Nach vorne holen","insertlayer_desc":"Neue Ebene einf\u00fcgen"},save:{"save_desc":"Speichern","cancel_desc":"Alle \u00c4nderungen verwerfen"},nonbreaking:{"nonbreaking_desc":"Gesch\u00fctztes Leerzeichen einf\u00fcgen"},iespell:{download:"ieSpell konnte nicht gefunden werden. Wollen Sie es installieren?","iespell_desc":"Rechtschreibpr\u00fcfung"},advhr:{"advhr_desc":"Trennlinie","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Smilies","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"Suchen/Ersetzen","search_desc":"Suchen","delta_width":"","delta_height":""},advimage:{"image_desc":"Bild einf\u00fcgen/ver\u00e4ndern","delta_width":"","delta_height":""},advlink:{"link_desc":"Link einf\u00fcgen/ver\u00e4ndern","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Attribute einf\u00fcgen/bearbeiten","ins_desc":"Eingef\u00fcgter Text","del_desc":"Entfernter Text","acronym_desc":"Akronym","abbr_desc":"Abk\u00fcrzung","cite_desc":"Quellenangabe","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"CSS-Styles bearbeiten","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Einf\u00fcgemodus ist nun \"Nur Text\". Erneut klicken stellt den Normalmodus wieder her.","plaintext_mode_sticky":"Einf\u00fcgemodus ist nun \"Nur Text\". Erneut klicken (oder das Einf\u00fcgen aus der Zwischenablage) stellt den Normalmodus wieder her.","selectall_desc":"Alles ausw\u00e4hlen","paste_word_desc":"Mit Formatierungen (aus Word) einf\u00fcgen","paste_text_desc":"Als einfachen Text einf\u00fcgen"},"paste_dlg":{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."},table:{"cellprops_delta_width":"150",cell:"Zelle",col:"Spalte",row:"Zeile",del:"Tabelle l\u00f6schen","copy_row_desc":"Zeile kopieren","cut_row_desc":"Zeile ausschneiden","paste_row_after_desc":"Zeile unterhalb aus der Zwischenablage einf\u00fcgen","paste_row_before_desc":"Zeile oberhalb aus der Zwischenablage einf\u00fcgen","props_desc":"Eigenschaften der Tabelle","cell_desc":"Eigenschaften der Zelle","row_desc":"Eigenschaften der Zeile","merge_cells_desc":"Zellen verbinden","split_cells_desc":"Verbundene Zellen trennen","delete_col_desc":"Spalte l\u00f6schen","col_after_desc":"Spalte rechts einf\u00fcgen","col_before_desc":"Spalte links einf\u00fcgen","delete_row_desc":"Zeile l\u00f6schen","row_after_desc":"Zeile unterhalb einf\u00fcgen","row_before_desc":"Zeile oberhalb einf\u00fcgen",desc:"Tabelle erstellen/bearbeiten","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Wenn Sie den Inhalt wiederherstellen, gehen die aktuellen Daten im Editor verloren.\n\nSind sie sicher, dass Sie den Inhalt wiederherstellen m\u00f6chten?","restore_content":"Automatisch gespeicherten Inhalt wiederherstellen.","unload_msg":"Ihre \u00c4nderungen werden verloren gehen, wenn Sie die Seite verlassen."},fullscreen:{desc:"Vollbildschirm"},media:{edit:"Multimediaeinbettung bearbeiten",desc:"Multimedia einbetten/bearbeiten","delta_height":"","delta_width":""},fullpage:{desc:"Dokument-Eigenschaften","delta_width":"","delta_height":""},template:{desc:"Inhalt aus Vorlage einf\u00fcgen"},visualchars:{desc:"Sichtbarkeit der Steuerzeichen an/aus"},spellchecker:{desc:"Rechtschreibpr\u00fcfung an/aus",menu:"Einstellungen der Rechtschreibpr\u00fcfung","ignore_word":"Wort ignorieren","ignore_words":"Alle ignorieren",langs:"Sprachen",wait:"Bitte warten...",sug:"Vorschl\u00e4ge","no_sug":"Keine Vorschl\u00e4ge","no_mpell":"Keine Rechtschreibfehler gefunden.","learn_word":"Zum W\u00f6rterbuch hinzuf\u00fcgen"},pagebreak:{desc:"Seitenumbruch einf\u00fcgen"},advlist:{types:"Typen",def:"Standard","lower_alpha":"a. b. c.","lower_greek":"1. 2. 3.","lower_roman":"i. ii. iii.","upper_alpha":"A. B. C.","upper_roman":"I. II. III.",circle:"Kreis",disc:"Punkt",square:"Quadrat"},colors:{"333300":"Dunkeloliv","993300":"Orange","000000":"Schwarz","003300":"Dunkelgr\u00fcn","003366":"Dunkles himmelblau","000080":"Marineblau","333399":"Indigoblau","333333":"Sehr dunkelgrau","800000":"Kastanienbraun",FF6600:"Orange","808000":"Oliv","008000":"Gr\u00fcn","008080":"Blaugr\u00fcn","0000FF":"Blau","666699":"Graublau","808080":"Grau",FF0000:"Rot",FF9900:"Bernsteinfarben","99CC00":"Gelbgr\u00fcn","339966":"Meergr\u00fcn","33CCCC":"T\u00fcrkis","3366FF":"K\u00f6nigsblau","800080":"Violett","999999":"Mittelgrau",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Gelb","00FF00":"Hellgr\u00fcn","00FFFF":"Aquamarinblau","00CCFF":"Himmelblau","993366":"Braun",C0C0C0:"Silber",FF99CC:"Rosa",FFCC99:"Pfirsichfarben",FFFF99:"Hellgelb",CCFFCC:"Blassgr\u00fcn",CCFFFF:"Blasst\u00fcrkis","99CCFF":"Helles himmelblau",CC99FF:"Pflaumenblau",FFFFFF:"Wei\u00df"},aria:{"rich_text_area":"Rich Text Bereich"},wordcount:{words:"W\u00f6rter: "}}}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/langs/en.js b/static/grappelli/tinymce/jscripts/tiny_mce/langs/en.js new file mode 100644 index 00000000..19324f74 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/license.txt b/static/grappelli/tinymce/jscripts/tiny_mce/license.txt new file mode 100644 index 00000000..60d6d4c8 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/license.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css new file mode 100644 index 00000000..0e228349 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css @@ -0,0 +1,5 @@ +input.radio {border:1px none #000; background:transparent; vertical-align:middle;} +.panel_wrapper div.current {height:80px;} +#width {width:50px; vertical-align:middle;} +#width2 {width:50px; vertical-align:middle;} +#size {width:100px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js new file mode 100644 index 00000000..4d3b062d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js new file mode 100644 index 00000000..0c652d33 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js @@ -0,0 +1,57 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedHRPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvancedHr', function() { + ed.windowManager.open({ + file : url + '/rule.htm', + width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), + height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('advhr', { + title : 'advhr.advhr_desc', + cmd : 'mceAdvancedHr' + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('advhr', n.nodeName == 'HR'); + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'HR') + ed.selection.select(e); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced HR', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js new file mode 100644 index 00000000..b6cbd66c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js @@ -0,0 +1,43 @@ +var AdvHRDialog = { + init : function(ed) { + var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; + + w = dom.getAttrib(n, 'width'); + f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); + f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; + f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); + selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); + }, + + update : function() { + var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; + + h = ' + + + {#advhr.advhr_desc} + + + + + + + +
            + + +
            +
            + + + + + + + + + + + + + +
            + + + +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css new file mode 100644 index 00000000..54dc8439 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css @@ -0,0 +1,12 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js new file mode 100644 index 00000000..d613a613 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js new file mode 100644 index 00000000..d2678cbc --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm new file mode 100644 index 00000000..870af470 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm @@ -0,0 +1,222 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + +
            + +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + {#advimage_dlg.preview} + +
            +
            +
            +
            + {#advimage_dlg.tab_appearance} + +
            +
            +
            +
            + x + px +

            + + +

            +
            +
            +
            + + + +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            + + + + +
             
            +
            +
            + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + +
            + + + + + +
             
            +
            +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif new file mode 100644 index 00000000..53bf6890 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js new file mode 100644 index 00000000..f0b7c6ee --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js @@ -0,0 +1,464 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = isIE ? '0' : '0 none none'; + else { + var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9); + + if (b.length == 3 && b[isOldIE ? 2 : 1]) + bStyle = b[isOldIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isOldIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js new file mode 100644 index 00000000..fc0f6d1e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advimage_dlg',{"image_list":"Bilderliste","align_right":"Rechts","align_left":"Links","align_textbottom":"Unten im Text","align_texttop":"Oben im Text","align_bottom":"Unten","align_middle":"Mittig","align_top":"Oben","align_baseline":"Zeile",align:"Ausrichtung",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",dimensions:"Ausma\u00dfe",border:"Rahmen",list:"Bilderliste",alt:"Beschreibung",src:"Adresse","dialog_title":"Bild einf\u00fcgen/ver\u00e4ndern","missing_alt":"Wollen Sie wirklich keine Beschreibung eingeben? Bestimmte Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnen so nicht darauf zugreifen, ebenso solche, die einen Textbrowser benutzen oder die Anzeige von Bildern deaktiviert haben.","example_img":"Vorschau auf das Aussehen",misc:"Verschiedenes",mouseout:"bei keinem Mauskontakt",mouseover:"bei Mauskontakt","alt_image":"Alternatives Bild","swap_image":"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Rechts nach links",ltr:"Links nach rechts",classes:"Klassen",style:"Format","long_desc":"Ausf\u00fchrliche Beschreibung",langcode:"Sprachcode",langdir:"Schriftrichtung","constrain_proportions":"Seitenverh\u00e4ltnis beibehalten",preview:"Vorschau",title:"Titel",general:"Allgemein","tab_advanced":"Erweitert","tab_appearance":"Aussehen","tab_general":"Allgemein",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js new file mode 100644 index 00000000..5f122e2c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css new file mode 100644 index 00000000..0a6251a6 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css @@ -0,0 +1,13 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +input {width: 280px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js new file mode 100644 index 00000000..d613a613 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js new file mode 100644 index 00000000..d2678cbc --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm new file mode 100644 index 00000000..ed16b3d4 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm @@ -0,0 +1,235 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + + +
            + + +
            +
            +
            + {#advimage_dlg.general} + + + + + + + + + + + + + + + + + + + +
            + +
            + {#advimage_dlg.preview} + +
            +
            + +
            +
            + {#advimage_dlg.tab_appearance} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + {#advimage_dlg.example_img} + Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam + nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum + edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam + erat volutpat. +
            +
            + + x + + px +
              + + + + +
            +
            +
            +
            + +
            +
            + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            + + + + +
             
            +
            + +
            + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + +
            + + + + +
             
            +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif new file mode 100644 index 00000000..53bf6890 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js new file mode 100644 index 00000000..f0b7c6ee --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js @@ -0,0 +1,464 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = isIE ? '0' : '0 none none'; + else { + var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9); + + if (b.length == 3 && b[isOldIE ? 2 : 1]) + bStyle = b[isOldIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isOldIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js new file mode 100644 index 00000000..fc0f6d1e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advimage_dlg',{"image_list":"Bilderliste","align_right":"Rechts","align_left":"Links","align_textbottom":"Unten im Text","align_texttop":"Oben im Text","align_bottom":"Unten","align_middle":"Mittig","align_top":"Oben","align_baseline":"Zeile",align:"Ausrichtung",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",dimensions:"Ausma\u00dfe",border:"Rahmen",list:"Bilderliste",alt:"Beschreibung",src:"Adresse","dialog_title":"Bild einf\u00fcgen/ver\u00e4ndern","missing_alt":"Wollen Sie wirklich keine Beschreibung eingeben? Bestimmte Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnen so nicht darauf zugreifen, ebenso solche, die einen Textbrowser benutzen oder die Anzeige von Bildern deaktiviert haben.","example_img":"Vorschau auf das Aussehen",misc:"Verschiedenes",mouseout:"bei keinem Mauskontakt",mouseover:"bei Mauskontakt","alt_image":"Alternatives Bild","swap_image":"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Rechts nach links",ltr:"Links nach rechts",classes:"Klassen",style:"Format","long_desc":"Ausf\u00fchrliche Beschreibung",langcode:"Sprachcode",langdir:"Schriftrichtung","constrain_proportions":"Seitenverh\u00e4ltnis beibehalten",preview:"Vorschau",title:"Titel",general:"Allgemein","tab_advanced":"Erweitert","tab_appearance":"Aussehen","tab_general":"Allgemein",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js new file mode 100644 index 00000000..5f122e2c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css new file mode 100644 index 00000000..14364316 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css @@ -0,0 +1,8 @@ +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js new file mode 100644 index 00000000..983fe5a9 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js new file mode 100644 index 00000000..14e46a76 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js new file mode 100644 index 00000000..f013aac1 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js @@ -0,0 +1,543 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self"; + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', linkTarget); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', linkTarget, true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i' + name + ''; + + if ((name = nodes[i].id) != "" && !nodes[i].href) + html += ''; + } + + if (html == "") + return ""; + + html = ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js new file mode 100644 index 00000000..bb0d3e35 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advlink_dlg',{"target_name":"Name der Zielseite",classes:"Klassen",style:"Format",id:"ID","popup_position":"Position (X/Y)",langdir:"Schriftrichtung","popup_size":"Gr\u00f6\u00dfe","popup_dependent":"Vom Elternfenster abh\u00e4ngig
            (nur Mozilla/Firefox) ","popup_resizable":"Vergr\u00f6\u00dfern des Fenster zulassen","popup_location":"Adressleiste anzeigen","popup_menubar":"Browsermen\u00fc anzeigen","popup_toolbar":"Werkzeugleisten anzeigen","popup_statusbar":"Statusleiste anzeigen","popup_scrollbars":"Scrollbalken anzeigen","popup_return":"Link trotz Popup folgen","popup_name":"Name des Fensters","popup_url":"Popup-Adresse",popup:"JavaScript-Popup","target_blank":"In neuem Fenster \u00f6ffnen","target_top":"Im obersten Frame \u00f6ffnen (sprengt das Frameset)","target_parent":"Im \u00fcbergeordneten Fenster/Frame \u00f6ffnen","target_same":"Im selben Fenster/Frame \u00f6ffnen","anchor_names":"Anker","popup_opts":"Optionen","advanced_props":"Erweiterte Eigenschaften","event_props":"Ereignisse","popup_props":"Popup-Eigenschaften","general_props":"Allemeine Eigenschaften","advanced_tab":"Erweitert","events_tab":"Ereignisse","popup_tab":"Popup","general_tab":"Allgemein",list:"Linkliste","is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?",titlefield:"Titel",target:"Fenster",url:"Adresse",title:"Link einf\u00fcgen/bearbeiten","link_list":"Linkliste",rtl:"Rechts nach links",ltr:"Links nach rechts",accesskey:"Tastenk\u00fcrzel",tabindex:"Tabindex",rev:"Beziehung des Linkziels zur Seite",rel:"Beziehung der Seite zum Linkziel",mime:"MIME-Type der Zielseite",encoding:"Zeichenkodierung der Zielseite",langcode:"Sprachcode","target_langcode":"Sprache der Zielseite",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js new file mode 100644 index 00000000..3169a565 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm new file mode 100644 index 00000000..cd0b6053 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm @@ -0,0 +1,371 @@ + + + + {#advlink_dlg.title} + + + + + + + + +
            + + +
            +
            +
            + {#advlink_dlg.general_props} +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
             
            +
            +
            +
            +
            +
            +
             
            +
            +
            +
            +
            +
            +
             
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            + + + +
            +
            + {#advlink_dlg.advanced_props} +
            +
            +
            +
            +
            +
            + + + + + + + + + + + + +
            +
            + + +
            +
            + {#advlink_dlg.event_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css new file mode 100644 index 00000000..14364316 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css @@ -0,0 +1,8 @@ +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js new file mode 100644 index 00000000..983fe5a9 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js new file mode 100644 index 00000000..14e46a76 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js new file mode 100644 index 00000000..f013aac1 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js @@ -0,0 +1,543 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self"; + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', linkTarget); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', linkTarget, true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i' + name + ''; + + if ((name = nodes[i].id) != "" && !nodes[i].href) + html += ''; + } + + if (html == "") + return ""; + + html = ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js new file mode 100644 index 00000000..bb0d3e35 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advlink_dlg',{"target_name":"Name der Zielseite",classes:"Klassen",style:"Format",id:"ID","popup_position":"Position (X/Y)",langdir:"Schriftrichtung","popup_size":"Gr\u00f6\u00dfe","popup_dependent":"Vom Elternfenster abh\u00e4ngig
            (nur Mozilla/Firefox) ","popup_resizable":"Vergr\u00f6\u00dfern des Fenster zulassen","popup_location":"Adressleiste anzeigen","popup_menubar":"Browsermen\u00fc anzeigen","popup_toolbar":"Werkzeugleisten anzeigen","popup_statusbar":"Statusleiste anzeigen","popup_scrollbars":"Scrollbalken anzeigen","popup_return":"Link trotz Popup folgen","popup_name":"Name des Fensters","popup_url":"Popup-Adresse",popup:"JavaScript-Popup","target_blank":"In neuem Fenster \u00f6ffnen","target_top":"Im obersten Frame \u00f6ffnen (sprengt das Frameset)","target_parent":"Im \u00fcbergeordneten Fenster/Frame \u00f6ffnen","target_same":"Im selben Fenster/Frame \u00f6ffnen","anchor_names":"Anker","popup_opts":"Optionen","advanced_props":"Erweiterte Eigenschaften","event_props":"Ereignisse","popup_props":"Popup-Eigenschaften","general_props":"Allemeine Eigenschaften","advanced_tab":"Erweitert","events_tab":"Ereignisse","popup_tab":"Popup","general_tab":"Allgemein",list:"Linkliste","is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?",titlefield:"Titel",target:"Fenster",url:"Adresse",title:"Link einf\u00fcgen/bearbeiten","link_list":"Linkliste",rtl:"Rechts nach links",ltr:"Links nach rechts",accesskey:"Tastenk\u00fcrzel",tabindex:"Tabindex",rev:"Beziehung des Linkziels zur Seite",rel:"Beziehung der Seite zum Linkziel",mime:"MIME-Type der Zielseite",encoding:"Zeichenkodierung der Zielseite",langcode:"Sprachcode","target_langcode":"Sprache der Zielseite",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js new file mode 100644 index 00000000..3169a565 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm new file mode 100644 index 00000000..8ab7c2a9 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm @@ -0,0 +1,338 @@ + + + + {#advlink_dlg.title} + + + + + + + + + +
            + + + + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js new file mode 100644 index 00000000..57ecce6e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js new file mode 100644 index 00000000..a8f046b4 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js @@ -0,0 +1,176 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.AdvListPlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + function buildFormats(str) { + var formats = []; + + each(str.split(/,/), function(type) { + formats.push({ + title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), + styles : { + listStyleType : type == 'default' ? '' : type + } + }); + }); + + return formats; + }; + + // Setup number formats from config or default + t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); + t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); + + if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) + t.isIE7 = true; + }, + + createControl: function(name, cm) { + var t = this, btn, format, editor = t.editor; + + if (name == 'numlist' || name == 'bullist') { + // Default to first item if it's a default item + if (t[name][0].title == 'advlist.def') + format = t[name][0]; + + function hasFormat(node, format) { + var state = true; + + each(format.styles, function(value, name) { + // Format doesn't match + if (editor.dom.getStyle(node, name) != value) { + state = false; + return false; + } + }); + + return state; + }; + + function applyListFormat() { + var list, dom = editor.dom, sel = editor.selection; + + // Check for existing list element + list = dom.getParent(sel.getNode(), 'ol,ul'); + + // Switch/add list type if needed + if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) + editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); + + // Append styles to new list element + if (format) { + list = dom.getParent(sel.getNode(), 'ol,ul'); + if (list) { + dom.setStyles(list, format.styles); + list.removeAttribute('data-mce-style'); + } + } + + editor.focus(); + }; + + btn = cm.createSplitButton(name, { + title : 'advanced.' + name + '_desc', + 'class' : 'mce_' + name, + onclick : function() { + applyListFormat(); + } + }); + + btn.onRenderMenu.add(function(btn, menu) { + menu.onHideMenu.add(function() { + if (t.bookmark) { + editor.selection.moveToBookmark(t.bookmark); + t.bookmark = 0; + } + }); + + menu.onShowMenu.add(function() { + var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; + + if (list || format) { + fmtList = t[name]; + + // Unselect existing items + each(menu.items, function(item) { + var state = true; + + item.setSelected(0); + + if (list && !item.isDisabled()) { + each(fmtList, function(fmt) { + if (fmt.id == item.id) { + if (!hasFormat(list, fmt)) { + state = false; + return false; + } + } + }); + + if (state) + item.setSelected(1); + } + }); + + // Select the current format + if (!list) + menu.items[format.id].setSelected(1); + } + + editor.focus(); + + // IE looses it's selection so store it away and restore it later + if (tinymce.isIE) { + t.bookmark = editor.selection.getBookmark(1); + } + }); + + menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1); + + each(t[name], function(item) { + // IE<8 doesn't support lower-greek, skip it + if (t.isIE7 && item.styles.listStyleType == 'lower-greek') + return; + + item.id = editor.dom.uniqueId(); + + menu.add({id : item.id, title : item.title, onclick : function() { + format = item; + applyListFormat(); + }}); + }); + }); + + return btn; + } + }, + + getInfo : function() { + return { + longname : 'Advanced lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js new file mode 100644 index 00000000..71d86bbe --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f>=2?f-2:0);a.setEnd(n,f>=1?f-1:0);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js new file mode 100644 index 00000000..5b61f7a2 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js @@ -0,0 +1,184 @@ +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AutolinkPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + + init : function(ed, url) { + var t = this; + + // Add a key down handler + ed.onKeyDown.addToTop(function(ed, e) { + if (e.keyCode == 13) + return t.handleEnter(ed); + }); + + // Internet Explorer has built-in automatic linking for most cases + if (tinyMCE.isIE) + return; + + ed.onKeyPress.add(function(ed, e) { + if (e.which == 41) + return t.handleEclipse(ed); + }); + + // Add a key up handler + ed.onKeyUp.add(function(ed, e) { + if (e.keyCode == 32) + return t.handleSpacebar(ed); + }); + }, + + handleEclipse : function(ed) { + this.parseCurrentLine(ed, -1, '(', true); + }, + + handleSpacebar : function(ed) { + this.parseCurrentLine(ed, 0, '', true); + }, + + handleEnter : function(ed) { + this.parseCurrentLine(ed, -1, '', false); + }, + + parseCurrentLine : function(ed, end_offset, delimiter, goback) { + var r, end, start, endContainer, bookmark, text, matches, prev, len; + + // We need at least five characters to form a URL, + // hence, at minimum, five characters from the beginning of the line. + r = ed.selection.getRng(true).cloneRange(); + if (r.startOffset < 5) { + // During testing, the caret is placed inbetween two text nodes. + // The previous text node contains the URL. + prev = r.endContainer.previousSibling; + if (prev == null) { + if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null) + return; + + prev = r.endContainer.firstChild.nextSibling; + } + len = prev.length; + r.setStart(prev, len); + r.setEnd(prev, len); + + if (r.endOffset < 5) + return; + + end = r.endOffset; + endContainer = prev; + } else { + endContainer = r.endContainer; + + // Get a text node + if (endContainer.nodeType != 3 && endContainer.firstChild) { + while (endContainer.nodeType != 3 && endContainer.firstChild) + endContainer = endContainer.firstChild; + + // Move range to text node + if (endContainer.nodeType == 3) { + r.setStart(endContainer, 0); + r.setEnd(endContainer, endContainer.nodeValue.length); + } + } + + if (r.endOffset == 1) + end = 2; + else + end = r.endOffset - 1 - end_offset; + } + + start = end; + + do + { + // Move the selection one character backwards. + r.setStart(endContainer, end >= 2 ? end - 2 : 0); + r.setEnd(endContainer, end >= 1 ? end - 1 : 0); + end -= 1; + + // Loop until one of the following is found: a blank space,  , delimeter, (end-2) >= 0 + } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter); + + if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + end += 1; + } else if (r.startOffset == 0) { + r.setStart(endContainer, 0); + r.setEnd(endContainer, start); + } + else { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + } + + // Exclude last . from word like "www.site.com." + var text = r.toString(); + if (text.charAt(text.length - 1) == '.') { + r.setEnd(endContainer, start - 1); + } + + text = r.toString(); + matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i); + + if (matches) { + if (matches[1] == 'www.') { + matches[1] = 'http://www.'; + } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { + matches[1] = 'mailto:' + matches[1]; + } + + bookmark = ed.selection.getBookmark(); + + ed.selection.setRng(r); + tinyMCE.execCommand('createlink',false, matches[1] + matches[2]); + ed.selection.moveToBookmark(bookmark); + ed.nodeChanged(); + + // TODO: Determine if this is still needed. + if (tinyMCE.isWebKit) { + // move the caret to its original position + ed.selection.collapse(false); + var max = Math.min(endContainer.length, start + 1); + r.setStart(endContainer, max); + r.setEnd(endContainer, max); + ed.selection.setRng(r); + } + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Autolink', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js new file mode 100644 index 00000000..46d9dc3d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js new file mode 100644 index 00000000..7673bcff --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js @@ -0,0 +1,119 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + /** + * Auto Resize + * + * This plugin automatically resizes the content area to fit its content height. + * It will retain a minimum height, which is the height of the content area when + * it's initialized. + */ + tinymce.create('tinymce.plugins.AutoResizePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + var t = this, oldSize = 0; + + if (ed.getParam('fullscreen_is_enabled')) + return; + + /** + * This method gets executed each time the editor needs to resize. + */ + function resize() { + var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; + + // Get height differently depending on the browser used + myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight); + + // Don't make it smaller than the minimum height + if (myHeight > t.autoresize_min_height) + resizeHeight = myHeight; + + // If a maximum height has been defined don't exceed this height + if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { + resizeHeight = t.autoresize_max_height; + body.style.overflowY = "auto"; + de.style.overflowY = "auto"; // Old IE + } else { + body.style.overflowY = "hidden"; + de.style.overflowY = "hidden"; // Old IE + body.scrollTop = 0; + } + + // Resize content element + if (resizeHeight !== oldSize) { + deltaSize = resizeHeight - oldSize; + DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); + oldSize = resizeHeight; + + // WebKit doesn't decrease the size of the body element until the iframe gets resized + // So we need to continue to resize the iframe down until the size gets fixed + if (tinymce.isWebKit && deltaSize < 0) + resize(); + } + }; + + t.editor = ed; + + // Define minimum height + t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight)); + + // Define maximum height + t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0)); + + // Add padding at the bottom for better UX + ed.onInit.add(function(ed){ + ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); + }); + + // Add appropriate listeners for resizing content area + ed.onChange.add(resize); + ed.onSetContent.add(resize); + ed.onPaste.add(resize); + ed.onKeyUp.add(resize); + ed.onPostRender.add(resize); + + if (ed.getParam('autoresize_on_init', true)) { + ed.onLoad.add(resize); + ed.onLoadContent.add(resize); + } + + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceAutoResize', resize); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto Resize', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js new file mode 100644 index 00000000..6da98ff3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js @@ -0,0 +1 @@ +(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){if(!i.removed){h.storeDraft();i.nodeChanged()}},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()]*>|]*>/gi, "").length > 0) { + // Show confirm dialog if the editor isn't empty + ed.windowManager.confirm( + PLUGIN_NAME + ".warning_message", + function(ok) { + if (ok) + self.restoreDraft(); + } + ); + } else + self.restoreDraft(); + } + }); + + // Enable/disable restoredraft button depending on if there is a draft stored or not + ed.onNodeChange.add(function() { + var controlManager = ed.controlManager; + + if (controlManager.get(RESTORE_DRAFT)) + controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft()); + }); + + ed.onInit.add(function() { + // Check if the user added the restore button, then setup auto storage logic + if (ed.controlManager.get(RESTORE_DRAFT)) { + // Setup storage engine + self.setupStorage(ed); + + // Auto save contents each interval time + setInterval(function() { + if (!ed.removed) { + self.storeDraft(); + ed.nodeChanged(); + } + }, settings.autosave_interval); + } + }); + + /** + * This event gets fired when a draft is stored to local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onStoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft is restored from local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRestoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft removed/expired. + * + * @event onRemoveDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRemoveDraft = new Dispatcher(self); + + // Add ask before unload dialog only add one unload handler + if (!unloadHandlerAdded) { + window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler; + unloadHandlerAdded = TRUE; + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + /** + * Returns an expiration date UTC string. + * + * @method getExpDate + * @return {String} Expiration date UTC string. + */ + getExpDate : function() { + return new Date( + new Date().getTime() + this.editor.settings.autosave_retention + ).toUTCString(); + }, + + /** + * This method will setup the storage engine. If the browser has support for it. + * + * @method setupStorage + */ + setupStorage : function(ed) { + var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; + + self.key = PLUGIN_NAME + ed.id; + + // Loop though each storage engine type until we find one that works + tinymce.each([ + function() { + // Try HTML5 Local Storage + if (localStorage) { + localStorage.setItem(testKey, testVal); + + if (localStorage.getItem(testKey) === testVal) { + localStorage.removeItem(testKey); + + return localStorage; + } + } + }, + + function() { + // Try HTML5 Session Storage + if (sessionStorage) { + sessionStorage.setItem(testKey, testVal); + + if (sessionStorage.getItem(testKey) === testVal) { + sessionStorage.removeItem(testKey); + + return sessionStorage; + } + } + }, + + function() { + // Try IE userData + if (tinymce.isIE) { + ed.getElement().style.behavior = "url('#default#userData')"; + + // Fake localStorage on old IE + return { + autoExpires : TRUE, + + setItem : function(key, value) { + var userDataElement = ed.getElement(); + + userDataElement.setAttribute(key, value); + userDataElement.expires = self.getExpDate(); + + try { + userDataElement.save("TinyMCE"); + } catch (e) { + // Ignore, saving might fail if "Userdata Persistence" is disabled in IE + } + }, + + getItem : function(key) { + var userDataElement = ed.getElement(); + + try { + userDataElement.load("TinyMCE"); + return userDataElement.getAttribute(key); + } catch (e) { + // Ignore, loading might fail if "Userdata Persistence" is disabled in IE + return null; + } + }, + + removeItem : function(key) { + ed.getElement().removeAttribute(key); + } + }; + } + }, + ], function(setup) { + // Try executing each function to find a suitable storage engine + try { + self.storage = setup(); + + if (self.storage) + return false; + } catch (e) { + // Ignore + } + }); + }, + + /** + * This method will store the current contents in the the storage engine. + * + * @method storeDraft + */ + storeDraft : function() { + var self = this, storage = self.storage, editor = self.editor, expires, content; + + // Is the contents dirty + if (storage) { + // If there is no existing key and the contents hasn't been changed since + // it's original value then there is no point in saving a draft + if (!storage.getItem(self.key) && !editor.isDirty()) + return; + + // Store contents if the contents if longer than the minlength of characters + content = editor.getContent({draft: true}); + if (content.length > editor.settings.autosave_minlength) { + expires = self.getExpDate(); + + // Store expiration date if needed IE userData has auto expire built in + if (!self.storage.autoExpires) + self.storage.setItem(self.key + "_expires", expires); + + self.storage.setItem(self.key, content); + self.onStoreDraft.dispatch(self, { + expires : expires, + content : content + }); + } + } + }, + + /** + * This method will restore the contents from the storage engine back to the editor. + * + * @method restoreDraft + */ + restoreDraft : function() { + var self = this, storage = self.storage, content; + + if (storage) { + content = storage.getItem(self.key); + + if (content) { + self.editor.setContent(content); + self.onRestoreDraft.dispatch(self, { + content : content + }); + } + } + }, + + /** + * This method will return true/false if there is a local storage draft available. + * + * @method hasDraft + * @return {boolean} true/false state if there is a local draft. + */ + hasDraft : function() { + var self = this, storage = self.storage, expDate, exists; + + if (storage) { + // Does the item exist at all + exists = !!storage.getItem(self.key); + if (exists) { + // Storage needs autoexpire + if (!self.storage.autoExpires) { + expDate = new Date(storage.getItem(self.key + "_expires")); + + // Contents hasn't expired + if (new Date().getTime() < expDate.getTime()) + return TRUE; + + // Remove it if it has + self.removeDraft(); + } else + return TRUE; + } + } + + return false; + }, + + /** + * Removes the currently stored draft. + * + * @method removeDraft + */ + removeDraft : function() { + var self = this, storage = self.storage, key = self.key, content; + + if (storage) { + // Get current contents and remove the existing draft + content = storage.getItem(key); + storage.removeItem(key); + storage.removeItem(key + "_expires"); + + // Dispatch remove event if we had any contents + if (content) { + self.onRemoveDraft.dispatch(self, { + content : content + }); + } + } + }, + + "static" : { + // Internal unload handler will be called before the page is unloaded + _beforeUnloadHandler : function(e) { + var msg; + + tinymce.each(tinyMCE.editors, function(ed) { + // Store a draft for each editor instance + if (ed.plugins.autosave) + ed.plugins.autosave.storeDraft(); + + // Never ask in fullscreen mode + if (ed.getParam("fullscreen_is_enabled")) + return; + + // Setup a return message if the editor is dirty + if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload")) + msg = ed.getLang("autosave.unload_msg"); + }); + + return msg; + } + } + }); + + tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave); +})(tinymce); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js new file mode 100644 index 00000000..fce6bd3e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n('en.autosave',{ +restore_content: "Restore auto-saved content", +warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" +}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js new file mode 100644 index 00000000..8f8821fd --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
            /gi,"\n");b(//gi,"\n");b(/
            /gi,"\n");b(/

            /gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
            ");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js new file mode 100644 index 00000000..4e7eb337 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -0,0 +1,120 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.BBCodePlugin', { + init : function(ed, url) { + var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t['_' + dialect + '_bbcode2html'](o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t['_' + dialect + '_bbcode2html'](o.content); + + if (o.get) + o.content = t['_' + dialect + '_html2bbcode'](o.content); + }); + }, + + getInfo : function() { + return { + longname : 'BBCode Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + // HTML -> BBCode in PunBB dialect + _punbb_html2bbcode : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: to [b] + rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); + rep(/(.*?)<\/font>/gi,"$1"); + rep(//gi,"[img]$1[/img]"); + rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); + rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); + rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); + rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); + rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); + rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); + rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); + rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); + rep(/<\/(strong|b)>/gi,"[/b]"); + rep(/<(strong|b)>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)>/gi,"[i]"); + rep(/<\/u>/gi,"[/u]"); + rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); + rep(//gi,"[u]"); + rep(/]*>/gi,"[quote]"); + rep(/<\/blockquote>/gi,"[/quote]"); + rep(/
            /gi,"\n"); + rep(//gi,"\n"); + rep(/
            /gi,"\n"); + rep(/

            /gi,""); + rep(/<\/p>/gi,"\n"); + rep(/ |\u00a0/gi," "); + rep(/"/gi,"\""); + rep(/</gi,"<"); + rep(/>/gi,">"); + rep(/&/gi,"&"); + + return s; + }, + + // BBCode -> HTML from PunBB dialect + _punbb_bbcode2html : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: [b] to + rep(/\n/gi,"
            "); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img\](.*?)\[\/img\]/gi,""); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); + + return s; + } + }); + + // Register plugin + tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100644 index 00000000..2ed042c3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(f){var i=this,g,d,j,e;i.editor=f;d=f.settings.contextmenu_never_use_native;i.onContextMenu=new tinymce.util.Dispatcher(this);e=function(k){h(f,k)};g=f.onContextMenu.add(function(k,l){if((j!==0?j:l.ctrlKey)&&!d){return}a.cancel(l);if(l.target.nodeName=="IMG"){k.selection.select(l.target)}i._getMenu(k).showMenu(l.clientX||l.pageX,l.clientY||l.pageY);a.add(k.getDoc(),"click",e);k.nodeChanged()});f.onRemove.add(function(){if(i._menu){i._menu.removeAll()}});function h(k,l){j=0;if(l&&l.button==2){j=l.ctrlKey;return}if(i._menu){i._menu.removeAll();i._menu.destroy();a.remove(k.getDoc(),"click",e);i._menu=null}}f.onMouseDown.add(h);f.onKeyDown.add(h);f.onKeyDown.add(function(k,l){if(l.shiftKey&&!l.ctrlKey&&!l.altKey&&l.keyCode===121){a.cancel(l);g(k,l)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 00000000..48b0fff9 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,163 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + /** + * This plugin a context menu to TinyMCE editor instances. + * + * @class tinymce.plugins.ContextMenu + */ + tinymce.create('tinymce.plugins.ContextMenu', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @method init + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed) { + var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu; + + t.editor = ed; + + contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; + + /** + * This event gets fired when the context menu is shown. + * + * @event onContextMenu + * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. + * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. + */ + t.onContextMenu = new tinymce.util.Dispatcher(this); + + hideMenu = function(e) { + hide(ed, e); + }; + + showMenu = ed.onContextMenu.add(function(ed, e) { + // Block TinyMCE menu on ctrlKey and work around Safari issue + if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) + return; + + Event.cancel(e); + + // Select the image if it's clicked. WebKit would other wise expand the selection + if (e.target.nodeName == 'IMG') + ed.selection.select(e.target); + + t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); + Event.add(ed.getDoc(), 'click', hideMenu); + + ed.nodeChanged(); + }); + + ed.onRemove.add(function() { + if (t._menu) + t._menu.removeAll(); + }); + + function hide(ed, e) { + realCtrlKey = 0; + + // Since the contextmenu event moves + // the selection we need to store it away + if (e && e.button == 2) { + realCtrlKey = e.ctrlKey; + return; + } + + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hideMenu); + t._menu = null; + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + ed.onKeyDown.add(function(ed, e) { + if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { + Event.cancel(e); + showMenu(ed, e); + } + }); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Contextmenu', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p = DOM.getPos(ed.getContentAreaContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1, + keyboard_focus: true + }); + + t._menu = m; + + m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); + m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); + m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + } + + m.addSeparator(); + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + + m.addSeparator(); + am = m.addMenu({title : 'contextmenu.align'}); + am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); + am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); + am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); + am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + } + }); + + // Register plugin + tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js new file mode 100644 index 00000000..90847e78 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js new file mode 100644 index 00000000..b1340141 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js @@ -0,0 +1,85 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Directionality', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + function setDir(dir) { + var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks(); + + if (blocks.length) { + curDir = dom.getAttrib(blocks[0], "dir"); + + tinymce.each(blocks, function(block) { + // Add dir to block if the parent block doesn't already have that dir + if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { + if (curDir != dir) { + dom.setAttrib(block, "dir", dir); + } else { + dom.setAttrib(block, "dir", null); + } + } + }); + + ed.nodeChanged(); + } + } + + ed.addCommand('mceDirectionLTR', function() { + setDir("ltr"); + }); + + ed.addCommand('mceDirectionRTL', function() { + setDir("rtl"); + }); + + ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); + ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); + + ed.onNodeChange.add(t._nodeChange, t); + }, + + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var dom = ed.dom, dir; + + n = dom.getParent(n, dom.isBlock); + if (!n) { + cm.setDisabled('ltr', 1); + cm.setDisabled('rtl', 1); + return; + } + + dir = dom.getAttrib(n, 'dir'); + cm.setActive('ltr', dir == "ltr"); + cm.setDisabled('ltr', 0); + cm.setActive('rtl', dir == "rtl"); + cm.setDisabled('rtl', 0); + } + }); + + // Register plugin + tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js new file mode 100644 index 00000000..dbdd8ffb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js @@ -0,0 +1 @@ +(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js new file mode 100644 index 00000000..71d54169 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js @@ -0,0 +1,43 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + tinymce.create('tinymce.plugins.EmotionsPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceEmotion', function() { + ed.windowManager.open({ + file : url + '/emotions.htm', + width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), + height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); + }, + + getInfo : function() { + return { + longname : 'Emotions', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); +})(tinymce); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm new file mode 100644 index 00000000..10135565 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm @@ -0,0 +1,42 @@ + + + + {#emotions_dlg.title} + + + + + +

            +
            {#emotions_dlg.title}:

            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            {#emotions_dlg.usage}
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif new file mode 100644 index 00000000..ba90cc36 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif new file mode 100644 index 00000000..74d897a4 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif new file mode 100644 index 00000000..963a96b8 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif new file mode 100644 index 00000000..c7cf1011 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif new file mode 100644 index 00000000..716f55e1 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif new file mode 100644 index 00000000..334d49e0 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif new file mode 100644 index 00000000..4efd549e Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif new file mode 100644 index 00000000..82c5b182 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif new file mode 100644 index 00000000..ca2451e1 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif new file mode 100644 index 00000000..fe66220c Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif new file mode 100644 index 00000000..fd27edfa Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif new file mode 100644 index 00000000..0cc9bb71 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif new file mode 100644 index 00000000..2075dc16 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif new file mode 100644 index 00000000..bef7e257 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif new file mode 100644 index 00000000..0631c761 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif new file mode 100644 index 00000000..648e6e87 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js new file mode 100644 index 00000000..b360f20b --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js @@ -0,0 +1,43 @@ +tinyMCEPopup.requireLangPack(); + +var EmotionsDialog = { + addKeyboardNavigation: function(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table"); + + settings ={ + root: "emoticon_table", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); + }, + init : function(ed) { + tinyMCEPopup.resizeToInnerSize(); + this.addKeyboardNavigation(); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { + src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, + alt : ed.getLang(title), + title : ed.getLang(title), + border : 0 + })); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js new file mode 100644 index 00000000..9ef427cb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.emotions_dlg',{cry:"Weinend",cool:"Cool",desc:"Smilies",title:"Smiley einf\u00fcgen",yell:"Br\u00fcllend",wink:"Zwinkernd",undecided:"Unentschlossen","tongue_out":"Zunge raus",surprised:"\u00dcberrascht",smile:"L\u00e4chelnd",sealed:"Verschlossen","money_mouth":"Geld",laughing:"Lachend",kiss:"K\u00fcssend",innocent:"Unschuldig",frown:"Stirnrunzelnd","foot_in_mouth":"Reingefallen",embarassed:"Verlegen",usage:"Navigation mit linken und rechten Pfeilen."}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js new file mode 100644 index 00000000..037c4b58 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm new file mode 100644 index 00000000..50b2b344 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm @@ -0,0 +1,22 @@ + + + + {#example_dlg.title} + + + + + +
            +

            Here is a example dialog.

            +

            Selected text:

            +

            Custom arg:

            + +
            + + +
            +
            + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js new file mode 100644 index 00000000..ec1f81ea --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js new file mode 100644 index 00000000..9a0e7da1 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js @@ -0,0 +1,84 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('example'); + + tinymce.create('tinymce.plugins.ExamplePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceExample', function() { + ed.windowManager.open({ + file : url + '/dialog.htm', + width : 320 + parseInt(ed.getLang('example.delta_width', 0)), + height : 120 + parseInt(ed.getLang('example.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('example', { + title : 'example.desc', + cmd : 'mceExample', + image : url + '/img/example.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('example', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif new file mode 100644 index 00000000..1ab5da44 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js new file mode 100644 index 00000000..fa834113 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js @@ -0,0 +1,19 @@ +tinyMCEPopup.requireLangPack(); + +var ExampleDialog = { + init : function() { + var f = document.forms[0]; + + // Get the selected contents as text and place it in the input + f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); + f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); + }, + + insert : function() { + // Insert the contents from the input into the document + tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js new file mode 100644 index 00000000..e0784f80 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js new file mode 100644 index 00000000..ebcf948d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js new file mode 100644 index 00000000..0a4551d3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js new file mode 100644 index 00000000..e1c55e41 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + + tinymce.create('tinymce.plugins.ExampleDependencyPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + }, + + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example Dependency plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency', + version : "1.0" + }; + } + }); + + /** + * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order. + * plugins in this list will be initialised when this plugin is initialized. (before the init method is called). + * plugins in a depends list should typically be specified using the short name). If neccesary this can be done + * with an object which has the url to the plugin and the shortname. + */ + tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css new file mode 100644 index 00000000..2675cec1 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css @@ -0,0 +1,143 @@ +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +#doctypes { + width: 200px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + +.panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js new file mode 100644 index 00000000..dcf76024 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype=""}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='\n'}f+=c.getParam("fullpage_default_doctype",'');f+="\n\n\n";if(e=c.getParam("fullpage_default_title")){f+=""+e+"\n"}if(e=c.getParam("fullpage_default_encoding")){f+='\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="\n\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js new file mode 100644 index 00000000..23de7c5a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -0,0 +1,405 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Node = tinymce.html.Node; + + tinymce.create('tinymce.plugins.FullPagePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullPageProperties', function() { + ed.windowManager.open({ + file : url + '/fullpage.htm', + width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), + height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + data : t._htmlToData() + }); + }); + + // Register buttons + ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); + + ed.onBeforeSetContent.add(t._setContent, t); + ed.onGetContent.add(t._getContent, t); + }, + + getInfo : function() { + return { + longname : 'Fullpage', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + _htmlToData : function() { + var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; + + function getAttr(elm, name) { + var value = elm.attr(name); + + return value || ''; + }; + + // Default some values + data.fontface = editor.getParam("fullpage_default_fontface", ""); + data.fontsize = editor.getParam("fullpage_default_fontsize", ""); + + // Parse XML PI + elm = headerFragment.firstChild; + if (elm.type == 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) + data.docencoding = matches[1]; + } + + // Parse doctype + elm = headerFragment.getAll('#doctype')[0]; + if (elm) + data.doctype = '"; + + // Parse title element + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.metatitle = elm.firstChild.value; + } + + // Parse meta elements + each(headerFragment.getAll('meta'), function(meta) { + var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; + + if (name) + data['meta' + name.toLowerCase()] = meta.attr('content'); + else if (httpEquiv == "Content-Type") { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + + if (matches) + data.docencoding = matches[1]; + } + }); + + // Parse html attribs + elm = headerFragment.getAll('html')[0]; + if (elm) + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + + // Parse stylesheet + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') + data.stylesheet = elm.attr('href'); + + // Parse body parts + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); + } + + return data; + }, + + _dataToHtml : function(data) { + var headerFragment, headElement, html, elm, value, dom = this.editor.dom; + + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + }; + + function addHeadNode(node) { + if (headElement.firstChild) + headElement.insert(node, headElement.firstChild); + else + headElement.append(node); + }; + + headerFragment = this._parseHeader(); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new Node('head', 1); + + if (elm.firstChild) + elm.insert(headElement, elm.firstChild, true); + else + elm.append(headElement); + } + + // Add/update/remove XML-PI + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + + if (data.docencoding) + value += ' encoding="' + data.docencoding + '"'; + + if (elm.type != 7) { + elm = new Node('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + + elm.value = value; + } else if (elm && elm.type == 7) + elm.remove(); + + // Add/update/remove doctype + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new Node('#doctype', 10); + + if (data.xml_pi) + headerFragment.insert(elm, headerFragment.firstChild); + else + addHeadNode(elm); + } + + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) + elm.remove(); + + // Add/update/remove title + elm = headerFragment.getAll('title')[0]; + if (data.metatitle) { + if (!elm) { + elm = new Node('title', 1); + elm.append(new Node('#text', 3)).value = data.metatitle; + addHeadNode(elm); + } + } + + // Add meta encoding + if (data.docencoding) { + elm = null; + each(headerFragment.getAll('meta'), function(meta) { + if (meta.attr('http-equiv') == 'Content-Type') + elm = meta; + }); + + if (!elm) { + elm = new Node('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + + elm.attr('content', 'text/html; charset=' + data.docencoding); + } + + // Add/update/remove meta + each('keywords,description,author,copyright,robots'.split(','), function(name) { + var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; + + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + + if (meta.attr('name') == name) { + if (value) + meta.attr('content', value); + else + meta.remove(); + + return; + } + } + + if (value) { + elm = new Node('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + + addHeadNode(elm); + } + }); + + // Add/update/delete link + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') { + if (data.stylesheet) + elm.attr('href', data.stylesheet); + else + elm.remove(); + } else if (data.stylesheet) { + elm = new Node('link', 1); + elm.attr({ + rel : 'stylesheet', + text : 'text/css', + href : data.stylesheet + }); + elm.shortEnded = true; + + addHeadNode(elm); + } + + // Update body attributes + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + + // Update iframe body as well + dom.setAttribs(this.editor.getBody(), { + style : data.style, + dir : data.dir, + vLink : data.visited_color, + link : data.link_color, + aLink : data.active_color + }); + } + + // Set html attributes + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + + // Serialize header fragment and crop away body part + html = new tinymce.html.Serializer({ + validate: false, + indent: true, + apply_source_formatting : true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + + this.head = html.substring(0, html.indexOf('')); + }, + + _parseHeader : function() { + // Parse the contents with a DOM parser + return new tinymce.html.DomParser({ + validate: false, + root_name: '#document' + }).parse(this.head); + }, + + _setContent : function(ed, o) { + var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; + + function low(s) { + return s.replace(/<\/?[A-Z]+/g, function(a) { + return a.toLowerCase(); + }) + }; + + // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate + if (o.format == 'raw' && self.head) + return; + + if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) + return; + + // Parse out head, body and footer + content = content.replace(/<(\/?)BODY/gi, '<$1body'); + startPos = content.indexOf('', startPos); + self.head = low(content.substring(0, startPos + 1)); + + endPos = content.indexOf('\n'; + + header += editor.getParam('fullpage_default_doctype', ''); + header += '\n\n\n'; + + if (value = editor.getParam('fullpage_default_title')) + header += '' + value + '\n'; + + if (value = editor.getParam('fullpage_default_encoding')) + header += '\n'; + + if (value = editor.getParam('fullpage_default_font_family')) + styles += 'font-family: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_font_size')) + styles += 'font-size: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_text_color')) + styles += 'color: ' + value + ';'; + + header += '\n\n'; + + return header; + }, + + _getContent : function(ed, o) { + var self = this; + + if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) + o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); + } + }); + + // Register plugin + tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm new file mode 100644 index 00000000..14ab8652 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm @@ -0,0 +1,259 @@ + + + + {#fullpage_dlg.title} + + + + + + + +
            + + +
            +
            +
            + {#fullpage_dlg.meta_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
             
             
             
             
             
              + +
            +
            + +
            + {#fullpage_dlg.langprops} + + + + + + + + + + + + + + + + + + + + + + +
            + +
              + +
             
            + +
             
            +
            +
            + +
            +
            + {#fullpage_dlg.appearance_textprops} + + + + + + + + + + + + + + + + +
            + +
            + +
            + + + + + +
             
            +
            +
            + +
            + {#fullpage_dlg.appearance_bgprops} + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            +
            + +
            + {#fullpage_dlg.appearance_marginprops} + + + + + + + + + + + + + + +
            +
            + +
            + {#fullpage_dlg.appearance_linkprops} + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
             
            +
            + + + + + +
             
            +
              
            +
            + +
            + {#fullpage_dlg.appearance_style} + + + + + + + + + + +
            + + + + +
             
            +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js new file mode 100644 index 00000000..3f672ad3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js @@ -0,0 +1,232 @@ +/** + * fullpage.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinyMCEPopup.requireLangPack(); + + var defaultDocTypes = + 'XHTML 1.0 Transitional=,' + + 'XHTML 1.0 Frameset=,' + + 'XHTML 1.0 Strict=,' + + 'XHTML 1.1=,' + + 'HTML 4.01 Transitional=,' + + 'HTML 4.01 Strict=,' + + 'HTML 4.01 Frameset='; + + var defaultEncodings = + 'Western european (iso-8859-1)=iso-8859-1,' + + 'Central European (iso-8859-2)=iso-8859-2,' + + 'Unicode (UTF-8)=utf-8,' + + 'Chinese traditional (Big5)=big5,' + + 'Cyrillic (iso-8859-5)=iso-8859-5,' + + 'Japanese (iso-2022-jp)=iso-2022-jp,' + + 'Greek (iso-8859-7)=iso-8859-7,' + + 'Korean (iso-2022-kr)=iso-2022-kr,' + + 'ASCII (us-ascii)=us-ascii'; + + var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; + var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; + + function setVal(id, value) { + var elm = document.getElementById(id); + + if (elm) { + value = value || ''; + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") + elm.checked = !!value; + else + elm.value = value; + } + }; + + function getVal(id) { + var elm = document.getElementById(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + }; + + window.FullPageDialog = { + changedStyle : function() { + var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); + + setVal('fontface', styles['font-face']); + setVal('fontsize', styles['font-size']); + setVal('textcolor', styles['color']); + + if (val = styles['background-image']) + setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); + else + setVal('bgimage', ''); + + setVal('bgcolor', styles['background-color']); + + // Reset margin form elements + setVal('topmargin', ''); + setVal('rightmargin', ''); + setVal('bottommargin', ''); + setVal('leftmargin', ''); + + // Expand margin + if (val = styles['margin']) { + val = val.split(' '); + styles['margin-top'] = val[0] || ''; + styles['margin-right'] = val[1] || val[0] || ''; + styles['margin-bottom'] = val[2] || val[0] || ''; + styles['margin-left'] = val[3] || val[0] || ''; + } + + if (val = styles['margin-top']) + setVal('topmargin', val.replace(/px/, '')); + + if (val = styles['margin-right']) + setVal('rightmargin', val.replace(/px/, '')); + + if (val = styles['margin-bottom']) + setVal('bottommargin', val.replace(/px/, '')); + + if (val = styles['margin-left']) + setVal('leftmargin', val.replace(/px/, '')); + + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('textcolor_pick', 'textcolor'); + }, + + changedStyleProp : function() { + var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); + + styles['font-face'] = getVal('fontface'); + styles['font-size'] = getVal('fontsize'); + styles['color'] = getVal('textcolor'); + styles['background-color'] = getVal('bgcolor'); + + if (val = getVal('bgimage')) + styles['background-image'] = "url('" + val + "')"; + else + styles['background-image'] = ''; + + delete styles['margin']; + + if (val = getVal('topmargin')) + styles['margin-top'] = val + "px"; + else + styles['margin-top'] = ''; + + if (val = getVal('rightmargin')) + styles['margin-right'] = val + "px"; + else + styles['margin-right'] = ''; + + if (val = getVal('bottommargin')) + styles['margin-bottom'] = val + "px"; + else + styles['margin-bottom'] = ''; + + if (val = getVal('leftmargin')) + styles['margin-left'] = val + "px"; + else + styles['margin-left'] = ''; + + // Serialize, parse and reserialize this will compress redundant styles + setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); + this.changedStyle(); + }, + + update : function() { + var data = {}; + + tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { + data[node.id] = getVal(node.id); + }); + + tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); + tinyMCEPopup.close(); + } + }; + + function init() { + var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; + + // Setup doctype select box + list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'doctype', item[0], item[1]); + } + + // Setup fonts select box + list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'fontface', item[0], item[1]); + } + + // Setup fontsize select box + list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); + for (i = 0; i < list.length; i++) + addSelectValue(form, 'fontsize', list[i], list[i]); + + // Setup encodings select box + list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'docencoding', item[0], item[1]); + } + + // Setup color pickers + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); + document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); + document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); + document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); + document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); + document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); + + // Resize some elements + if (isVisible('stylesheetbrowser')) + document.getElementById('stylesheet').style.width = '220px'; + + if (isVisible('link_href_browser')) + document.getElementById('element_link_href').style.width = '230px'; + + if (isVisible('bgimage_browser')) + document.getElementById('bgimage').style.width = '210px'; + + // Update form + tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { + setVal(key, value); + }); + + FullPageDialog.changedStyle(); + + // Update colors + updateColor('textcolor_pick', 'textcolor'); + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('visited_color_pick', 'visited_color'); + updateColor('active_color_pick', 'active_color'); + updateColor('link_color_pick', 'link_color'); + }; + + tinyMCEPopup.onInit.add(init); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js new file mode 100644 index 00000000..ecdff9ed --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.fullpage_dlg',{title:"Dokument-Eigenschaften","meta_tab":"Allgemein","appearance_tab":"Aussehen","advanced_tab":"Erweitert","meta_props":"Meta-Information",langprops:"Sprache und Codierung","meta_title":"Titel","meta_keywords":"Keywords","meta_description":"Beschreibung","meta_robots":"Robots",doctypes:"DocType",langcode:"Sprachcode",langdir:"Sprachrichtung",ltr:"Links nach Rechts",rtl:"Rechts nach Links","xml_pi":"XML Deklaration",encoding:"Zeichencodierung","appearance_bgprops":"Hintergrund-Eigenschaften","appearance_marginprops":"Abst\u00e4nde des Body","appearance_linkprops":"Linkfarben","appearance_textprops":"Text-Eigenschaften",bgcolor:"Hintergrundfarbe",bgimage:"Hintergrundbild","left_margin":"Linker Abstand","right_margin":"Rechter Abstand","top_margin":"Oberer Abstand","bottom_margin":"Unterer Abstand","text_color":"Textfarbe","font_size":"Schriftgr\u00f6\u00dfe","font_face":"Schriftart","link_color":"Linkfarbe","hover_color":"Hover-Farbe","visited_color":"Visited-Farbe","active_color":"Active-Farbe",textcolor:"Farbe",fontsize:"Schriftgr\u00f6\u00dfe",fontface:"Schriftart","meta_index_follow":"Indizieren und den Links folgen","meta_index_nofollow":"Indizieren, aber den Links nicht folgen","meta_noindex_follow":"Nicht indizieren, aber den Links folgen","meta_noindex_nofollow":"Nicht indizieren und auch nicht den Links folgen","appearance_style":"CSS-Stylesheet und Stileigenschaften",stylesheet:"CSS-Stylesheet",style:"CSS-Stil",author:"Autor",copyright:"Copyright",add:"Neues Element hinzuf\u00fcgen",remove:"Ausgew\u00e4hltes Element entfernen",moveup:"Ausgew\u00e4hltes Element nach oben bewegen",movedown:"Ausgew\u00e4hltes Element nach unten bewegen","head_elements":"\u00dcberschriftenelemente",info:"Information","add_title":"Titel-Element","add_meta":"Meta-Element","add_script":"Script-Element","add_style":"Style-Element","add_link":"Link-Element","add_base":"Base-Element","add_comment":"HTML-Kommentar","title_element":"Titel-Element","script_element":"Script-Element","style_element":"Style-Element","base_element":"Base-Element","link_element":"Link-Element","meta_element":"Meta_Element","comment_element":"Kommentar",src:"Src",language:"Sprache",href:"Href",target:"Ziel",type:"Typ",charset:"Zeichensatz",defer:"Defer",media:"Media",properties:"Eigenschaften",name:"Name",value:"Wert",content:"Inhalt",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"Allgemein","advanced_props":"Erweitert"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js new file mode 100644 index 00000000..516edc74 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.fullpage_dlg',{title:"Document Properties","meta_tab":"General","appearance_tab":"Appearance","advanced_tab":"Advanced","meta_props":"Meta Information",langprops:"Language and Encoding","meta_title":"Title","meta_keywords":"Keywords","meta_description":"Description","meta_robots":"Robots",doctypes:"Doctype",langcode:"Language Code",langdir:"Language Direction",ltr:"Left to Right",rtl:"Right to Left","xml_pi":"XML Declaration",encoding:"Character Encoding","appearance_bgprops":"Background Properties","appearance_marginprops":"Body Margins","appearance_linkprops":"Link Colors","appearance_textprops":"Text Properties",bgcolor:"Background Color",bgimage:"Background Image","left_margin":"Left Margin","right_margin":"Right Margin","top_margin":"Top Margin","bottom_margin":"Bottom Margin","text_color":"Text Color","font_size":"Font Size","font_face":"Font Face","link_color":"Link Color","hover_color":"Hover Color","visited_color":"Visited Color","active_color":"Active Color",textcolor:"Color",fontsize:"Font Size",fontface:"Font Family","meta_index_follow":"Index and Follow the Links","meta_index_nofollow":"Index and Don\'t Follow the Links","meta_noindex_follow":"Do Not Index but Follow the Links","meta_noindex_nofollow":"Do Not Index and Don\'t Follow the Links","appearance_style":"Stylesheet and Style Properties",stylesheet:"Stylesheet",style:"Style",author:"Author",copyright:"Copyright",add:"Add New Element",remove:"Remove Selected Element",moveup:"Move Selected Element Up",movedown:"Move Selected Element Down","head_elements":"Head Elements",info:"Information","add_title":"Title Element","add_meta":"Meta Element","add_script":"Script Element","add_style":"Style Element","add_link":"Link Element","add_base":"Base Element","add_comment":"Comment Node","title_element":"Title Element","script_element":"Script Element","style_element":"Style Element","base_element":"Base Element","link_element":"Link Element","meta_element":"Meta Element","comment_element":"Comment",src:"Source",language:"Language",href:"HREF",target:"Target",type:"Type",charset:"Charset",defer:"Defer",media:"Media",properties:"Properties",name:"Name",value:"Value",content:"Content",rel:"Rel",rev:"Rev",hreflang:"HREF Lang","general_props":"General","advanced_props":"Advanced"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js new file mode 100644 index 00000000..a2eb0348 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js new file mode 100644 index 00000000..524b487a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js @@ -0,0 +1,159 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.FullScreenPlugin', { + init : function(ed, url) { + var t = this, s = {}, vp, posCss; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullScreen', function() { + var win, de = DOM.doc.documentElement; + + if (ed.getParam('fullscreen_is_enabled')) { + if (ed.getParam('fullscreen_new_window')) + closeFullscreen(); // Call to close in new window + else { + DOM.win.setTimeout(function() { + tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); + tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent()); + tinyMCE.remove(ed); + DOM.remove('mce_fullscreen_container'); + de.style.overflow = ed.getParam('fullscreen_html_overflow'); + DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); + DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); + tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings + }, 10); + } + + return; + } + + if (ed.getParam('fullscreen_new_window')) { + win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); + try { + win.resizeTo(screen.availWidth, screen.availHeight); + } catch (e) { + // Ignore + } + } else { + tinyMCE.oldSettings = tinyMCE.settings; // Store old settings + s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; + s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); + vp = DOM.getViewPort(); + s.fullscreen_scrollx = vp.x; + s.fullscreen_scrolly = vp.y; + + // Fixes an Opera bug where the scrollbars doesn't reappear + if (tinymce.isOpera && s.fullscreen_overflow == 'visible') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where horizontal scrollbars would appear + if (tinymce.isIE && s.fullscreen_overflow == 'scroll') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where the scrollbars doesn't reappear + if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) + s.fullscreen_html_overflow = 'auto'; + + if (s.fullscreen_overflow == '0px') + s.fullscreen_overflow = ''; + + DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); + de.style.overflow = 'hidden'; //Fix for IE6/7 + vp = DOM.getViewPort(); + DOM.win.scrollTo(0, 0); + + if (tinymce.isIE) + vp.h -= 1; + + // Use fixed position if it exists + if (tinymce.isIE6 || document.compatMode == 'BackCompat') + posCss = 'absolute;top:' + vp.y; + else + posCss = 'fixed;top:0'; + + n = DOM.add(DOM.doc.body, 'div', { + id : 'mce_fullscreen_container', + style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); + DOM.add(n, 'div', {id : 'mce_fullscreen'}); + + tinymce.each(ed.settings, function(v, n) { + s[n] = v; + }); + + s.id = 'mce_fullscreen'; + s.width = n.clientWidth; + s.height = n.clientHeight - 15; + s.fullscreen_is_enabled = true; + s.fullscreen_editor_id = ed.id; + s.theme_advanced_resizing = false; + s.save_onsavecallback = function() { + ed.setContent(tinyMCE.get(s.id).getContent()); + ed.execCommand('mceSave'); + }; + + tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { + s[k] = v; + }); + + if (s.theme_advanced_toolbar_location === 'external') + s.theme_advanced_toolbar_location = 'top'; + + t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); + t.fullscreenEditor.onInit.add(function() { + t.fullscreenEditor.setContent(ed.getContent()); + t.fullscreenEditor.focus(); + }); + + t.fullscreenEditor.render(); + + t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); + t.fullscreenElement.update(); + //document.body.overflow = 'hidden'; + + t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { + var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; + + // Get outer/inner size to get a delta size that can be used to calc the new iframe size + outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]); + innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); + + fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); + }); + } + }); + + // Register buttons + ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); + }); + }, + + getInfo : function() { + return { + longname : 'Fullscreen', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm new file mode 100644 index 00000000..ffe528e4 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm @@ -0,0 +1,110 @@ + + + + + + + + + +
            + +
            + + + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js new file mode 100644 index 00000000..b2ce9279 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("grappelli");var e=tinymce.DOM;tinymce.create("tinymce.plugins.Grappelli",{init:function(t,n){var r=this;tb=t.getParam("grappelli_adv_toolbar","toolbar2");documentstructure_css=n+"../../../themes/advanced/skins/grappelli/content_documentstructure_"+t.settings.language+".css";cookie_date=new Date;var s=cookie_date.getFullYear();cookie_date.setYear(s+1);cookie_grappelli_show_documentstructure=tinymce.util.Cookie.get("grappelli_show_documentstructure");cookie_grappelli_show_documentstructure!=null?t.settings.grappelli_show_documentstructure=cookie_grappelli_show_documentstructure:tinymce.util.Cookie.set("grappelli_show_documentstructure",t.settings.grappelli_show_documentstructure,cookie_date,"/");t.onInit.add(function(){"mce_fullscreen"==t.id&&t.dom.addClass(t.dom.select("body"),"fullscreen");t.settings.grappelli_adv_hidden?r._hide_adv_menu(t):r._show_adv_menu(t);t.settings.grappelli_show_documentstructure=="on"?r._show_documentstructure(t):r._hide_documentstructure(t)});t.addCommand("Grappelli_Adv",function(){e.isHidden(t.controlManager.get(tb).id)?r._show_adv_menu(t):r._hide_adv_menu(t)});t.addCommand("Grappelli_DocumentStructure",function(){i=t.controlManager;t.settings.grappelli_show_documentstructure=="on"?r._hide_documentstructure(t):r._show_documentstructure(t)});t.addButton("grappelli_adv",{title:"grappelli.grappelli_adv_desc",cmd:"Grappelli_Adv"});t.addButton("grappelli_documentstructure",{title:"grappelli.grappelli_documentstructure_desc",cmd:"Grappelli_DocumentStructure"});t.onBeforeExecCommand.add(function(e,t,n,i){if("mceFullScreen"!=t)return;if("mce_fullscreen"==e.id){base_ed=tinyMCE.get(e.settings.fullscreen_editor_id);e.settings.grappelli_adv_hidden?r._hide_adv_menu(base_ed):r._show_adv_menu(base_ed);e.settings.grappelli_show_documentstructure=="on"?r._show_documentstructure(base_ed):r._hide_documentstructure(base_ed)}});t.addShortcut("alt+shift+z",t.getLang("grappelli_adv_desc"),"Grappelli_Adv")},_resizeIframe:function(t,n,r){var i=t.getContentAreaContainer().firstChild;e.setStyle(i,"height",i.clientHeight+r);t.theme.deltaHeight+=r},_show_documentstructure:function(e){head=e.getBody().previousSibling;var t=head.childNodes;for(var n=0;n= 0; i--) { + // c_cn = cn[i]; + // if (c_cn.nodeType == 3 || (!ed.dom.isBlock(c_cn) && c_cn.nodeType != 8)) { + // if (c_cn.nodeType != 3 || /[^\s]/g.test(c_cn.nodeValue)) { + // bl = ed.dom.create('p'); + // bl.appendChild(c_cn.cloneNode(1)); + // new_cn = c_cn.parentNode.replaceChild(bl, c_cn); + // // move caret + // r = ed.getDoc().createRange(); + // r.setStart(bl, bl.nodeValue ? bl.nodeValue.length : 0); + // r.setEnd(bl, bl.nodeValue ? bl.nodeValue.length : 0); + // ed.selection.setRng(r); + // } + // } + // } + // } + // }); + + }, + + // INTERNAL: RESIZE + _resizeIframe: function(ed, tb, b) { + var iframe = ed.getContentAreaContainer().firstChild; + DOM.setStyle(iframe, "height", iframe.clientHeight + b); + ed.theme.deltaHeight += b + }, + + // INTERNAL: SHOW/HIDE DOCUMENT STRUCTURE + _show_documentstructure: function(ed) { + head = ed.getBody().previousSibling; + var headChilds = head.childNodes; + + for (var i = 0; i < headChilds.length; i++) { + if (headChilds[i].nodeName == "LINK" + && headChilds[i].getAttribute('href') == documentstructure_css) { + // documentstructure_css is already set so... + return; + } + } + var vs_link = document.createElement("link"); + vs_link.rel="stylesheet"; + vs_link.mce_href = documentstructure_css; + vs_link.href = documentstructure_css; + head.appendChild(vs_link); + ed.settings.grappelli_show_documentstructure = 'on'; + tinymce.util.Cookie.set('grappelli_show_documentstructure', 'on', cookie_date, '/'); + ed.controlManager.setActive('grappelli_documentstructure', true); + }, + _hide_documentstructure: function(ed) { + head = ed.getBody().previousSibling; + vs_link = null; + + var headChilds = head.childNodes; + + for (var i = 0; i < headChilds.length; i++) { + if (headChilds[i].nodeName == "LINK" + && headChilds[i].getAttribute('href') == documentstructure_css) { + // found the node with documentstructure_css + vs_link = headChilds[i]; + break; + } + } + + if (vs_link !== null) { + // if we found the node with documentstructure_css, delete it + head.removeChild(vs_link); + ed.settings.grappelli_show_documentstructure = 'off'; + tinymce.util.Cookie.set('grappelli_show_documentstructure', 'off', cookie_date, '/'); + ed.controlManager.setActive('grappelli_documentstructure', false); + } + }, + + // INTERNAL: SHOW/HIDE ADVANCED MENU + _show_adv_menu: function(ed) { + if (ed.controlManager.get(tb, false)) { + ed.controlManager.setActive("grappelli_adv", 1); + DOM.show(ed.controlManager.get(tb).id); + this._resizeIframe(ed, tb, -28); + ed.settings.grappelli_adv_hidden = 0; + } + }, + _hide_adv_menu: function(ed) { + if (ed.controlManager.get(tb, false)) { + ed.controlManager.setActive("grappelli_adv", 0); + DOM.hide(ed.controlManager.get(tb).id); + this._resizeIframe(ed, tb, 28); + ed.settings.grappelli_adv_hidden = 1; + } + }, + + // GET INFO + getInfo: function() { + return { + longname: "Grappelli Plugin", + author: "vonautomatisch (patrick kranzlmueller)", + authorurl: "http://vonautomatisch.at", + infourl: "http://code.google.com/p/django-grappelli/", + version: "1.1" + } + } + + }); + + tinymce.PluginManager.add("grappelli", tinymce.plugins.Grappelli) + +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png new file mode 100644 index 00000000..466d68a3 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png new file mode 100644 index 00000000..3a6e6a9f Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/cs.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/cs.js new file mode 100644 index 00000000..95322fe4 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/cs.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("cs.grappelli",{ +grappelli_adv_desc:"Zobrazit/Skrýt pokročilé možnosti", +grappelli_documentstructure_desc:"Zobrazit/Skrýt strukturu dokumentu", +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js new file mode 100644 index 00000000..b72068c8 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("de.grappelli",{ +grappelli_adv_desc:"Erweitertes Menü anzeigen/verbergen", +grappelli_documentstructure_desc:"Dokumentenstruktur anzeigen/verbergen", +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js new file mode 100644 index 00000000..c2647680 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("en.grappelli",{ +grappelli_adv_desc:"Show/Hide Advanced Menu", +grappelli_documentstructure_desc:"Show/Hide Document Structure", +}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js new file mode 100644 index 00000000..bbcccac7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("fr.grappelli",{ +grappelli_adv_desc:"Basculer le menu avancé", +grappelli_documentstructure_desc:"Basculé la structure de document", +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js new file mode 100644 index 00000000..a34b0282 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("pl.grappelli",{ +grappelli_adv_desc:"Pokaż/Ukryj zaawansowane menu", +grappelli_documentstructure_desc:"Pokaż/Ukryj strukturę dokumentu" +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js new file mode 100644 index 00000000..6ecdf067 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("ru.grappelli",{ +grappelli_adv_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0435\u0020\u041c\u0435\u043d\u044e", +grappelli_documentstructure_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u0020\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430", +}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js new file mode 100644 index 00000000..17077ad5 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("grappelli_contextmenu");var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e);d.addCommand("mcePBefore",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");pe.parentNode.insertBefore(new_p,pe)}});d.addCommand("mcePAfter",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");d.dom.insertAfter(new_p,pe)}});d.addCommand("mcePBeforeRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");pe.parentNode.insertBefore(new_p,pe)}});d.addCommand("mcePAfterRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");d.dom.insertAfter(new_p,pe)}});d.addCommand("mceDelete",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){d.dom.remove(pe)}});d.addCommand("mceDeleteRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){d.dom.remove(pe)}});d.addCommand("mceMoveUp",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){pre_prev=f._getPreviousSibling(pe);if(pre_prev){pre_prev.parentNode.insertBefore(pe,pre_prev)}}});d.addCommand("mceMoveUpRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){pre_prev=f._getPreviousSibling(pe);if(pre_prev){pre_prev.parentNode.insertBefore(pe,pre_prev)}}})},getInfo:function(){return{longname:"Grappelli (Contextmenu)",author:"Patrick Kranzlmueller",authorurl:"http://vonautomatisch.at",infourl:"http://code.google.com/p/django-grappelli/",version:"0.1"}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;pe=h.dom.getParent(d,function(m){nn=m.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return m}},h.dom.getRoot());re=h.dom.getParent(d,function(m){nn=m.nodeName;nn_p=m.parentNode.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"&&nn_p=="BODY"){return m}},h.dom.getRoot());title_prefix=pe.nodeName;title_prefix_root=re.nodeName;title_b_before="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpbefore_desc";title_b_after="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpafter_desc";title_b_before_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpbeforeroot_desc";title_b_after_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpafterroot_desc";title_b_delete="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_delete_desc";title_b_delete_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_deleteroot_desc";title_b_moveup="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_moveup_desc";title_b_moveup_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_moveuproot_desc";f.add({title:title_b_before,icon:"",cmd:"mcePBefore"});f.add({title:title_b_after,icon:"",cmd:"mcePAfter"});if(pe.parentNode.nodeName!="BODY"){f.addSeparator();f.add({title:title_b_before_root,icon:"",cmd:"mcePBeforeRoot"});f.add({title:title_b_after_root,icon:"",cmd:"mcePAfterRoot"})}f.addSeparator();f.add({title:title_b_delete,icon:"",cmd:"mceDelete"});if(pe.parentNode.nodeName!="BODY"){f.add({title:title_b_delete_root,icon:"",cmd:"mceDeleteRoot"})}f.addSeparator();f.add({title:title_b_moveup,icon:"",cmd:"mceMoveUp"});if(pe.parentNode.nodeName!="BODY"){f.add({title:title_b_moveup_root,icon:"",cmd:"mceMoveUpRoot"})}l.onContextMenu.dispatch(l,f,d,e);return f},_getPreviousSibling:function(e){var d=e.previousSibling;while(d&&(d.nodeType==document.TEXT_NODE||d.nodeType==document.CDATA_NODE)&&d.nodeValue.match(/^\s*$/)){d=d.previousSibling}return d}});tinymce.PluginManager.add("grappelli_contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js new file mode 100644 index 00000000..87b81d60 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js @@ -0,0 +1,250 @@ +(function() { + + tinymce.PluginManager.requireLangPack('grappelli_contextmenu'); + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.ContextMenu', { + init : function(ed) { + var t = this; + + t.editor = ed; + t.onContextMenu = new tinymce.util.Dispatcher(this); + + ed.onContextMenu.add(function(ed, e) { + if (!e.ctrlKey) { + t._getMenu(ed).showMenu(e.clientX, e.clientY); + Event.add(ed.getDoc(), 'click', hide); + Event.cancel(e); + } + }); + + function hide() { + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hide); + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + + // Register commands + // INSERT ELEMENTS + ed.addCommand('mcePBefore', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + pe.parentNode.insertBefore(new_p, pe); + } + }); + ed.addCommand('mcePAfter', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + ed.dom.insertAfter(new_p, pe); + } + }); + + // INSERT ROOT ELEMENTS + ed.addCommand('mcePBeforeRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + pe.parentNode.insertBefore(new_p, pe); + } + }); + ed.addCommand('mcePAfterRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + ed.dom.insertAfter(new_p, pe); + } + }); + + // DELETE + ed.addCommand('mceDelete', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + ed.dom.remove(pe); + } + }); + + ed.addCommand('mceDeleteRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + ed.dom.remove(pe); + } + }); + + // MOVE + ed.addCommand('mceMoveUp', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + pre_prev = t._getPreviousSibling(pe); + if (pre_prev) { + pre_prev.parentNode.insertBefore(pe, pre_prev); + } + } + }); + ed.addCommand('mceMoveUpRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + pre_prev = t._getPreviousSibling(pe); + if (pre_prev) { + pre_prev.parentNode.insertBefore(pe, pre_prev); + } + } + }); + + }, + + getInfo : function() { + return { + longname : 'Grappelli (Contextmenu)', + author : 'Patrick Kranzlmueller', + authorurl : 'http://vonautomatisch.at', + infourl : 'http://code.google.com/p/django-grappelli/', + version : '0.1' + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1 + }); + + t._menu = m; + + // parent element + pe = ed.dom.getParent(el, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + // root element + re = ed.dom.getParent(el, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE' && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + + title_prefix = pe.nodeName; + title_prefix_root = re.nodeName; + + title_b_before = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpbefore_desc'; + title_b_after = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpafter_desc'; + title_b_before_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpbeforeroot_desc'; + title_b_after_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpafterroot_desc'; + title_b_delete = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_delete_desc'; + title_b_delete_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_deleteroot_desc'; + title_b_moveup = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_moveup_desc'; + title_b_moveup_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_moveuproot_desc'; + + m.add({title : title_b_before, icon : '', cmd : 'mcePBefore'}); + m.add({title : title_b_after, icon : '', cmd : 'mcePAfter'}); + + if (pe.parentNode.nodeName != "BODY") { + m.addSeparator(); + m.add({title : title_b_before_root, icon : '', cmd : 'mcePBeforeRoot'}); + m.add({title : title_b_after_root, icon : '', cmd : 'mcePAfterRoot'}); + } + + m.addSeparator(); + m.add({title : title_b_delete, icon : '', cmd : 'mceDelete'}); + if (pe.parentNode.nodeName != "BODY") { + m.add({title : title_b_delete_root, icon : '', cmd : 'mceDeleteRoot'}); + } + + m.addSeparator(); + m.add({title : title_b_moveup, icon : '', cmd : 'mceMoveUp'}); + if (pe.parentNode.nodeName != "BODY") { + m.add({title : title_b_moveup_root, icon : '', cmd : 'mceMoveUpRoot'}); + } + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + + }, + + _getPreviousSibling: function(obj) { + var prevNode = obj.previousSibling; + while(prevNode && (prevNode.nodeType == document.TEXT_NODE || prevNode.nodeType == document.CDATA_NODE) && prevNode.nodeValue.match(/^\s*$/)) { + prevNode = prevNode.previousSibling; + } + return prevNode; + } + + }); + + // Register plugin + tinymce.PluginManager.add('grappelli_contextmenu', tinymce.plugins.ContextMenu); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/cs.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/cs.js new file mode 100644 index 00000000..8845bddd --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/cs.js @@ -0,0 +1,19 @@ +tinyMCE.addI18n("cs.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Vlož odstavec PŘED aktuální element", +grappelli_contextmenu_insertpafter_desc:"Vlož odstavec ZA aktuální element", +grappelli_contextmenu_insertpbeforeroot_desc:"Vlož odstavec PŘED aktuální KOŘENOVÝ element", +grappelli_contextmenu_insertpafterroot_desc:"Vlož odstavec ZA aktuální KOŘENOVÝ element", +grappelli_contextmenu_delete_desc:"Smazat aktuální element", +grappelli_contextmenu_deleteroot_desc:"Smazat aktuální KOŘENOVÝ element", +grappelli_contextmenu_moveup_desc:"Posunout element NAHORU", +grappelli_contextmenu_moveuproot_desc:"Posunout aktuální kořenový element NAHORU", + +P_grappelli_contextmenu_insertpbefore_desc:"Vlož odstavec PŘED aktuální element", +P_grappelli_contextmenu_insertpafter_desc:"Vlož odstavec ZA aktuální element", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Vlož odstavec PŘED aktuální KOŘENOVÝ element", +P_grappelli_contextmenu_insertpafterroot_desc:"Vlož odstavec ZA aktuální KOŘENOVÝ element", +P_grappelli_contextmenu_delete_desc:"Smazat aktuální element", +P_grappelli_contextmenu_deleteroot_desc:"Smazat aktuální KOŘENOVÝ element", +P_grappelli_contextmenu_moveup_desc:"Posunout element NAHORU", +P_grappelli_contextmenu_moveuproot_desc:"Posunout aktuální kořenový element NAHORU", +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js new file mode 100644 index 00000000..b4b6080f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("de.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Absatz VOR aktuellem ELEMENT einfügen", +grappelli_contextmenu_insertpafter_desc:"Absatz NACH aktuellen ELEMENT einfügen", +grappelli_contextmenu_insertpbeforeroot_desc:"Absatz VOR aktuellem HAUPTELEMENT einfügen", +grappelli_contextmenu_insertpafterroot_desc:"Absatz NACH aktuellen HAUPTELEMENT einfügen", +grappelli_contextmenu_delete_desc:"Aktuelles ELEMENT löschen", +grappelli_contextmenu_deleteroot_desc:"Aktuelles HAUPTELEMENT löschen", +grappelli_contextmenu_moveup_desc:"Aktuelles ELEMENT NACH OBEN verschieben", +grappelli_contextmenu_moveuproot_desc:"Aktuelles HAUPTELEMENT NACH OBEN verschieben", + +P_grappelli_contextmenu_insertpbefore_desc:"Absatz VOR Absatz einfügen", +P_grappelli_contextmenu_insertpafter_desc:"Absatz NACH Absatz einfügen", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Absatz VOR Template einfügen", +P_grappelli_contextmenu_insertpafterroot_desc:"Absatz NACH Template einfügen", +P_grappelli_contextmenu_delete_desc:"Absatz löschen", +P_grappelli_contextmenu_deleteroot_desc:"Template löschen", +P_grappelli_contextmenu_moveup_desc:"Absatz NACH OBEN verschieben", +P_grappelli_contextmenu_moveuproot_desc:"Template NACH OBEN verschieben", + +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js new file mode 100644 index 00000000..29de91b7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("en.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Insert Paragraph BEFORE current element", +grappelli_contextmenu_insertpafter_desc:"Insert Paragraph AFTER current element", +grappelli_contextmenu_insertpbeforeroot_desc:"Insert Paragraph BEFORE current ROOT-LEVEL element", +grappelli_contextmenu_insertpafterroot_desc:"Insert Paragraph AFTER current ROOT-LEVEL element", +grappelli_contextmenu_delete_desc:"Delete current element", +grappelli_contextmenu_deleteroot_desc:"Delete current ROOT-LEVEL element", +grappelli_contextmenu_moveup_desc:"MOVE UP current ELEMENT", +grappelli_contextmenu_moveuproot_desc:"MOVE UP current ROOT-LEVEL element", + +P_grappelli_contextmenu_insertpbefore_desc:"Insert Paragraph BEFORE current element", +P_grappelli_contextmenu_insertpafter_desc:"Insert Paragraph AFTER current element", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Insert Paragraph BEFORE current ROOT-LEVEL element", +P_grappelli_contextmenu_insertpafterroot_desc:"Insert Paragraph AFTER current ROOT-LEVEL element", +P_grappelli_contextmenu_delete_desc:"Delete current element", +P_grappelli_contextmenu_deleteroot_desc:"Delete current ROOT-LEVEL element", +P_grappelli_contextmenu_moveup_desc:"MOVE UP current ELEMENT", +P_grappelli_contextmenu_moveuproot_desc:"MOVE UP current ROOT-LEVEL element", + +}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js new file mode 100644 index 00000000..168e4b85 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js @@ -0,0 +1,10 @@ +tinyMCE.addI18n("fr.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Insérer Paragraph AVANT la sélection", +grappelli_contextmenu_insertpafter_desc:"Insérer Paragraph APRÈS la sélection", +grappelli_contextmenu_insertpbeforeroot_desc:"Insérer Paragraph AVANT la racine de la sélection", +grappelli_contextmenu_insertpafterroot_desc:"Insérer Paragraph APRÈS la racine de la sélection", +grappelli_contextmenu_delete_desc:"Supprimer la sélection", +grappelli_contextmenu_deleteroot_desc:"Supprimer la racine de la sélection", +grappelli_contextmenu_moveup_desc:"Monter la sélection", +grappelli_contextmenu_moveuproot_desc:"Monter la racine de la sélection", +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js new file mode 100644 index 00000000..0d90c7cf --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js @@ -0,0 +1,19 @@ +tinyMCE.addI18n("pl.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Wstaw paragraf PRZED aktualnym elementem", +grappelli_contextmenu_insertpafter_desc:"Wstaw paragraf PO aktualnym elemencie", +grappelli_contextmenu_insertpbeforeroot_desc:"Wstaw paragraf PRZED aktualnym BAZOWYM elementem", +grappelli_contextmenu_insertpafterroot_desc:"Wstaw paragraf PO aktualnym BAZOWYM elemencie", +grappelli_contextmenu_delete_desc:"Usuń aktualny element", +grappelli_contextmenu_deleteroot_desc:"Usuń aktualny BAZOWY element", +grappelli_contextmenu_moveup_desc:"PRZENIEŚ aktualny ELEMENT WYŻEJ", +grappelli_contextmenu_moveuproot_desc:"PRZENIEŚ aktualny BAZOWY element WYŻEJ", + +P_grappelli_contextmenu_insertpbefore_desc:"Wstaw paragraf PRZED aktualnym elementem", +P_grappelli_contextmenu_insertpafter_desc:"Wstaw paragraf PO aktualnym elemencie", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Wstaw paragraf PRZED aktualnym BAZOWYM elementem", +P_grappelli_contextmenu_insertpafterroot_desc:"Wstaw paragraf PO aktualnym BAZOWYM elemencie", +P_grappelli_contextmenu_delete_desc:"Usuń aktualny element", +P_grappelli_contextmenu_deleteroot_desc:"Usuń aktualny BAZOWY element", +P_grappelli_contextmenu_moveup_desc:"PRZENIEŚ aktualny ELEMENT WYŻEJ", +P_grappelli_contextmenu_moveuproot_desc:"PRZENIEŚ aktualny BAZOWY element WYŻEJ" +}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js new file mode 100644 index 00000000..c069407d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("ru.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +grappelli_contextmenu_insertpafter_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +grappelli_contextmenu_insertpbeforeroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u042b\u041c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +grappelli_contextmenu_insertpafterroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0413\u041e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +grappelli_contextmenu_delete_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +grappelli_contextmenu_deleteroot_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +grappelli_contextmenu_moveup_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u042d\u041b\u0415\u041c\u0415\u041d\u0422", +grappelli_contextmenu_moveuproot_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", + +P_grappelli_contextmenu_insertpbefore_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +P_grappelli_contextmenu_insertpafter_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +P_grappelli_contextmenu_insertpbeforeroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u042b\u041c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +P_grappelli_contextmenu_insertpafterroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0413\u041e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +P_grappelli_contextmenu_delete_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +P_grappelli_contextmenu_deleteroot_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +P_grappelli_contextmenu_moveup_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u042d\u041b\u0415\u041c\u0415\u041d\u0422", +P_grappelli_contextmenu_moveuproot_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", + +}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js new file mode 100644 index 00000000..e9cba106 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js new file mode 100644 index 00000000..1b2bb984 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.IESpell', { + init : function(ed, url) { + var t = this, sp; + + if (!tinymce.isIE) + return; + + t.editor = ed; + + // Register commands + ed.addCommand('mceIESpell', function() { + try { + sp = new ActiveXObject("ieSpell.ieSpellExtension"); + sp.CheckDocumentNode(ed.getDoc().documentElement); + } catch (e) { + if (e.number == -2146827859) { + ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { + if (s) + window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); + }); + } else + ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); + } + }); + + // Register buttons + ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); + }, + + getInfo : function() { + return { + longname : 'IESpell (IE Only)', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js new file mode 100644 index 00000000..8bb96f9c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","
            "));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js new file mode 100644 index 00000000..67123ca3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js @@ -0,0 +1,699 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; + + tinymce.create('tinymce.plugins.InlinePopups', { + init : function(ed, url) { + // Replace window manager + ed.onBeforeRenderUI.add(function() { + ed.windowManager = new tinymce.InlineWindowManager(ed); + DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); + }); + }, + + getInfo : function() { + return { + longname : 'InlinePopups', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { + InlineWindowManager : function(ed) { + var t = this; + + t.parent(ed); + t.zIndex = 300000; + t.count = 0; + t.windows = {}; + }, + + open : function(f, p) { + var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; + + f = f || {}; + p = p || {}; + + // Run native windows + if (!f.inline) + return t.parent(f, p); + + parentWindow = t._frontWindow(); + if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { + parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; + } + + // Only store selection if the type is a normal window + if (!f.type) + t.bookmark = ed.selection.getBookmark(1); + + id = DOM.uniqueId(); + vp = DOM.getViewPort(); + f.width = parseInt(f.width || 320); + f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); + f.min_width = parseInt(f.min_width || 150); + f.min_height = parseInt(f.min_height || 100); + f.max_width = parseInt(f.max_width || 2000); + f.max_height = parseInt(f.max_height || 2000); + f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); + f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); + f.movable = f.resizable = true; + p.mce_width = f.width; + p.mce_height = f.height; + p.mce_inline = true; + p.mce_window_id = id; + p.mce_auto_focus = f.auto_focus; + + // Transpose +// po = DOM.getPos(ed.getContainer()); +// f.left -= po.x; +// f.top -= po.y; + + t.features = f; + t.params = p; + t.onOpen.dispatch(t, f, p); + + if (f.type) { + opt += ' mceModal'; + + if (f.type) + opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); + + f.resizable = false; + } + + if (f.statusbar) + opt += ' mceStatusbar'; + + if (f.resizable) + opt += ' mceResizable'; + + if (f.minimizable) + opt += ' mceMinimizable'; + + if (f.maximizable) + opt += ' mceMaximizable'; + + if (f.movable) + opt += ' mceMovable'; + + // Create DOM objects + t._addAll(DOM.doc.body, + ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, + ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, + ['div', {id : id + '_top', 'class' : 'mceTop'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_title'}, f.title || ''] + ], + + ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, + ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], + ['span', {id : id + '_content'}], + ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] + ], + + ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_status'}, 'Content'] + ], + + ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], + ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] + ] + ] + ); + + DOM.setStyles(id, {top : -10000, left : -10000}); + + // Fix gecko rendering bug, where the editors iframe messed with window contents + if (tinymce.isGecko) + DOM.setStyle(id, 'overflow', 'auto'); + + // Measure borders + if (!f.type) { + dw += DOM.get(id + '_left').clientWidth; + dw += DOM.get(id + '_right').clientWidth; + dh += DOM.get(id + '_top').clientHeight; + dh += DOM.get(id + '_bottom').clientHeight; + } + + // Resize window + DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); + + u = f.url || f.file; + if (u) { + if (tinymce.relaxedDomain) + u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; + + u = tinymce._addVer(u); + } + + if (!f.type) { + DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); + DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); + DOM.setAttrib(id + '_ifr', 'src', u); + } else { + DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); + + if (f.type == 'confirm') + DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); + + DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); + DOM.setHTML(id + '_content', f.content.replace('\n', '
            ')); + + Event.add(id, 'keyup', function(evt) { + var VK_ESCAPE = 27; + if (evt.keyCode === VK_ESCAPE) { + f.button_func(false); + return Event.cancel(evt); + } + }); + + Event.add(id, 'keydown', function(evt) { + var cancelButton, VK_TAB = 9; + if (evt.keyCode === VK_TAB) { + cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; + if (cancelButton && cancelButton !== evt.target) { + cancelButton.focus(); + } else { + DOM.get(id + '_ok').focus(); + } + return Event.cancel(evt); + } + }); + } + + // Register events + mdf = Event.add(id, 'mousedown', function(e) { + var n = e.target, w, vp; + + w = t.windows[id]; + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + if (n.className == 'mceClose') { + t.close(null, id); + return Event.cancel(e); + } else if (n.className == 'mceMax') { + w.oldPos = w.element.getXY(); + w.oldSize = w.element.getSize(); + + vp = DOM.getViewPort(); + + // Reduce viewport size to avoid scrollbars + vp.w -= 2; + vp.h -= 2; + + w.element.moveTo(vp.x, vp.y); + w.element.resizeTo(vp.w, vp.h); + DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); + DOM.addClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMed') { + // Reset to old size + w.element.moveTo(w.oldPos.x, w.oldPos.y); + w.element.resizeTo(w.oldSize.w, w.oldSize.h); + w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); + + DOM.removeClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMove') + return t._startDrag(id, e, n.className); + else if (DOM.hasClass(n, 'mceResize')) + return t._startDrag(id, e, n.className.substring(13)); + } + }); + + clf = Event.add(id, 'click', function(e) { + var n = e.target; + + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + switch (n.className) { + case 'mceClose': + t.close(null, id); + return Event.cancel(e); + + case 'mceButton mceOk': + case 'mceButton mceCancel': + f.button_func(n.className == 'mceButton mceOk'); + return Event.cancel(e); + } + } + }); + + // Make sure the tab order loops within the dialog. + Event.add([id + '_left', id + '_right'], 'focus', function(evt) { + var iframe = DOM.get(id + '_ifr'); + if (iframe) { + var body = iframe.contentWindow.document.body; + var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); + if (evt.target.id === (id + '_left')) { + focusable[focusable.length - 1].focus(); + } else { + focusable[0].focus(); + } + } else { + DOM.get(id + '_ok').focus(); + } + }); + + // Add window + w = t.windows[id] = { + id : id, + mousedown_func : mdf, + click_func : clf, + element : new Element(id, {blocker : 1, container : ed.getContainer()}), + iframeElement : new Element(id + '_ifr'), + features : f, + deltaWidth : dw, + deltaHeight : dh + }; + + w.iframeElement.on('focus', function() { + t.focus(id); + }); + + // Setup blocker + if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { + DOM.add(DOM.doc.body, 'div', { + id : 'mceModalBlocker', + 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', + style : {zIndex : t.zIndex - 1} + }); + + DOM.show('mceModalBlocker'); // Reduces flicker in IE + DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); + } else + DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); + + if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) + DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); + + DOM.setAttrib(id, 'aria-hidden', 'false'); + t.focus(id); + t._fixIELayout(id, 1); + + // Focus ok button + if (DOM.get(id + '_ok')) + DOM.get(id + '_ok').focus(); + t.count++; + + return w; + }, + + focus : function(id) { + var t = this, w; + + if (w = t.windows[id]) { + w.zIndex = this.zIndex++; + w.element.setStyle('zIndex', w.zIndex); + w.element.update(); + + id = id + '_wrapper'; + DOM.removeClass(t.lastId, 'mceFocus'); + DOM.addClass(id, 'mceFocus'); + t.lastId = id; + + if (w.focussedElement) { + w.focussedElement.focus(); + } else if (DOM.get(id + '_ok')) { + DOM.get(w.id + '_ok').focus(); + } else if (DOM.get(w.id + '_ifr')) { + DOM.get(w.id + '_ifr').focus(); + } + } + }, + + _addAll : function(te, ne) { + var i, n, t = this, dom = tinymce.DOM; + + if (is(ne, 'string')) + te.appendChild(dom.doc.createTextNode(ne)); + else if (ne.length) { + te = te.appendChild(dom.create(ne[0], ne[1])); + + for (i=2; i ix) { + fw = w; + ix = w.zIndex; + } + }); + return fw; + }, + + setTitle : function(w, ti) { + var e; + + w = this._findId(w); + + if (e = DOM.get(w + '_title')) + e.innerHTML = DOM.encode(ti); + }, + + alert : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'alert', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + confirm : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'confirm', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + // Internal functions + + _findId : function(w) { + var t = this; + + if (typeof(w) == 'string') + return w; + + each(t.windows, function(wo) { + var ifr = DOM.get(wo.id + '_ifr'); + + if (ifr && w == ifr.contentWindow) { + w = wo.id; + return false; + } + }); + + return w; + }, + + _fixIELayout : function(id, s) { + var w, img; + + if (!tinymce.isIE6) + return; + + // Fixes the bug where hover flickers and does odd things in IE6 + each(['n','s','w','e','nw','ne','sw','se'], function(v) { + var e = DOM.get(id + '_resize_' + v); + + DOM.setStyles(e, { + width : s ? e.clientWidth : '', + height : s ? e.clientHeight : '', + cursor : DOM.getStyle(e, 'cursor', 1) + }); + + DOM.setStyle(id + "_bottom", 'bottom', '-1px'); + + e = 0; + }); + + // Fixes graphics glitch + if (w = this.windows[id]) { + // Fixes rendering bug after resize + w.element.hide(); + w.element.show(); + + // Forced a repaint of the window + //DOM.get(id).style.filter = ''; + + // IE has a bug where images used in CSS won't get loaded + // sometimes when the cache in the browser is disabled + // This fix tries to solve it by loading the images using the image object + each(DOM.select('div,a', id), function(e, i) { + if (e.currentStyle.backgroundImage != 'none') { + img = new Image(); + img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); + } + }); + + DOM.get(id).style.filter = ''; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); +})(); + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif new file mode 100644 index 00000000..21913985 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif new file mode 100644 index 00000000..f957e49a Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif new file mode 100644 index 00000000..6baf64ad Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif new file mode 100644 index 00000000..20acbbf7 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif new file mode 100644 index 00000000..d5de1cc2 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif new file mode 100644 index 00000000..c2a2ad45 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif new file mode 100644 index 00000000..0b4cc368 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css new file mode 100644 index 00000000..a50d4fc5 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -0,0 +1,90 @@ +/* Clearlooks 2 */ + +/* Reset */ +.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} + +/* General */ +.clearlooks2 {position:absolute; direction:ltr} +.clearlooks2 .mceWrapper {position:static} +.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} +.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} +.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} + +/* Top */ +.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} +.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} +.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} +.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} +.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} +.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} +.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} +.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} +.clearlooks2 .mceFocus .mceTop span {color:#FFF} + +/* Middle */ +.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} +.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} +.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} +.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} +.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} + +/* Bottom */ +.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} +.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} +.clearlooks2 .mceBottom div {top:0} +.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} +.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} +.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} +.clearlooks2 .mceBottom span {display:none} +.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} +.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} +.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} +.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} +.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} + +/* Actions */ +.clearlooks2 a {width:29px; height:16px; top:3px;} +.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} +.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} +.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} +.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} +.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} +.clearlooks2 .mceMovable .mceMove {display:block} +.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} +.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} +.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} +.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} +.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} +.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} + +/* Resize */ +.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} +.clearlooks2 .mceResizable .mceResize {display:block} +.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} +.clearlooks2 .mceMinimizable .mceMin {display:block} +.clearlooks2 .mceMaximizable .mceMax {display:block} +.clearlooks2 .mceMaximized .mceMed {display:block} +.clearlooks2 .mceMaximized .mceMax {display:none} +.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} +.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} +.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} +.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} +.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} +.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} +.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} +.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} + +/* Alert/Confirm */ +.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} +.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} +.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} +.clearlooks2 a:hover {font-weight:bold;} +.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} +.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} +.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} +.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} +.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} +.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm new file mode 100644 index 00000000..f9ec6421 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm @@ -0,0 +1,387 @@ + + + +Template for dialogs + + + + +
            +
            +
            +
            +
            +
            +
            + Blured +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Focused +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Statusbar +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Statusbar, Resizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Resizable, Maximizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Blurred, Maximizable, Statusbar, Resizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Maximized, Maximizable, Minimizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Blured +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Alert +
            + +
            +
            + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
            +
            +
            + +
            +
            +
            +
            +
            + + + Ok + +
            +
            + +
            +
            +
            +
            +
            +
            + Confirm +
            + +
            +
            + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
            +
            +
            + +
            +
            +
            +
            +
            + + + Ok + Cancel + +
            +
            +
            + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js new file mode 100644 index 00000000..938ce6b1 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;gh[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js new file mode 100644 index 00000000..daed2806 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js @@ -0,0 +1,262 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + function findParentLayer(node) { + do { + if (node.className && node.className.indexOf('mceItemLayer') != -1) { + return node; + } + } while (node = node.parentNode); + }; + + tinymce.create('tinymce.plugins.Layer', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceInsertLayer', t._insertLayer, t); + + ed.addCommand('mceMoveForward', function() { + t._move(1); + }); + + ed.addCommand('mceMoveBackward', function() { + t._move(-1); + }); + + ed.addCommand('mceMakeAbsolute', function() { + t._toggleAbsolute(); + }); + + // Register buttons + ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); + ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); + ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); + ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); + + ed.onInit.add(function() { + var dom = ed.dom; + + if (tinymce.isIE) + ed.getDoc().execCommand('2D-Position', false, true); + }); + + // Remove serialized styles when selecting a layer since it might be changed by a drag operation + ed.onMouseUp.add(function(ed, e) { + var layer = findParentLayer(e.target); + + if (layer) { + ed.dom.setAttrib(layer, 'data-mce-style', ''); + } + }); + + // Fixes edit focus issues with layers on Gecko + // This will enable designMode while inside a layer and disable it when outside + ed.onMouseDown.add(function(ed, e) { + var node = e.target, doc = ed.getDoc(), parent; + + if (tinymce.isGecko) { + if (findParentLayer(node)) { + if (doc.designMode !== 'on') { + doc.designMode = 'on'; + + // Repaint caret + node = doc.body; + parent = node.parentNode; + parent.removeChild(node); + parent.appendChild(node); + } + } else if (doc.designMode == 'on') { + doc.designMode = 'off'; + } + } + }); + + ed.onNodeChange.add(t._nodeChange, t); + ed.onVisualAid.add(t._visualAid, t); + }, + + getInfo : function() { + return { + longname : 'Layer', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var le, p; + + le = this._getParentLayer(n); + p = ed.dom.getParent(n, 'DIV,P,IMG'); + + if (!p) { + cm.setDisabled('absolute', 1); + cm.setDisabled('moveforward', 1); + cm.setDisabled('movebackward', 1); + } else { + cm.setDisabled('absolute', 0); + cm.setDisabled('moveforward', !le); + cm.setDisabled('movebackward', !le); + cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); + } + }, + + // Private methods + + _visualAid : function(ed, e, s) { + var dom = ed.dom; + + tinymce.each(dom.select('div,p', e), function(e) { + if (/^(absolute|relative|fixed)$/i.test(e.style.position)) { + if (s) + dom.addClass(e, 'mceItemVisualAid'); + else + dom.removeClass(e, 'mceItemVisualAid'); + + dom.addClass(e, 'mceItemLayer'); + } + }); + }, + + _move : function(d) { + var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; + + nl = []; + tinymce.walk(ed.getBody(), function(n) { + if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) + nl.push(n); + }, 'childNodes'); + + // Find z-indexes + for (i=0; i -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else { + if (z[ci] > 0) + nl[ci].style.zIndex = z[ci] - 1; + } + } else { + // Move forward + + // Try find a higher one + for (i=0; i z[ci]) { + fi = i; + break; + } + } + + if (fi > -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else + nl[ci].style.zIndex = z[ci] + 1; + } + + ed.execCommand('mceRepaint'); + }, + + _getParentLayer : function(n) { + return this.editor.dom.getParent(n, function(n) { + return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); + }); + }, + + _insertLayer : function() { + var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody(); + + ed.dom.add(body, 'div', { + style : { + position : 'absolute', + left : p.x, + top : (p.y > 20 ? p.y : 20), + width : 100, + height : 100 + }, + 'class' : 'mceItemVisualAid mceItemLayer' + }, ed.selection.getContent() || ed.getLang('layer.content')); + + // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 + if (tinymce.isIE) + dom.setHTML(body, body.innerHTML); + }, + + _toggleAbsolute : function() { + var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); + + if (!le) + le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); + + if (le) { + if (le.style.position.toLowerCase() == "absolute") { + ed.dom.setStyles(le, { + position : '', + left : '', + top : '', + width : '', + height : '' + }); + + ed.dom.removeClass(le, 'mceItemVisualAid'); + ed.dom.removeClass(le, 'mceItemLayer'); + } else { + if (le.style.left == "") + le.style.left = 20 + 'px'; + + if (le.style.top == "") + le.style.top = 20 + 'px'; + + if (le.style.width == "") + le.style.width = le.width ? (le.width + 'px') : '100px'; + + if (le.style.height == "") + le.style.height = le.height ? (le.height + 'px') : '100px'; + + le.style.position = "absolute"; + + ed.dom.setAttrib(le, 'data-mce-style', ''); + ed.addVisual(ed.getBody()); + } + + ed.execCommand('mceRepaint'); + ed.nodeChanged(); + } + } + }); + + // Register plugin + tinymce.PluginManager.add('layer', tinymce.plugins.Layer); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js new file mode 100644 index 00000000..2ed5f41a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js @@ -0,0 +1 @@ +(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js new file mode 100644 index 00000000..3cdcde57 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js @@ -0,0 +1,139 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + * + * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align + * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash + * + * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are + * not apart of the newer specifications for HTML and XHTML. + */ + +(function(tinymce) { + // Override inline_styles setting to force TinyMCE to produce deprecated contents + tinymce.onAddEditor.addToTop(function(tinymce, editor) { + editor.settings.inline_styles = false; + }); + + // Create the legacy ouput plugin + tinymce.create('tinymce.plugins.LegacyOutput', { + init : function(editor) { + editor.onInit.add(function() { + var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', + fontSizes = tinymce.explode(editor.settings.font_size_style_values), + schema = editor.schema; + + // Override some internal formats to produce legacy elements and attributes + editor.formatter.register({ + // Change alignment formats to use the deprecated align attribute + alignleft : {selector : alignElements, attributes : {align : 'left'}}, + aligncenter : {selector : alignElements, attributes : {align : 'center'}}, + alignright : {selector : alignElements, attributes : {align : 'right'}}, + alignfull : {selector : alignElements, attributes : {align : 'justify'}}, + + // Change the basic formatting elements to use deprecated element types + bold : [ + {inline : 'b', remove : 'all'}, + {inline : 'strong', remove : 'all'}, + {inline : 'span', styles : {fontWeight : 'bold'}} + ], + italic : [ + {inline : 'i', remove : 'all'}, + {inline : 'em', remove : 'all'}, + {inline : 'span', styles : {fontStyle : 'italic'}} + ], + underline : [ + {inline : 'u', remove : 'all'}, + {inline : 'span', styles : {textDecoration : 'underline'}, exact : true} + ], + strikethrough : [ + {inline : 'strike', remove : 'all'}, + {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true} + ], + + // Change font size and font family to use the deprecated font element + fontname : {inline : 'font', attributes : {face : '%value'}}, + fontsize : { + inline : 'font', + attributes : { + size : function(vars) { + return tinymce.inArray(fontSizes, vars.value) + 1; + } + } + }, + + // Setup font elements for colors as well + forecolor : {inline : 'font', attributes : {color : '%value'}}, + hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} + }); + + // Check that deprecated elements are allowed if not add them + tinymce.each('b,i,u,strike'.split(','), function(name) { + schema.addValidElements(name + '[*]'); + }); + + // Add font element if it's missing + if (!schema.getElementRule("font")) + schema.addValidElements("font[face|size|color|style]"); + + // Add the missing and depreacted align attribute for the serialization engine + tinymce.each(alignElements.split(','), function(name) { + var rule = schema.getElementRule(name), found; + + if (rule) { + if (!rule.attributes.align) { + rule.attributes.align = {}; + rule.attributesOrder.push('align'); + } + } + }); + + // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes + editor.onNodeChange.add(function(editor, control_manager) { + var control, fontElm, fontName, fontSize; + + // Find font element get it's name and size + fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); + if (fontElm) { + fontName = fontElm.face; + fontSize = fontElm.size; + } + + // Select/unselect the font name in droplist + if (control = control_manager.get('fontselect')) { + control.select(function(value) { + return value == fontName; + }); + } + + // Select/unselect the font size in droplist + if (control = control_manager.get('fontsizeselect')) { + control.select(function(value) { + var index = tinymce.inArray(fontSizes, value.fontSize); + + return index + 1 == fontSize; + }); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'LegacyOutput', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); +})(tinymce); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js new file mode 100644 index 00000000..ec21b256 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js @@ -0,0 +1 @@ +(function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{return v&&u.tagName==="P"&&t.tagName==="P"}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(y){var v="TABBING";var s="EMPTY";var J="ESCAPE";var z="PARAGRAPH";var N="UNKNOWN";var x=N;function E(U){return U.keyCode===tinymce.VK.TAB&&!(U.altKey||U.ctrlKey)&&(y.queryCommandState("InsertUnorderedList")||y.queryCommandState("InsertOrderedList"))}function w(){var U=B();var W=U.parentNode.parentNode;var V=U.parentNode.lastChild===U;return V&&!t(W)&&P(U)}function t(U){if(n(U)){return U.parentNode&&U.parentNode.tagName==="LI"}else{return U.tagName==="LI"}}function F(){return y.selection.isCollapsed()&&P(B())}function B(){var U=y.selection.getStart();return((U.tagName=="BR"||U.tagName=="")&&U.parentNode.tagName=="LI")?U.parentNode:U}function P(U){var V=U.childNodes.length;if(U.tagName==="LI"){return V==0?true:V==1&&(U.firstChild.tagName==""||U.firstChild.tagName=="BR"||H(U))}return false}function H(U){var V=tinymce.grep(U.parentNode.childNodes,function(Y){return Y.tagName=="LI"});var W=U==V[V.length-1];var X=U.firstChild;return tinymce.isIE9&&W&&(X.nodeValue==String.fromCharCode(160)||X.nodeValue==String.fromCharCode(32))}function T(U){return U.keyCode===tinymce.VK.ENTER}function A(U){return T(U)&&!U.shiftKey}function M(U){if(E(U)){return v}else{if(A(U)&&w()){return N}else{if(A(U)&&F()){return s}else{return N}}}}function D(U,V){if(x==v||x==s||tinymce.isGecko&&x==J){r.cancel(V)}}function C(){var U=y.selection.getRng(true);var V=U.startContainer;if(V.nodeType==3){var W=V.nodeValue;if(tinymce.isIE9&&W.length>1&&W.charCodeAt(W.length-1)==32){return(U.endOffset==W.length-1)}else{return(U.endOffset==W.length)}}else{if(V.nodeType==1){return U.endOffset==V.childNodes.length}}return false}function I(){var W=y.selection.getNode();var V="h1,h2,h3,h4,h5,h6,p,div";var U=y.dom.is(W,V)&&W.parentNode.tagName==="LI"&&W.parentNode.lastChild===W;return y.selection.isCollapsed()&&U&&C()}function K(W,Y){if(A(Y)&&I()){var X=W.selection.getNode();var V=W.dom.create("li");var U=W.dom.getParent(X,"li");W.dom.insertAfter(V,U);if(tinymce.isIE6||tinymce.isIE7||tinyMCE.isIE8){W.selection.setCursorLocation(V,1)}else{W.selection.setCursorLocation(V,0)}Y.preventDefault()}}function u(X,Z){var ac;if(!tinymce.isGecko){return}var V=X.selection.getStart();if(Z.keyCode!=tinymce.VK.BACKSPACE||V.tagName!=="IMG"){return}function W(ag){var ah=ag.firstChild;var af=null;do{if(!ah){break}if(ah.tagName==="LI"){af=ah}}while(ah=ah.nextSibling);return af}function ae(ag,af){while(ag.childNodes.length>0){af.appendChild(ag.childNodes[0])}}ac=V.parentNode.previousSibling;if(!ac){return}var aa;if(ac.tagName==="UL"||ac.tagName==="OL"){aa=ac}else{if(ac.previousSibling&&(ac.previousSibling.tagName==="UL"||ac.previousSibling.tagName==="OL")){aa=ac.previousSibling}else{return}}var ad=W(aa);var U=X.dom.createRng();U.setStart(ad,1);U.setEnd(ad,1);X.selection.setRng(U);X.selection.collapse(true);var Y=X.selection.getBookmark();var ab=V.parentNode.cloneNode(true);if(ab.tagName==="P"||ab.tagName==="DIV"){ae(ab,ad)}else{ad.appendChild(ab)}V.parentNode.parentNode.removeChild(V.parentNode);X.selection.moveToBookmark(Y)}function G(U){var V=y.dom.getParent(U,"ol,ul");if(V!=null){var W=V.lastChild;y.selection.setCursorLocation(W,0)}}this.ed=y;y.addCommand("Indent",this.indent,this);y.addCommand("Outdent",this.outdent,this);y.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);y.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);y.onInit.add(function(){y.editorCommands.addCommands({outdent:function(){var V=y.selection,W=y.dom;function U(X){X=W.getParent(X,W.isBlock);return X&&(parseInt(y.dom.getStyle(X,"margin-left")||0,10)+parseInt(y.dom.getStyle(X,"padding-left")||0,10))>0}return U(V.getStart())||U(V.getEnd())||y.queryCommandState("InsertOrderedList")||y.queryCommandState("InsertUnorderedList")}},"state")});y.onKeyUp.add(function(V,W){if(x==v){V.execCommand(W.shiftKey?"Outdent":"Indent",true,null);x=N;return r.cancel(W)}else{if(x==s){var U=B();var Y=V.settings.list_outdent_on_enter===true||W.shiftKey;V.execCommand(Y?"Outdent":"Indent",true,null);if(tinymce.isIE){G(U)}return r.cancel(W)}else{if(x==J){if(tinymce.isIE6||tinymce.isIE7||tinymce.isIE8){var X=V.getDoc().createTextNode("\uFEFF");V.selection.getNode().appendChild(X)}else{if(tinymce.isIE9||tinymce.isGecko){V.execCommand("Outdent");return r.cancel(W)}}}}}});function L(V,U){var W=y.getDoc().createTextNode("\uFEFF");V.insertBefore(W,U);y.selection.setCursorLocation(W,0);y.execCommand("mceRepaint")}function R(V,X){if(T(X)){var U=B();if(U){var W=U.parentNode;var Y=W&&W.parentNode;if(Y&&Y.nodeName=="LI"&&Y.firstChild==W&&U==W.firstChild){L(Y,W)}}}}function S(V,X){if(T(X)){var U=B();if(V.dom.select("ul li",U).length===1){var W=U.firstChild;L(U,W)}}}function Q(W,aa){function X(ab){var ad=[];var ae=new tinymce.dom.TreeWalker(ab.firstChild,ab);for(var ac=ae.current();ac;ac=ae.next()){if(W.dom.is(ac,"ol,ul,li")){ad.push(ac)}}return ad}if(aa.keyCode==tinymce.VK.BACKSPACE){var U=B();if(U){var Z=W.dom.getParent(U,"ol,ul"),V=W.selection.getRng();if(Z&&Z.firstChild===U&&V.startOffset==0){var Y=X(U);Y.unshift(U);W.execCommand("Outdent",false,Y);W.undoManager.add();return r.cancel(aa)}}}}function O(V,X){var U=B();if(X.keyCode===tinymce.VK.BACKSPACE&&V.dom.is(U,"li")&&U.parentNode.firstChild!==U){if(V.dom.select("ul,ol",U).length===1){var Z=U.previousSibling;V.dom.remove(V.dom.select("br",U));V.dom.remove(U,true);var W=tinymce.grep(Z.childNodes,function(aa){return aa.nodeType===3});if(W.length===1){var Y=W[0];V.selection.setCursorLocation(Y,Y.length)}V.undoManager.add();return r.cancel(X)}}}y.onKeyDown.add(function(U,V){x=M(V)});y.onKeyDown.add(D);y.onKeyDown.add(u);y.onKeyDown.add(K);if(tinymce.isGecko){y.onKeyUp.add(R)}if(tinymce.isIE8){y.onKeyUp.add(S)}if(tinymce.isGecko||tinymce.isWebKit){y.onKeyDown.add(Q)}if(tinymce.isWebKit){y.onKeyDown.add(O)}},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(t){if(t.tagName==="LI"&&(M.tagName==="P"||G.length>1)){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true)}return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(P,L,N){var t,O=P,M;while(!I.isBlock(P.parentNode)&&P.parentNode!==I.getRoot()){P=I.split(P.parentNode,P.previousSibling);P=P.nextSibling;O=P}if(N){t=N.cloneNode(true);P.parentNode.insertBefore(t,P);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");P.parentNode.insertBefore(t,P)}while(O&&O!=L){M=O.nextSibling;t.appendChild(O);O=M}if(t.childNodes.length===0){t.innerHTML='
            '}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(U){if(U.hasAttribute&&U.hasAttribute("_mce_bogus")){return true}if(P(N,U)){I.addClass(U,"_mce_tagged_br");N=S(U)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w&&!H||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D,elements:this.selectedBlocks()}}else{B={defaultAction:x,elements:this.selectedBlocks(),processEvenIfEmpty:true}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true),elements:this.selectedBlocks()})},outdent:function(y,x){var w=this,u=w.ed,z=u.dom,s=[];function A(t){var C,B,D;if(!d(u,t,s)){if(z.getStyle(t,"margin-left")!==""||z.getStyle(t,"padding-left")!==""){return w.adjustPaddingFunction(false)(t)}D=z.getStyle(t,"text-align",true);if(D==="center"||D==="right"){z.setStyle(t,"text-align","left");return}t=c(t,z);C=t.parentNode;B=t.parentNode.parentNode;if(B.tagName==="P"){z.split(B,t.parentNode)}else{z.split(C,t);if(B.tagName==="LI"){z.split(B,t)}else{if(!z.is(B,"ol,ul")){z.rename(t,"p")}}}s.push(t)}}var v=x&&tinymce.is(x,"array")?x:this.selectedBlocks();this.process({LI:A,defaultAction:this.adjustPaddingFunction(false),elements:v});e(s,m)},process:function(y){var F=this,w=F.ed.selection,z=F.ed.dom,E,u;function B(t){var s=tinymce.grep(t.childNodes,function(H){return !(H.nodeName==="BR"||H.nodeName==="SPAN"&&z.getAttrib(H,"data-mce-type")=="bookmark"||H.nodeType==3&&(H.nodeValue==String.fromCharCode(160)||H.nodeValue==""))});return s.length===0}function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1||!y.processEvenIfEmpty&&E.length>1&&B(s)){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){F.splitSafeEach(s.childNodes,x,true)}function C(s,t){return t>=0&&s.hasChildNodes()&&t0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},selectedBlocks:function(){var s=this.ed,t=s.selection.getSelectedBlocks();return t.length==0?[s.dom.getRoot()]:t},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}()); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js new file mode 100644 index 00000000..1000ef74 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js @@ -0,0 +1,955 @@ +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Event = tinymce.dom.Event, bookmark; + + // Skips text nodes that only contain whitespace since they aren't semantically important. + function skipWhitespaceNodes(e, next) { + while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) { + e = next(e); + } + return e; + } + + function skipWhitespaceNodesBackwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.previousSibling; + }); + } + + function skipWhitespaceNodesForwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.nextSibling; + }); + } + + function hasParentInList(ed, e, list) { + return ed.dom.getParent(e, function(p) { + return tinymce.inArray(list, p) !== -1; + }); + } + + function isList(e) { + return e && (e.tagName === 'OL' || e.tagName === 'UL'); + } + + function splitNestedLists(element, dom) { + var tmp, nested, wrapItem; + tmp = skipWhitespaceNodesBackwards(element.lastChild); + while (isList(tmp)) { + nested = tmp; + tmp = skipWhitespaceNodesBackwards(nested.previousSibling); + } + if (nested) { + wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.split(element, nested); + dom.insertAfter(wrapItem, nested); + wrapItem.appendChild(nested); + wrapItem.appendChild(nested); + element = wrapItem.previousSibling; + } + return element; + } + + function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) { + e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs); + return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs); + } + + function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) { + var prev = skipWhitespaceNodesBackwards(e.previousSibling); + if (prev) { + return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) { + var next = skipWhitespaceNodesForwards(e.nextSibling); + if (next) { + return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) { + if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) { + return merge(e1, e2, differentStylesMasterElement); + } else if (e1 && e1.tagName === 'LI' && isList(e2)) { + // Fix invalidly nested lists. + e1.appendChild(e2); + } + return e2; + } + + function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) { + if (!e1 || !e2) { + return false; + } else if (e1.tagName === 'LI' && e2.tagName === 'LI') { + return e2.style.listStyleType === 'none' || containsOnlyAList(e2); + } else if (isList(e1)) { + return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2); + } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P'; + } + + function isListForIndent(e) { + var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild); + return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI)); + } + + function containsOnlyAList(e) { + var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild); + return firstChild && lastChild && firstChild === lastChild && isList(firstChild); + } + + function merge(e1, e2, masterElement) { + var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild); + if (e1.tagName === 'P') { + e1.appendChild(e1.ownerDocument.createElement('br')); + } + while (e2.firstChild) { + e1.appendChild(e2.firstChild); + } + if (masterElement) { + e1.style.listStyleType = masterElement.style.listStyleType; + } + e2.parentNode.removeChild(e2); + attemptMerge(lastOriginal, firstNew, false); + return e1; + } + + function findItemToOperateOn(e, dom) { + var item; + if (!dom.is(e, 'li,ol,ul')) { + item = dom.getParent(e, 'li'); + if (item) { + e = item; + } + } + return e; + } + + tinymce.create('tinymce.plugins.Lists', { + init: function(ed) { + var LIST_TABBING = 'TABBING'; + var LIST_EMPTY_ITEM = 'EMPTY'; + var LIST_ESCAPE = 'ESCAPE'; + var LIST_PARAGRAPH = 'PARAGRAPH'; + var LIST_UNKNOWN = 'UNKNOWN'; + var state = LIST_UNKNOWN; + + function isTabInList(e) { + // Don't indent on Ctrl+Tab or Alt+Tab + return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) && + (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList')); + } + + function isOnLastListItem() { + var li = getLi(); + var grandParent = li.parentNode.parentNode; + var isLastItem = li.parentNode.lastChild === li; + return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li); + } + + function isNestedList(grandParent) { + if (isList(grandParent)) { + return grandParent.parentNode && grandParent.parentNode.tagName === 'LI'; + } else { + return grandParent.tagName === 'LI'; + } + } + + function isInEmptyListItem() { + return ed.selection.isCollapsed() && isEmptyListItem(getLi()); + } + + function getLi() { + var n = ed.selection.getStart(); + // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position + return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n; + } + + function isEmptyListItem(li) { + var numChildren = li.childNodes.length; + if (li.tagName === 'LI') { + return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li)); + } + return false; + } + + function isEmptyIE9Li(li) { + // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these + var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'}); + var isLastLi = li == lis[lis.length - 1]; + var child = li.firstChild; + return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32)); + } + + function isEnter(e) { + return e.keyCode === tinymce.VK.ENTER; + } + + function isEnterWithoutShift(e) { + return isEnter(e) && !e.shiftKey; + } + + function getListKeyState(e) { + if (isTabInList(e)) { + return LIST_TABBING; + } else if (isEnterWithoutShift(e) && isOnLastListItem()) { + // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now + //return LIST_ESCAPE; + return LIST_UNKNOWN; + } else if (isEnterWithoutShift(e) && isInEmptyListItem()) { + return LIST_EMPTY_ITEM; + } else { + return LIST_UNKNOWN; + } + } + + function cancelDefaultEvents(ed, e) { + // list escape is done manually using outdent as it does not create paragraphs correctly in td's + if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) { + Event.cancel(e); + } + } + + function isCursorAtEndOfContainer() { + var range = ed.selection.getRng(true); + var startContainer = range.startContainer; + if (startContainer.nodeType == 3) { + var value = startContainer.nodeValue; + if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) { + // IE9 places a space on the end of the text in some cases so ignore last char + return (range.endOffset == value.length-1); + } else { + return (range.endOffset == value.length); + } + } else if (startContainer.nodeType == 1) { + return range.endOffset == startContainer.childNodes.length; + } + return false; + } + + /* + If we are at the end of a list item surrounded with an element, pressing enter should create a + new list item instead without splitting the element e.g. don't want to create new P or H1 tag + */ + function isEndOfListItem() { + var node = ed.selection.getNode(); + var validElements = 'h1,h2,h3,h4,h5,h6,p,div'; + var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node; + return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer(); + } + + // Creates a new list item after the current selection's list item parent + function createNewLi(ed, e) { + if (isEnterWithoutShift(e) && isEndOfListItem()) { + var node = ed.selection.getNode(); + var li = ed.dom.create("li"); + var parentLi = ed.dom.getParent(node, 'li'); + ed.dom.insertAfter(li, parentLi); + + // Move caret to new list element. + if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) { + // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic + //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point + ed.selection.setCursorLocation(li, 1); + } else { + ed.selection.setCursorLocation(li, 0); + } + e.preventDefault(); + } + } + + function imageJoiningListItem(ed, e) { + var prevSibling; + + if (!tinymce.isGecko) + return; + + var n = ed.selection.getStart(); + if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG') + return; + + function lastLI(node) { + var child = node.firstChild; + var li = null; + do { + if (!child) + break; + + if (child.tagName === 'LI') + li = child; + } while (child = child.nextSibling); + + return li; + } + + function addChildren(parentNode, destination) { + while (parentNode.childNodes.length > 0) + destination.appendChild(parentNode.childNodes[0]); + } + + // Check if there is a previous sibling + prevSibling = n.parentNode.previousSibling; + if (!prevSibling) + return; + + var ul; + if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL') + ul = prevSibling; + else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL')) + ul = prevSibling.previousSibling; + else + return; + + var li = lastLI(ul); + + // move the caret to the end of the list item + var rng = ed.dom.createRng(); + rng.setStart(li, 1); + rng.setEnd(li, 1); + ed.selection.setRng(rng); + ed.selection.collapse(true); + + // save a bookmark at the end of the list item + var bookmark = ed.selection.getBookmark(); + + // copy the image an its text to the list item + var clone = n.parentNode.cloneNode(true); + if (clone.tagName === 'P' || clone.tagName === 'DIV') + addChildren(clone, li); + else + li.appendChild(clone); + + // remove the old copy of the image + n.parentNode.parentNode.removeChild(n.parentNode); + + // move the caret where we saved the bookmark + ed.selection.moveToBookmark(bookmark); + } + + // fix the cursor position to ensure it is correct in IE + function setCursorPositionToOriginalLi(li) { + var list = ed.dom.getParent(li, 'ol,ul'); + if (list != null) { + var lastLi = list.lastChild; + // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic + //lastLi.appendChild(ed.getDoc().createElement('')); + ed.selection.setCursorLocation(lastLi, 0); + } + } + + this.ed = ed; + ed.addCommand('Indent', this.indent, this); + ed.addCommand('Outdent', this.outdent, this); + ed.addCommand('InsertUnorderedList', function() { + this.applyList('UL', 'OL'); + }, this); + ed.addCommand('InsertOrderedList', function() { + this.applyList('OL', 'UL'); + }, this); + + ed.onInit.add(function() { + ed.editorCommands.addCommands({ + 'outdent': function() { + var sel = ed.selection, dom = ed.dom; + + function hasStyleIndent(n) { + n = dom.getParent(n, dom.isBlock); + return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0; + } + + return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList'); + } + }, 'state'); + }); + + ed.onKeyUp.add(function(ed, e) { + if (state == LIST_TABBING) { + ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null); + state = LIST_UNKNOWN; + return Event.cancel(e); + } else if (state == LIST_EMPTY_ITEM) { + var li = getLi(); + var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey; + ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null); + if (tinymce.isIE) { + setCursorPositionToOriginalLi(li); + } + + return Event.cancel(e); + } else if (state == LIST_ESCAPE) { + if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) { + // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting. + // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after + // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag. + var n = ed.getDoc().createTextNode('\uFEFF'); + ed.selection.getNode().appendChild(n); + } else if (tinymce.isIE9 || tinymce.isGecko) { + // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour + // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves + ed.execCommand('Outdent'); + return Event.cancel(e); + } + } + }); + + function fixListItem(parent, reference) { + // a zero-sized non-breaking space is placed in the empty list item so that the nested list is + // displayed on the below line instead of next to it + var n = ed.getDoc().createTextNode('\uFEFF'); + parent.insertBefore(n, reference); + ed.selection.setCursorLocation(n, 0); + // repaint to remove rendering artifact. only visible when creating new list + ed.execCommand('mceRepaint'); + } + + function fixIndentedListItemForGecko(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (li) { + var parent = li.parentNode; + var grandParent = parent && parent.parentNode; + if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) { + fixListItem(grandParent, parent); + } + } + } + } + + function fixIndentedListItemForIE8(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (ed.dom.select('ul li', li).length === 1) { + var list = li.firstChild; + fixListItem(li, list); + } + } + } + + function fixDeletingFirstCharOfList(ed, e) { + function listElements(li) { + var elements = []; + var walker = new tinymce.dom.TreeWalker(li.firstChild, li); + for (var node = walker.current(); node; node = walker.next()) { + if (ed.dom.is(node, 'ol,ul,li')) { + elements.push(node); + } + } + return elements; + } + + if (e.keyCode == tinymce.VK.BACKSPACE) { + var li = getLi(); + if (li) { + var list = ed.dom.getParent(li, 'ol,ul'), + rng = ed.selection.getRng(); + if (list && list.firstChild === li && rng.startOffset == 0) { + var elements = listElements(li); + elements.unshift(li); + ed.execCommand("Outdent", false, elements); + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + } + + function fixDeletingEmptyLiInWebkit(ed, e) { + var li = getLi(); + if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) { + if (ed.dom.select('ul,ol', li).length === 1) { + var prevLi = li.previousSibling; + ed.dom.remove(ed.dom.select('br', li)); + ed.dom.remove(li, true); + var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 }); + if (textNodes.length === 1) { + var textNode = textNodes[0]; + ed.selection.setCursorLocation(textNode, textNode.length); + } + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + + ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); }); + ed.onKeyDown.add(cancelDefaultEvents); + ed.onKeyDown.add(imageJoiningListItem); + ed.onKeyDown.add(createNewLi); + + if (tinymce.isGecko) { + ed.onKeyUp.add(fixIndentedListItemForGecko); + } + if (tinymce.isIE8) { + ed.onKeyUp.add(fixIndentedListItemForIE8); + } + if (tinymce.isGecko || tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingFirstCharOfList); + } + if (tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingEmptyLiInWebkit); + } + }, + + applyList: function(targetListType, oppositeListType) { + var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions, + selectedBlocks = ed.selection.getSelectedBlocks(); + + function cleanupBr(e) { + if (e && e.tagName === 'BR') { + dom.remove(e); + } + } + + function makeList(element) { + var list = dom.create(targetListType), li; + + function adjustIndentForNewList(element) { + // If there's a margin-left, outdent one level to account for the extra list margin. + if (element.style.marginLeft || element.style.paddingLeft) { + t.adjustPaddingFunction(false)(element); + } + } + + if (element.tagName === 'LI') { + // No change required. + } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') { + processBrs(element, function(startSection, br) { + doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode); + li = startSection.parentNode; + adjustIndentForNewList(li); + cleanupBr(br); + }); + if (li) { + if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) { + dom.split(li.parentNode.parentNode, li.parentNode); + } + attemptMergeWithAdjacent(li.parentNode, true); + } + return; + } else { + // Put the list around the element. + li = dom.create('li'); + dom.insertAfter(li, element); + li.appendChild(element); + adjustIndentForNewList(element); + element = li; + } + dom.insertAfter(list, element); + list.appendChild(element); + attemptMergeWithAdjacent(list, true); + applied.push(element); + } + + function doWrapList(start, end, template) { + var li, n = start, tmp; + while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) { + start = dom.split(start.parentNode, start.previousSibling); + start = start.nextSibling; + n = start; + } + if (template) { + li = template.cloneNode(true); + start.parentNode.insertBefore(li, start); + while (li.firstChild) dom.remove(li.firstChild); + li = dom.rename(li, 'li'); + } else { + li = dom.create('li'); + start.parentNode.insertBefore(li, start); + } + while (n && n != end) { + tmp = n.nextSibling; + li.appendChild(n); + n = tmp; + } + if (li.childNodes.length === 0) { + li.innerHTML = '
            '; + } + makeList(li); + } + + function processBrs(element, callback) { + var startSection, previousBR, END_TO_START = 3, START_TO_END = 1, + breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl'; + + function isAnyPartSelected(start, end) { + var r = dom.createRng(), sel; + bookmark.keep = true; + ed.selection.moveToBookmark(bookmark); + bookmark.keep = false; + sel = ed.selection.getRng(true); + if (!end) { + end = start.parentNode.lastChild; + } + r.setStartBefore(start); + r.setEndAfter(end); + return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0); + } + + function nextLeaf(br) { + if (br.nextSibling) + return br.nextSibling; + if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot()) + return nextLeaf(br.parentNode); + } + + // Split on BRs within the range and process those. + startSection = element.firstChild; + // First mark the BRs that have any part of the previous section selected. + var trailingContentSelected = false; + each(dom.select(breakElements, element), function(br) { + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (isAnyPartSelected(startSection, br)) { + dom.addClass(br, '_mce_tagged_br'); + startSection = nextLeaf(br); + } + }); + trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined)); + startSection = element.firstChild; + each(dom.select(breakElements, element), function(br) { + // Got a section from start to br. + var tmp = nextLeaf(br); + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (dom.hasClass(br, '_mce_tagged_br')) { + callback(startSection, br, previousBR); + previousBR = null; + } else { + previousBR = br; + } + startSection = tmp; + }); + if (trailingContentSelected) { + callback(startSection, undefined, previousBR); + } + } + + function wrapList(element) { + processBrs(element, function(startSection, br, previousBR) { + // Need to indent this part + doWrapList(startSection, br); + cleanupBr(br); + cleanupBr(previousBR); + }); + } + + function changeList(element) { + if (tinymce.inArray(applied, element) !== -1) { + return; + } + if (element.parentNode.tagName === oppositeListType) { + dom.split(element.parentNode, element); + makeList(element); + attemptMergeWithNext(element.parentNode, false); + } + applied.push(element); + } + + function convertListItemToParagraph(element) { + var child, nextChild, mergedElement, splitLast; + if (tinymce.inArray(applied, element) !== -1) { + return; + } + element = splitNestedLists(element, dom); + while (dom.is(element.parentNode, 'ol,ul,li')) { + dom.split(element.parentNode, element); + } + // Push the original element we have from the selection, not the renamed one. + applied.push(element); + element = dom.rename(element, 'p'); + mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines); + if (mergedElement === element) { + // Now split out any block elements that can't be contained within a P. + // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each) + child = element.firstChild; + while (child) { + if (dom.isBlock(child)) { + child = dom.split(child.parentNode, child); + splitLast = true; + nextChild = child.nextSibling && child.nextSibling.firstChild; + } else { + nextChild = child.nextSibling; + if (splitLast && child.tagName === 'BR') { + dom.remove(child); + } + splitLast = false; + } + child = nextChild; + } + } + } + + each(selectedBlocks, function(e) { + e = findItemToOperateOn(e, dom); + if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) { + hasOppositeType = true; + } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) { + hasSameType = true; + } else { + hasNonList = true; + } + }); + + if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) { + actions = { + 'LI': changeList, + 'H1': makeList, + 'H2': makeList, + 'H3': makeList, + 'H4': makeList, + 'H5': makeList, + 'H6': makeList, + 'P': makeList, + 'BODY': makeList, + 'DIV': selectedBlocks.length > 1 ? makeList : wrapList, + defaultAction: wrapList, + elements: this.selectedBlocks() + }; + } else { + actions = { + defaultAction: convertListItemToParagraph, + elements: this.selectedBlocks(), + processEvenIfEmpty: true + }; + } + this.process(actions); + }, + + indent: function() { + var ed = this.ed, dom = ed.dom, indented = []; + + function createWrapItem(element) { + var wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.insertAfter(wrapItem, element); + return wrapItem; + } + + function createWrapList(element) { + var wrapItem = createWrapItem(element), + list = dom.getParent(element, 'ol,ul'), + listType = list.tagName, + listStyle = dom.getStyle(list, 'list-style-type'), + attrs = {}, + wrapList; + if (listStyle !== '') { + attrs.style = 'list-style-type: ' + listStyle + ';'; + } + wrapList = dom.create(listType, attrs); + wrapItem.appendChild(wrapList); + return wrapList; + } + + function indentLI(element) { + if (!hasParentInList(ed, element, indented)) { + element = splitNestedLists(element, dom); + var wrapList = createWrapList(element); + wrapList.appendChild(element); + attemptMergeWithAdjacent(wrapList.parentNode, false); + attemptMergeWithAdjacent(wrapList, false); + indented.push(element); + } + } + + this.process({ + 'LI': indentLI, + defaultAction: this.adjustPaddingFunction(true), + elements: this.selectedBlocks() + }); + + }, + + outdent: function(ui, elements) { + var t = this, ed = t.ed, dom = ed.dom, outdented = []; + + function outdentLI(element) { + var listElement, targetParent, align; + if (!hasParentInList(ed, element, outdented)) { + if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') { + return t.adjustPaddingFunction(false)(element); + } + align = dom.getStyle(element, 'text-align', true); + if (align === 'center' || align === 'right') { + dom.setStyle(element, 'text-align', 'left'); + return; + } + element = splitNestedLists(element, dom); + listElement = element.parentNode; + targetParent = element.parentNode.parentNode; + if (targetParent.tagName === 'P') { + dom.split(targetParent, element.parentNode); + } else { + dom.split(listElement, element); + if (targetParent.tagName === 'LI') { + // Nested list, need to split the LI and go back out to the OL/UL element. + dom.split(targetParent, element); + } else if (!dom.is(targetParent, 'ol,ul')) { + dom.rename(element, 'p'); + } + } + outdented.push(element); + } + } + + var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks(); + this.process({ + 'LI': outdentLI, + defaultAction: this.adjustPaddingFunction(false), + elements: listElements + }); + + each(outdented, attemptMergeWithAdjacent); + }, + + process: function(actions) { + var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r; + + function isEmptyElement(element) { + var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) { + return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark' + || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == '')); + }); + return excludeBrsAndBookmarks.length === 0; + } + + function processElement(element) { + dom.removeClass(element, '_mce_act_on'); + if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) { + return; + } + element = findItemToOperateOn(element, dom); + var action = actions[element.tagName]; + if (!action) { + action = actions.defaultAction; + } + action(element); + } + + function recurse(element) { + t.splitSafeEach(element.childNodes, processElement, true); + } + + function brAtEdgeOfSelection(container, offset) { + return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length && + container.childNodes[offset].tagName === 'BR'; + } + + function isInTable() { + var n = sel.getNode(); + var p = dom.getParent(n, 'td'); + return p !== null; + } + + selectedBlocks = actions.elements; + + r = sel.getRng(true); + if (!r.collapsed) { + if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) { + r.setEnd(r.endContainer, r.endOffset - 1); + sel.setRng(r); + } + if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) { + r.setStart(r.startContainer, r.startOffset + 1); + sel.setRng(r); + } + } + + + if (tinymce.isIE8) { + // append a zero sized nbsp so that caret is restored correctly using bookmark + var s = t.ed.selection.getNode(); + if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) { + var i = t.ed.getDoc().createTextNode('\uFEFF'); + s.appendChild(i); + } + } + + bookmark = sel.getBookmark(); + actions.OL = actions.UL = recurse; + t.splitSafeEach(selectedBlocks, processElement); + sel.moveToBookmark(bookmark); + bookmark = null; + + // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6 + if (!isInTable()) { + // Avoids table or image handles being left behind in Firefox. + t.ed.execCommand('mceRepaint'); + } + }, + + splitSafeEach: function(elements, f, forceClassBase) { + if (forceClassBase || + (tinymce.isGecko && + (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) || + /Firefox\/3\.[0-4]/.test(navigator.userAgent)))) { + this.classBasedEach(elements, f); + } else { + each(elements, f); + } + }, + + classBasedEach: function(elements, f) { + var dom = this.ed.dom, nodes, element; + // Mark nodes + each(elements, function(element) { + dom.addClass(element, '_mce_act_on'); + }); + nodes = dom.select('._mce_act_on'); + while (nodes.length > 0) { + element = nodes.shift(); + dom.removeClass(element, '_mce_act_on'); + f(element); + nodes = dom.select('._mce_act_on'); + } + }, + + adjustPaddingFunction: function(isIndent) { + var indentAmount, indentUnits, ed = this.ed; + indentAmount = ed.settings.indentation; + indentUnits = /[a-z%]+/i.exec(indentAmount); + indentAmount = parseInt(indentAmount, 10); + return function(element) { + var currentIndent, newIndentAmount; + currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10); + if (isIndent) { + newIndentAmount = currentIndent + indentAmount; + } else { + newIndentAmount = currentIndent - indentAmount; + } + ed.dom.setStyle(element, 'padding-left', ''); + ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : ''); + }; + }, + + selectedBlocks: function() { + var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks(); + return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks; + }, + + getInfo: function() { + return { + longname : 'Lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + tinymce.PluginManager.add("lists", tinymce.plugins.Lists); +}()); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/css/media.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/css/media.css new file mode 100644 index 00000000..0c45c7ff --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/css/media.css @@ -0,0 +1,17 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js new file mode 100644 index 00000000..9ac42e0d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),a=tinymce.makeMap(b.join(",")),f=tinymce.html.Node,d,i,h=tinymce.util.JSON,g;d=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function e(j){return typeof(j)=="string"?j.replace(/[^0-9%]/g,""):j}function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(s){return s&&s.nodeName==="IMG"&&n.dom.hasClass(s,"mceItemMedia")}r.editor=n;r.url=j;i="";for(m=0;m0){O+=(O?"&":"")+P+"="+escape(Q)}});if(O.length){G.params.flashvars=O}L=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(L,function(Q,P){G.params[P]=""+Q})}}G=z.attr("data-mce-json");if(!G){return}G=h.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}G.width=z.attr("width")||G.width;G.height=z.attr("height")||G.height;if(q.name==="Iframe"){x=new f("iframe",1);tinymce.each(b,function(n){var J=z.attr(n);if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&J.length>0){x.attr(n,J)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new f("script",1).attr("type","text/javascript");y=new f("#text",3);y.value="write"+q.name+"("+h.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new f("video",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style'); + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Use node width/height to override the data width/height when the placeholder is resized + data.width = node.attr('width') || data.width; + data.height = node.attr('height') || data.height; + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } + + data.params.src = ''; + } + + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: node.attr('type') + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } + + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = normalizeSize(iframe.attr('width')); + height = normalizeSize(iframe.attr('height')); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } + + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; + + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + + function get(id) { + return document.getElementById(id); + } + + function clone(obj) { + var i, len, copy, attr; + + if (null == obj || "object" != typeof obj) + return obj; + + // Handle Array + if ('length' in obj) { + copy = []; + + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } + + return copy; + } + + // Handle Object + copy = {}; + for (attr in obj) { + if (obj.hasOwnProperty(attr)) + copy[attr] = clone(obj[attr]); + } + + return copy; + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value, name) { + if (typeof(value) != 'undefined' && value != null) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') { + value = value.toLowerCase(); + value = (!name && value === 'true') || (name && value === name.toLowerCase()); + } + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor, self = this; + + self.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media'); + + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube Embed + if (src.match(/youtube\.com\/embed\/\w+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + setVal('src', src); + setVal('media_type', data.type); + } else { + // YouTube *NEW* + if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube\.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + } + + // Google video + if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + // Vimeo + if (src.match(/vimeo\.com\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // stream.cz + if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google maps + if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed"; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + }, + + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } + + return '' + } + + var html = ""; + + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js new file mode 100644 index 00000000..6d0de767 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.media_dlg',{list:"Liste",file:"Datei/URL",advanced:"Erweitert",general:"Allgemein",title:"Multimedia-Inhalte einf\u00fcgen/bearbeiten","align_top_left":"Oben Links","align_center":"Zentriert","align_left":"Links","align_bottom":"Unten","align_right":"Rechts","align_top":"Oben","qt_stream_warn":"In den Erweiterten Einstellungen sollten im Feld \'QT Src\' gestreamte RTSP Resourcen hinzugef\u00fcgt werden.\nZus\u00e4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.",qtsrc:"Angabe zu QT Src",progress:"Fortschritt",sound:"Ton",swstretchvalign:"Stretch V-Ausrichtung",swstretchhalign:"Stretch H-Ausrichtung",swstretchstyle:"Stretch-Art",scriptcallbacks:"Script callbacks","align_top_right":"Oben Rechts",uimode:"UI Modus",rate:"Rate",playcount:"Z\u00e4hler",defaultframe:"Frame-Voreinstellung",currentposition:"Aktuelle Position",currentmarker:"Aktueller Marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Fensterloses Video",stretchtofit:"Anzeigefl\u00e4che an verf\u00fcgbaren Platz anpassen",mute:"Stumm",invokeurls:"Invoke URLs",fullscreen:"Vollbild",enabled:"Aktiviert",autostart:"Autostart",volume:"Lautst\u00e4rke",target:"Ziel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Endzeitpunkt",starttime:"Startzeitpunkt",enablejavascript:"JavaScript aktivieren",correction:"Ohne Korrektur",targetcache:"Ziel zwischenspeichern",playeveryframe:"Jeden Frame abspielen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Men\u00fc anzeigen",loop:"Wiederholung",play:"Automatisches Abspielen",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand","class_name":"CSS-Klasse",name:"Name",id:"Id",type:"Typ",size:"Abmessungen",preview:"Vorschau","constrain_proportions":"Proportionen erhalten",controls:"Steuerung",numloop:"Anzahl Wiederholungen",console:"Konsole",cache:"Zwischenspeicher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvariablen",base:"Base",bgcolor:"Hintergrund",wmode:"WMode",salign:"S-Ausrichtung",align:"Ausrichtung",scale:"Skalierung",quality:"Qualit\u00e4t",shuffle:"Zuf\u00e4llige Wiedergabe",prefetch:"Prefetch",nojava:"Kein Java",maintainaspect:"Bildverh\u00e4ltnis beibehalten",imagestatus:"Bildstatus",center:"Zentriert",autogotourl:"Auto goto URL","shockwave_options":"Shockwave-Optionen","rmp_options":"Optionen f\u00fcr Real Media Player","wmp_options":"Optionen f\u00fcr Windows Media Player","qt_options":"Quicktime-Optionen","flash_options":"Flash-Optionen",hidden:"Versteckt","align_bottom_left":"Unten Links","align_bottom_right":"Unten Rechts",flash:"Flash",quicktime:"QuickTime","embedded_audio_options":"Integrierte Audio Optionen",windowsmedia:"WindowsMedia",realmedia:"RealMedia",shockwave:"ShockWave",audio:"Audio",video:"Video","html5_video_options":"HTML5 Video Optionen",altsource1:"Alternative Quelle 1",altsource2:"Alternative Quelle 2",preload:"Preload",poster:"Poster",source:"Quelle","html5_audio_options":"Audio Optionen","preload_none":"Nicht vorladen","preload_metadata":"Video Metadaten vorladen","preload_auto":"Benutzer Browser entscheidet automatisch",iframe:"iFrame",embeddedaudio:"Audio (eingebunden)"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js new file mode 100644 index 00000000..ecef3a80 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" }); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/media.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/media.htm new file mode 100644 index 00000000..06a67f79 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/media.htm @@ -0,0 +1,819 @@ + + + + {#media_dlg.title} + + + + + + + + + +
            + +
            +
            +
            + {#media_dlg.general} +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + x + px +

            + + +

            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            + +
            +
            + {#media_dlg.advanced} +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            + +
            +
            +

            {#media_dlg.html5_video_options}

            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.embedded_audio_options}

            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.html5_audio_options}

            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.flash_options}

            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.qt_options}

            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.wmp_options}

            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.rmp_options}

            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.shockwave_options}

            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            +
            + +
            +
            + {#media_dlg.source} + +
            +
            + +
            +
            +
              +
            • +
            • +
            +



            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf new file mode 100644 index 00000000..585d772d Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css new file mode 100644 index 00000000..0c45c7ff --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css @@ -0,0 +1,17 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js new file mode 100644 index 00000000..9ac42e0d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),a=tinymce.makeMap(b.join(",")),f=tinymce.html.Node,d,i,h=tinymce.util.JSON,g;d=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function e(j){return typeof(j)=="string"?j.replace(/[^0-9%]/g,""):j}function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(s){return s&&s.nodeName==="IMG"&&n.dom.hasClass(s,"mceItemMedia")}r.editor=n;r.url=j;i="";for(m=0;m0){O+=(O?"&":"")+P+"="+escape(Q)}});if(O.length){G.params.flashvars=O}L=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(L,function(Q,P){G.params[P]=""+Q})}}G=z.attr("data-mce-json");if(!G){return}G=h.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}G.width=z.attr("width")||G.width;G.height=z.attr("height")||G.height;if(q.name==="Iframe"){x=new f("iframe",1);tinymce.each(b,function(n){var J=z.attr(n);if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&J.length>0){x.attr(n,J)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new f("script",1).attr("type","text/javascript");y=new f("#text",3);y.value="write"+q.name+"("+h.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new f("video",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style'); + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Use node width/height to override the data width/height when the placeholder is resized + data.width = node.attr('width') || data.width; + data.height = node.attr('height') || data.height; + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } + + data.params.src = ''; + } + + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: node.attr('type') + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } + + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = normalizeSize(iframe.attr('width')); + height = normalizeSize(iframe.attr('height')); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } + + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; + + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + + function get(id) { + return document.getElementById(id); + } + + function clone(obj) { + var i, len, copy, attr; + + if (null == obj || "object" != typeof obj) + return obj; + + // Handle Array + if ('length' in obj) { + copy = []; + + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } + + return copy; + } + + // Handle Object + copy = {}; + for (attr in obj) { + if (obj.hasOwnProperty(attr)) + copy[attr] = clone(obj[attr]); + } + + return copy; + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value, name) { + if (typeof(value) != 'undefined' && value != null) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') { + value = value.toLowerCase(); + value = (!name && value === 'true') || (name && value === name.toLowerCase()); + } + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor, self = this; + + self.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media'); + + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube Embed + if (src.match(/youtube\.com\/embed\/\w+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + setVal('src', src); + setVal('media_type', data.type); + } else { + // YouTube *NEW* + if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube\.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + } + + // Google video + if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + // Vimeo + if (src.match(/vimeo\.com\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // stream.cz + if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google maps + if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed"; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + }, + + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } + + return '' + } + + var html = ""; + + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js new file mode 100644 index 00000000..6d0de767 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.media_dlg',{list:"Liste",file:"Datei/URL",advanced:"Erweitert",general:"Allgemein",title:"Multimedia-Inhalte einf\u00fcgen/bearbeiten","align_top_left":"Oben Links","align_center":"Zentriert","align_left":"Links","align_bottom":"Unten","align_right":"Rechts","align_top":"Oben","qt_stream_warn":"In den Erweiterten Einstellungen sollten im Feld \'QT Src\' gestreamte RTSP Resourcen hinzugef\u00fcgt werden.\nZus\u00e4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.",qtsrc:"Angabe zu QT Src",progress:"Fortschritt",sound:"Ton",swstretchvalign:"Stretch V-Ausrichtung",swstretchhalign:"Stretch H-Ausrichtung",swstretchstyle:"Stretch-Art",scriptcallbacks:"Script callbacks","align_top_right":"Oben Rechts",uimode:"UI Modus",rate:"Rate",playcount:"Z\u00e4hler",defaultframe:"Frame-Voreinstellung",currentposition:"Aktuelle Position",currentmarker:"Aktueller Marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Fensterloses Video",stretchtofit:"Anzeigefl\u00e4che an verf\u00fcgbaren Platz anpassen",mute:"Stumm",invokeurls:"Invoke URLs",fullscreen:"Vollbild",enabled:"Aktiviert",autostart:"Autostart",volume:"Lautst\u00e4rke",target:"Ziel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Endzeitpunkt",starttime:"Startzeitpunkt",enablejavascript:"JavaScript aktivieren",correction:"Ohne Korrektur",targetcache:"Ziel zwischenspeichern",playeveryframe:"Jeden Frame abspielen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Men\u00fc anzeigen",loop:"Wiederholung",play:"Automatisches Abspielen",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand","class_name":"CSS-Klasse",name:"Name",id:"Id",type:"Typ",size:"Abmessungen",preview:"Vorschau","constrain_proportions":"Proportionen erhalten",controls:"Steuerung",numloop:"Anzahl Wiederholungen",console:"Konsole",cache:"Zwischenspeicher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvariablen",base:"Base",bgcolor:"Hintergrund",wmode:"WMode",salign:"S-Ausrichtung",align:"Ausrichtung",scale:"Skalierung",quality:"Qualit\u00e4t",shuffle:"Zuf\u00e4llige Wiedergabe",prefetch:"Prefetch",nojava:"Kein Java",maintainaspect:"Bildverh\u00e4ltnis beibehalten",imagestatus:"Bildstatus",center:"Zentriert",autogotourl:"Auto goto URL","shockwave_options":"Shockwave-Optionen","rmp_options":"Optionen f\u00fcr Real Media Player","wmp_options":"Optionen f\u00fcr Windows Media Player","qt_options":"Quicktime-Optionen","flash_options":"Flash-Optionen",hidden:"Versteckt","align_bottom_left":"Unten Links","align_bottom_right":"Unten Rechts",flash:"Flash",quicktime:"QuickTime","embedded_audio_options":"Integrierte Audio Optionen",windowsmedia:"WindowsMedia",realmedia:"RealMedia",shockwave:"ShockWave",audio:"Audio",video:"Video","html5_video_options":"HTML5 Video Optionen",altsource1:"Alternative Quelle 1",altsource2:"Alternative Quelle 2",preload:"Preload",poster:"Poster",source:"Quelle","html5_audio_options":"Audio Optionen","preload_none":"Nicht vorladen","preload_metadata":"Video Metadaten vorladen","preload_auto":"Benutzer Browser entscheidet automatisch",iframe:"iFrame",embeddedaudio:"Audio (eingebunden)"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js new file mode 100644 index 00000000..ecef3a80 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" }); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm new file mode 100644 index 00000000..957d83a6 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm @@ -0,0 +1,922 @@ + + + + {#media_dlg.title} + + + + + + + + + +
            + + +
            +
            +
            + {#media_dlg.general} + + + + + + + + + + + + + + + + + + +
            + +
            + + + + + +
             
            +
            + + + + + + +
            x   
            +
            +
            + +
            + {#media_dlg.preview} + +
            +
            + +
            +
            + {#media_dlg.advanced} + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + + + +
             
            +
            +
            + +
            + {#media_dlg.html5_video_options} + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + +
            + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.embedded_audio_options} + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.html5_audio_options} + + + + + + + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + +
            + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + +
            + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + + + + + + + +
            +
            + +
            + {#media_dlg.qt_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +  
            + + + + + +
             
            +
            +
            + +
            + {#media_dlg.wmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.rmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +   +
            +
            + +
            + {#media_dlg.shockwave_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            +
            + +
            +
            + {#media_dlg.source} + +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf new file mode 100644 index 00000000..585d772d Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js new file mode 100644 index 00000000..687f5486 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js new file mode 100644 index 00000000..d492fbef --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Nonbreaking', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceNonBreaking', function() { + ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); + }); + + // Register buttons + ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); + + if (ed.getParam('nonbreaking_force_tab')) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode == 9) { + e.preventDefault(); + + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + } + }); + } + }, + + getInfo : function() { + return { + longname : 'Nonbreaking space', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + + // Private methods + }); + + // Register plugin + tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js new file mode 100644 index 00000000..da411ebc --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret",r="\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return !D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(z,B){var F=B.keyCode,x,C,D,v;function u(H,G){while(H=H[G?"previousSibling":"nextSibling"]){if(H.nodeType!==3||H.nodeValue.length>0){return H}}}function y(G,H){p.select(G);p.collapse(H)}function t(K){var J,I,M,H;function G(O){var N=I;while(N){if(N===O){return}N=N.parentNode}j.remove(O);q()}function L(){var O,P,N=z.schema.getNonEmptyElements();P=new tinymce.dom.TreeWalker(I,z.getBody());while(O=(K?P.prev():P.next())){if(N[O.nodeName.toLowerCase()]){break}if(O.nodeType===3&&tinymce.trim(O.nodeValue).length>0){break}if(m(O)==="false"){G(O);return true}}if(g(O)){return true}return false}if(p.isCollapsed()){J=p.getRng(true);I=J.startContainer;M=J.startOffset;I=l(I)||I;if(H=g(I)){G(H);return false}if(I.nodeType==3&&(K?M>0:M124)&&F!=e.DELETE&&F!=e.BACKSPACE){if((tinymce.isMac?B.metaKey:B.ctrlKey)&&(F==67||F==88||F==86)){return}B.preventDefault();if(F==e.LEFT||F==e.RIGHT){var w=F==e.LEFT;if(z.dom.isBlock(x)){var A=w?x.previousSibling:x.nextSibling;var s=new c(A,A);var E=w?s.prev():s.next();y(E,!w)}else{y(x,w)}}}else{if(F==e.LEFT||F==e.RIGHT||F==e.BACKSPACE||F==e.DELETE){C=l(D);if(C){if(F==e.LEFT||F==e.BACKSPACE){x=u(C,true);if(x&&m(x)==="false"){B.preventDefault();if(F==e.LEFT){y(x,true)}else{j.remove(x);return}}else{i(C)}}if(F==e.RIGHT||F==e.DELETE){x=u(C);if(x&&m(x)==="false"){B.preventDefault();if(F==e.RIGHT){y(x,false)}else{j.remove(x);return}}else{i(C)}}}if((F==e.BACKSPACE||F==e.DELETE)&&!t(F==e.BACKSPACE)){B.preventDefault();return false}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){q()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(i,k){var h,g,j;function f(m,n){var o=j.length,p=n.content,l=tinymce.trim(g);if(n.format=="raw"){return}while(o--){p=p.replace(j[o],function(s){var r=arguments,q=r[r.length-2];if(q>0&&p.charAt(q-1)=='"'){return s}return''+m.dom.encode(typeof(r[1])==="string"?r[1]:r[0])+""})}n.content=p}h=" "+tinymce.trim(i.getParam("noneditable_editable_class","mceEditable"))+" ";g=" "+tinymce.trim(i.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";j=i.getParam("noneditable_regexp");if(j&&!j.length){j=[j]}i.onPreInit.add(function(){b(i);if(j){i.selection.onBeforeSetContent.add(f);i.onBeforeSetContent.add(f)}i.parser.addAttributeFilter("class",function(l){var m=l.length,n,o;while(m--){o=l[m];n=" "+o.attr("class")+" ";if(n.indexOf(h)!==-1){o.attr(d,"true")}else{if(n.indexOf(g)!==-1){o.attr(d,"false")}}}});i.serializer.addAttributeFilter(d,function(l,m){var n=l.length,o;while(n--){o=l[n];if(j&&o.attr("data-mce-content")){o.name="#text";o.type=3;o.raw=true;o.value=o.attr("data-mce-content")}else{o.attr(a,null);o.attr(d,null)}}});i.parser.addAttributeFilter(a,function(l,m){var n=l.length,o;while(n--){o=l[n];o.attr(d,o.attr(a));o.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js new file mode 100644 index 00000000..a18bcd78 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js @@ -0,0 +1,537 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var TreeWalker = tinymce.dom.TreeWalker; + var externalName = 'contenteditable', internalName = 'data-mce-' + externalName; + var VK = tinymce.VK; + + function handleContentEditableSelection(ed) { + var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF'; + + // Returns the content editable state of a node "true/false" or null + function getContentEditable(node) { + var contentEditable; + + // Ignore non elements + if (node.nodeType === 1) { + // Check for fake content editable + contentEditable = node.getAttribute(internalName); + if (contentEditable && contentEditable !== "inherit") { + return contentEditable; + } + + // Check for real content editable + contentEditable = node.contentEditable; + if (contentEditable !== "inherit") { + return contentEditable; + } + } + + return null; + }; + + // Returns the noneditable parent or null if there is a editable before it or if it wasn't found + function getNonEditableParent(node) { + var state; + + while (node) { + state = getContentEditable(node); + if (state) { + return state === "false" ? node : null; + } + + node = node.parentNode; + } + }; + + // Get caret container parent for the specified node + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } + + node = node.parentNode; + } + }; + + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; + + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Insert caret container before/after target or expand selection to include block + function insertCaretContainerOrExpandToBlock(target, before) { + var caretContainer, rng; + + // Select block + if (getContentEditable(target) === "false") { + if (dom.isBlock(target)) { + selection.select(target); + return; + } + } + + rng = dom.createRng(); + + if (getContentEditable(target) === "true") { + if (!target.firstChild) { + target.appendChild(ed.getDoc().createTextNode('\u00a0')); + } + + target = target.firstChild; + before = true; + } + + //caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar); + caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar); + + if (before) { + target.parentNode.insertBefore(caretContainer, target); + } else { + dom.insertAfter(caretContainer, target); + } + + rng.setStart(caretContainer.firstChild, 1); + rng.collapse(true); + selection.setRng(rng); + + return caretContainer; + }; + + // Removes any caret container except the one we might be in + function removeCaretContainer(caretContainer) { + var child, currentCaretContainer, lastContainer; + + if (caretContainer) { + rng = selection.getRng(true); + rng.setStartBefore(caretContainer); + rng.setEndBefore(caretContainer); + + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + + selection.setRng(rng); + } else { + currentCaretContainer = getParentCaretContainer(selection.getStart()); + while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) { + if (currentCaretContainer !== caretContainer) { + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + } + + lastContainer = caretContainer; + } + } + }; + + // Modifies the selection to include contentEditable false elements or insert caret containers + function moveSelection() { + var nonEditableStart, nonEditableEnd, isCollapsed, rng, element; + + // Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside + function hasSideContent(element, left) { + var container, offset, walker, node, len; + + container = rng.startContainer; + offset = rng.startOffset; + + // If endpoint is in middle of text node then expand to beginning/end of element + if (container.nodeType == 3) { + len = container.nodeValue.length; + if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) { + return; + } + } else { + // Can we resolve the node by index + if (offset < container.childNodes.length) { + // Browser represents caret position as the offset at the start of an element. When moving right + // this is the element we are moving into so we consider our container to be child node at offset-1 + var pos = !left && offset > 0 ? offset-1 : offset; + container = container.childNodes[pos]; + if (container.hasChildNodes()) { + container = container.firstChild; + } + } else { + // If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element + return !left ? element : null; + } + } + + // Walk left/right to look for contents + walker = new TreeWalker(container, element); + while (node = walker[left ? 'prev' : 'next']()) { + if (node.nodeType === 3 && node.nodeValue.length > 0) { + return; + } else if (getContentEditable(node) === "true") { + // Found contentEditable=true element return this one to we can move the caret inside it + return node; + } + } + + return element; + }; + + // Remove any existing caret containers + removeCaretContainer(); + + // Get noneditable start/end elements + isCollapsed = selection.isCollapsed(); + nonEditableStart = getNonEditableParent(selection.getStart()); + nonEditableEnd = getNonEditableParent(selection.getEnd()); + + // Is any fo the range endpoints noneditable + if (nonEditableStart || nonEditableEnd) { + rng = selection.getRng(true); + + // If it's a caret selection then look left/right to see if we need to move the caret out side or expand + if (isCollapsed) { + nonEditableStart = nonEditableStart || nonEditableEnd; + var start = selection.getStart(); + if (element = hasSideContent(nonEditableStart, true)) { + // We have no contents to the left of the caret then insert a caret container before the noneditable element + insertCaretContainerOrExpandToBlock(element, true); + } else if (element = hasSideContent(nonEditableStart, false)) { + // We have no contents to the right of the caret then insert a caret container after the noneditable element + insertCaretContainerOrExpandToBlock(element, false); + } else { + // We are in the middle of a noneditable so expand to select it + selection.select(nonEditableStart); + } + } else { + rng = selection.getRng(true); + + // Expand selection to include start non editable element + if (nonEditableStart) { + rng.setStartBefore(nonEditableStart); + } + + // Expand selection to include end non editable element + if (nonEditableEnd) { + rng.setEndAfter(nonEditableEnd); + } + + selection.setRng(rng); + } + } + }; + + function handleKey(ed, e) { + var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement; + + function getNonEmptyTextNodeSibling(node, prev) { + while (node = node[prev ? 'previousSibling' : 'nextSibling']) { + if (node.nodeType !== 3 || node.nodeValue.length > 0) { + return node; + } + } + }; + + function positionCaretOnElement(element, start) { + selection.select(element); + selection.collapse(start); + } + + function canDelete(backspace) { + var rng, container, offset, nonEditableParent; + + function removeNodeIfNotParent(node) { + var parent = container; + + while (parent) { + if (parent === node) { + return; + } + + parent = parent.parentNode; + } + + dom.remove(node); + moveSelection(); + } + + function isNextPrevTreeNodeNonEditable() { + var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements(); + + walker = new tinymce.dom.TreeWalker(container, ed.getBody()); + while (node = (backspace ? walker.prev() : walker.next())) { + // Found IMG/INPUT etc + if (nonEmptyElements[node.nodeName.toLowerCase()]) { + break; + } + + // Found text node with contents + if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) { + break; + } + + // Found non editable node + if (getContentEditable(node) === "false") { + removeNodeIfNotParent(node); + return true; + } + } + + // Check if the content node is within a non editable parent + if (getNonEditableParent(node)) { + return true; + } + + return false; + } + + if (selection.isCollapsed()) { + rng = selection.getRng(true); + container = rng.startContainer; + offset = rng.startOffset; + container = getParentCaretContainer(container) || container; + + // Is in noneditable parent + if (nonEditableParent = getNonEditableParent(container)) { + removeNodeIfNotParent(nonEditableParent); + return false; + } + + // Check if the caret is in the middle of a text node + if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) { + return true; + } + + // Resolve container index + if (container.nodeType == 1) { + container = container.childNodes[offset] || container; + } + + // Check if previous or next tree node is non editable then block the event + if (isNextPrevTreeNodeNonEditable()) { + return false; + } + } + + return true; + } + + startElement = selection.getStart() + endElement = selection.getEnd(); + + // Disable all key presses in contentEditable=false except delete or backspace + nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement); + if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) { + // Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior + if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) { + return; + } + + e.preventDefault(); + + // Arrow left/right select the element and collapse left/right + if (keyCode == VK.LEFT || keyCode == VK.RIGHT) { + var left = keyCode == VK.LEFT; + // If a block element find previous or next element to position the caret + if (ed.dom.isBlock(nonEditableParent)) { + var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling; + var walker = new TreeWalker(targetElement, targetElement); + var caretElement = left ? walker.prev() : walker.next(); + positionCaretOnElement(caretElement, !left); + } else { + positionCaretOnElement(nonEditableParent, left); + } + } + } else { + // Is arrow left/right, backspace or delete + if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) { + caretContainer = getParentCaretContainer(startElement); + if (caretContainer) { + // Arrow left or backspace + if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.LEFT) { + positionCaretOnElement(nonEditableParent, true); + } else { + dom.remove(nonEditableParent); + return; + } + } else { + removeCaretContainer(caretContainer); + } + } + + // Arrow right or delete + if (keyCode == VK.RIGHT || keyCode == VK.DELETE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.RIGHT) { + positionCaretOnElement(nonEditableParent, false); + } else { + dom.remove(nonEditableParent); + return; + } + } else { + removeCaretContainer(caretContainer); + } + } + } + + if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) { + e.preventDefault(); + return false; + } + } + } + }; + + ed.onMouseDown.addToTop(function(ed, e) { + var node = ed.selection.getNode(); + + if (getContentEditable(node) === "false" && node == e.target) { + // Expand selection on mouse down we can't block the default event since it's used for drag/drop + moveSelection(); + } + }); + + ed.onMouseUp.addToTop(moveSelection); + ed.onKeyDown.addToTop(handleKey); + ed.onKeyUp.addToTop(moveSelection); + }; + + tinymce.create('tinymce.plugins.NonEditablePlugin', { + init : function(ed, url) { + var editClass, nonEditClass, nonEditableRegExps; + + // Converts configured regexps to noneditable span items + function convertRegExpsToNonEditable(ed, args) { + var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass); + + // Don't replace the variables when raw is used for example on undo/redo + if (args.format == "raw") { + return; + } + + while (i--) { + content = content.replace(nonEditableRegExps[i], function(match) { + var args = arguments, index = args[args.length - 2]; + + // Is value inside an attribute then don't replace + if (index > 0 && content.charAt(index - 1) == '"') { + return match; + } + + return '' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + ''; + }); + } + + args.content = content; + }; + + editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " "; + nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " "; + + // Setup noneditable regexps array + nonEditableRegExps = ed.getParam("noneditable_regexp"); + if (nonEditableRegExps && !nonEditableRegExps.length) { + nonEditableRegExps = [nonEditableRegExps]; + } + + ed.onPreInit.add(function() { + handleContentEditableSelection(ed); + + if (nonEditableRegExps) { + ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable); + ed.onBeforeSetContent.add(convertRegExpsToNonEditable); + } + + // Apply contentEditable true/false on elements with the noneditable/editable classes + ed.parser.addAttributeFilter('class', function(nodes) { + var i = nodes.length, className, node; + + while (i--) { + node = nodes[i]; + className = " " + node.attr("class") + " "; + + if (className.indexOf(editClass) !== -1) { + node.attr(internalName, "true"); + } else if (className.indexOf(nonEditClass) !== -1) { + node.attr(internalName, "false"); + } + } + }); + + // Remove internal name + ed.serializer.addAttributeFilter(internalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (nonEditableRegExps && node.attr('data-mce-content')) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = node.attr('data-mce-content'); + } else { + node.attr(externalName, null); + node.attr(internalName, null); + } + } + }); + + // Convert external name into internal name + ed.parser.addAttributeFilter(externalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr(internalName, node.attr(externalName)); + node.attr(externalName, null); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'Non editable elements', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js new file mode 100644 index 00000000..35085e8a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js new file mode 100644 index 00000000..a094c191 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -0,0 +1,74 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.PageBreakPlugin', { + init : function(ed, url) { + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + + pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); + + // Register commands + ed.addCommand('mcePageBreak', function() { + ed.execCommand('mceInsertContent', 0, pb); + }); + + // Register buttons + ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); + + ed.onInit.add(function() { + if (ed.theme.onResolveName) { + ed.theme.onResolveName.add(function(th, o) { + if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) + o.name = 'pagebreak'; + }); + } + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) + ed.selection.select(e); + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(pbRE, pb); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = o.content.replace(/]+>/g, function(im) { + if (im.indexOf('class="mcePageBreak') !== -1) + im = sep; + + return im; + }); + }); + }, + + getInfo : function() { + return { + longname : 'PageBreak', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css new file mode 100644 index 00000000..fca2dce9 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css @@ -0,0 +1,3 @@ +iframe { + border: none !important; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js new file mode 100644 index 00000000..0ab05ebb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"
            ")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

            "+o.encode(r).replace(/\r?\n\r?\n/g,"

            ").replace(/\r?\n/g,"
            ")+"

            "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g,"$1"]]);d([[/

            /g,"

            "],[/
            /g," "],[/

            /g,"
            "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

            $1

            ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

            "],[/<\/h[1-6][^>]*>/gi,"

            "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length"]])}else{if(f=="p"){e([[/\n+/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"]])}else{e([[/\n\n/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"],[/\n/g,"
            "]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js new file mode 100644 index 00000000..0154eceb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js @@ -0,0 +1,885 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, + defs = { + paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, + paste_block_drop : false, + paste_retain_style_properties : "none", + paste_strip_class_attributes : "mso", + paste_remove_spans : false, + paste_remove_styles : false, + paste_remove_styles_if_webkit : true, + paste_convert_middot_lists : true, + paste_convert_headers_to_strong : false, + paste_dialog_width : "450", + paste_dialog_height : "400", + paste_max_consecutive_linebreaks: 2, + paste_text_use_dialog : false, + paste_text_sticky : false, + paste_text_sticky_default : false, + paste_text_notifyalways : false, + paste_text_linebreaktype : "combined", + paste_text_replacements : [ + [/\u2026/g, "..."], + [/[\x93\x94\u201c\u201d]/g, '"'], + [/[\x60\x91\x92\u2018\u2019]/g, "'"] + ] + }; + + function getParam(ed, name) { + return ed.getParam(name, defs[name]); + } + + tinymce.create('tinymce.plugins.PastePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Setup plugin events + t.onPreProcess = new tinymce.util.Dispatcher(t); + t.onPostProcess = new tinymce.util.Dispatcher(t); + + // Register default handlers + t.onPreProcess.add(t._preProcess); + t.onPostProcess.add(t._postProcess); + + // Register optional preprocess handler + t.onPreProcess.add(function(pl, o) { + ed.execCallback('paste_preprocess', pl, o); + }); + + // Register optional postprocess + t.onPostProcess.add(function(pl, o) { + ed.execCallback('paste_postprocess', pl, o); + }); + + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + + // Initialize plain text flag + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); + + // This function executes the process handlers and inserts the contents + // force_rich overrides plain text mode set by user, important for pasting with execCommand + function process(o, force_rich) { + var dom = ed.dom, rng; + + // Execute pre process handlers + t.onPreProcess.dispatch(t, o); + + // Create DOM structure + o.node = dom.create('div', 0, o.content); + + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + + // Execute post process handlers + t.onPostProcess.dispatch(t, o); + + // Serialize content + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); + + // Plain text option active? + if ((!force_rich) && (ed.pasteAsPlainText)) { + t._insertPlainText(o.content); + + if (!getParam(ed, "paste_text_sticky")) { + ed.pasteAsPlainText = false; + ed.controlManager.setActive("pastetext", false); + } + } else { + t._insert(o.content); + } + } + + // Add command for external usage + ed.addCommand('mceInsertClipboardContent', function(u, o) { + process(o, true); + }); + + if (!getParam(ed, "paste_text_use_dialog")) { + ed.addCommand('mcePasteText', function(u, v) { + var cookie = tinymce.util.Cookie; + + ed.pasteAsPlainText = !ed.pasteAsPlainText; + ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); + + if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { + if (getParam(ed, "paste_text_sticky")) { + ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + } else { + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); + } + + if (!getParam(ed, "paste_text_notifyalways")) { + cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) + } + } + }); + } + + ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); + ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); + + // This function grabs the contents from the clipboard by adding a + // hidden div and placing the caret inside it and after the browser paste + // is done it grabs that contents and processes that + function grabContent(e) { + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; + + // Check if browser supports direct plaintext access + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
            ')}); + return; + } + } + + if (dom.get('_mcePaste')) + return; + + // Create container to paste into + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); + + // If contentEditable mode we need to find out the position of the closest element + if (body != ed.getDoc().body) + posY = dom.getPos(ed.selection.getStart(), body).y; + else + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; + + // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail + dom.setStyles(n, { + position : 'absolute', + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, + width : 1, + height : 1, + overflow : 'hidden' + }); + + if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + + // Select the container + rng = dom.doc.body.createTextRange(); + rng.moveToElementText(n); + rng.execCommand('Paste'); + + // Remove container + dom.remove(n); + + // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due + // to IE security settings so we pass the junk though better than nothing right + if (n.innerHTML === '\uFEFF\uFEFF') { + ed.execCommand('mcePasteWord'); + e.preventDefault(); + return; + } + + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); + + // Block the real paste event + return tinymce.dom.Event.cancel(e); + } else { + function block(e) { + e.preventDefault(); + }; + + // Block mousedown and click to prevent selection change + dom.bind(ed.getDoc(), 'mousedown', block); + dom.bind(ed.getDoc(), 'keydown', block); + + or = ed.selection.getRng(); + + // Move select contents inside DIV + n = n.firstChild; + rng = ed.getDoc().createRange(); + rng.setStart(n, 0); + rng.setEnd(n, 2); + sel.setRng(rng); + + // Wait a while and grab the pasted contents + window.setTimeout(function() { + var h = '', nl; + + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); + + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; + + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

            ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

            ').replace(/\r?\n/g, '
            ') + '

            '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + } + }); + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

            /g, '

            '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
            /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

            /g, '
            '] // Replace back the double brs but into a single BR + ]); + } + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

            $1

            "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

            "], + [/<\/h[1-6][^>]*>/gi, "

            "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(content) { + var ed = this.editor, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + content = content.replace(v, ""); + else + content = content.replace(v[0], v[1]); + }); + }; + + if ((typeof(content) === "string") && (content.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
            tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars. + ]); + + var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks")); + if (maxLinebreaks > -1) { + var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g"); + var linebreakReplacement = ""; + + while (linebreakReplacement.length < maxLinebreaks) { + linebreakReplacement += "\n"; + } + + process([ + [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks + ]); + } + + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); + + // Perform default or custom replacements + if (is(rl, "array")) { + process(rl); + } else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + // Convert all line breaks to space + process([ + [/\n+/g, " "] + ]); + } else if (linebr == "br") { + // Convert all line breaks to
            + process([ + [/\n/g, "
            "] + ]); + } else if (linebr == "p") { + // Convert all line breaks to

            ...

            + process([ + [/\n+/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
            and double line breaks to

            ...

            + process([ + [/\n\n/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'], + [/\n/g, "
            "] + ]); + } + + ed.execCommand('mceInsertContent', false, content); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js new file mode 100644 index 00000000..c524f9eb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

            ' + row + '

            '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js new file mode 100644 index 00000000..151f459f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js @@ -0,0 +1,51 @@ +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 44) + 'px'; + el.style.height = (vp.h - 190) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js new file mode 100644 index 00000000..84b9bc62 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.paste_dlg',{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js new file mode 100644 index 00000000..bc74daf8 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm new file mode 100644 index 00000000..88989da6 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm @@ -0,0 +1,33 @@ + + + {#paste.paste_text_desc} + + + + + +
            +
            {#paste.paste_text_desc}
            + +
            + +
            + +
            + +
            {#paste_dlg.text_title}
            + + + +
            +
            + +
            + +
            + +
            +
            +
            + + \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm new file mode 100644 index 00000000..4d497a98 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm @@ -0,0 +1,21 @@ + + + {#paste.paste_word_desc} + + + + + +
            +
            {#paste.paste_word_desc}
            +

            {#paste_dlg.word_title}

            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js new file mode 100644 index 00000000..0ab05ebb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"
            ")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

            "+o.encode(r).replace(/\r?\n\r?\n/g,"

            ").replace(/\r?\n/g,"
            ")+"

            "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g,"$1"]]);d([[/

            /g,"

            "],[/
            /g," "],[/

            /g,"
            "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

            $1

            ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

            "],[/<\/h[1-6][^>]*>/gi,"

            "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length"]])}else{if(f=="p"){e([[/\n+/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"]])}else{e([[/\n\n/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"],[/\n/g,"
            "]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js new file mode 100644 index 00000000..0154eceb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js @@ -0,0 +1,885 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, + defs = { + paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, + paste_block_drop : false, + paste_retain_style_properties : "none", + paste_strip_class_attributes : "mso", + paste_remove_spans : false, + paste_remove_styles : false, + paste_remove_styles_if_webkit : true, + paste_convert_middot_lists : true, + paste_convert_headers_to_strong : false, + paste_dialog_width : "450", + paste_dialog_height : "400", + paste_max_consecutive_linebreaks: 2, + paste_text_use_dialog : false, + paste_text_sticky : false, + paste_text_sticky_default : false, + paste_text_notifyalways : false, + paste_text_linebreaktype : "combined", + paste_text_replacements : [ + [/\u2026/g, "..."], + [/[\x93\x94\u201c\u201d]/g, '"'], + [/[\x60\x91\x92\u2018\u2019]/g, "'"] + ] + }; + + function getParam(ed, name) { + return ed.getParam(name, defs[name]); + } + + tinymce.create('tinymce.plugins.PastePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Setup plugin events + t.onPreProcess = new tinymce.util.Dispatcher(t); + t.onPostProcess = new tinymce.util.Dispatcher(t); + + // Register default handlers + t.onPreProcess.add(t._preProcess); + t.onPostProcess.add(t._postProcess); + + // Register optional preprocess handler + t.onPreProcess.add(function(pl, o) { + ed.execCallback('paste_preprocess', pl, o); + }); + + // Register optional postprocess + t.onPostProcess.add(function(pl, o) { + ed.execCallback('paste_postprocess', pl, o); + }); + + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + + // Initialize plain text flag + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); + + // This function executes the process handlers and inserts the contents + // force_rich overrides plain text mode set by user, important for pasting with execCommand + function process(o, force_rich) { + var dom = ed.dom, rng; + + // Execute pre process handlers + t.onPreProcess.dispatch(t, o); + + // Create DOM structure + o.node = dom.create('div', 0, o.content); + + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + + // Execute post process handlers + t.onPostProcess.dispatch(t, o); + + // Serialize content + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); + + // Plain text option active? + if ((!force_rich) && (ed.pasteAsPlainText)) { + t._insertPlainText(o.content); + + if (!getParam(ed, "paste_text_sticky")) { + ed.pasteAsPlainText = false; + ed.controlManager.setActive("pastetext", false); + } + } else { + t._insert(o.content); + } + } + + // Add command for external usage + ed.addCommand('mceInsertClipboardContent', function(u, o) { + process(o, true); + }); + + if (!getParam(ed, "paste_text_use_dialog")) { + ed.addCommand('mcePasteText', function(u, v) { + var cookie = tinymce.util.Cookie; + + ed.pasteAsPlainText = !ed.pasteAsPlainText; + ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); + + if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { + if (getParam(ed, "paste_text_sticky")) { + ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + } else { + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); + } + + if (!getParam(ed, "paste_text_notifyalways")) { + cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) + } + } + }); + } + + ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); + ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); + + // This function grabs the contents from the clipboard by adding a + // hidden div and placing the caret inside it and after the browser paste + // is done it grabs that contents and processes that + function grabContent(e) { + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; + + // Check if browser supports direct plaintext access + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
            ')}); + return; + } + } + + if (dom.get('_mcePaste')) + return; + + // Create container to paste into + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); + + // If contentEditable mode we need to find out the position of the closest element + if (body != ed.getDoc().body) + posY = dom.getPos(ed.selection.getStart(), body).y; + else + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; + + // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail + dom.setStyles(n, { + position : 'absolute', + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, + width : 1, + height : 1, + overflow : 'hidden' + }); + + if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + + // Select the container + rng = dom.doc.body.createTextRange(); + rng.moveToElementText(n); + rng.execCommand('Paste'); + + // Remove container + dom.remove(n); + + // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due + // to IE security settings so we pass the junk though better than nothing right + if (n.innerHTML === '\uFEFF\uFEFF') { + ed.execCommand('mcePasteWord'); + e.preventDefault(); + return; + } + + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); + + // Block the real paste event + return tinymce.dom.Event.cancel(e); + } else { + function block(e) { + e.preventDefault(); + }; + + // Block mousedown and click to prevent selection change + dom.bind(ed.getDoc(), 'mousedown', block); + dom.bind(ed.getDoc(), 'keydown', block); + + or = ed.selection.getRng(); + + // Move select contents inside DIV + n = n.firstChild; + rng = ed.getDoc().createRange(); + rng.setStart(n, 0); + rng.setEnd(n, 2); + sel.setRng(rng); + + // Wait a while and grab the pasted contents + window.setTimeout(function() { + var h = '', nl; + + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); + + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; + + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

            ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

            ').replace(/\r?\n/g, '
            ') + '

            '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + } + }); + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

            /g, '

            '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
            /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

            /g, '
            '] // Replace back the double brs but into a single BR + ]); + } + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

            $1

            "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

            "], + [/<\/h[1-6][^>]*>/gi, "

            "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(content) { + var ed = this.editor, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + content = content.replace(v, ""); + else + content = content.replace(v[0], v[1]); + }); + }; + + if ((typeof(content) === "string") && (content.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
            tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars. + ]); + + var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks")); + if (maxLinebreaks > -1) { + var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g"); + var linebreakReplacement = ""; + + while (linebreakReplacement.length < maxLinebreaks) { + linebreakReplacement += "\n"; + } + + process([ + [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks + ]); + } + + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); + + // Perform default or custom replacements + if (is(rl, "array")) { + process(rl); + } else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + // Convert all line breaks to space + process([ + [/\n+/g, " "] + ]); + } else if (linebr == "br") { + // Convert all line breaks to
            + process([ + [/\n/g, "
            "] + ]); + } else if (linebr == "p") { + // Convert all line breaks to

            ...

            + process([ + [/\n+/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
            and double line breaks to

            ...

            + process([ + [/\n\n/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'], + [/\n/g, "
            "] + ]); + } + + ed.execCommand('mceInsertContent', false, content); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js new file mode 100644 index 00000000..c524f9eb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

            ' + row + '

            '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js new file mode 100644 index 00000000..a52731c3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js @@ -0,0 +1,51 @@ +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js new file mode 100644 index 00000000..84b9bc62 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.paste_dlg',{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js new file mode 100644 index 00000000..bc74daf8 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm new file mode 100644 index 00000000..b6559454 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm @@ -0,0 +1,27 @@ + + + {#paste.paste_text_desc} + + + + +
            +
            {#paste.paste_text_desc}
            + +
            + +
            + +
            + +
            {#paste_dlg.text_title}
            + + + +
            + + +
            +
            + + \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm new file mode 100644 index 00000000..0f6bb412 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm @@ -0,0 +1,21 @@ + + + {#paste.paste_word_desc} + + + + +
            +
            {#paste.paste_word_desc}
            + +
            {#paste_dlg.word_title}
            + +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js new file mode 100644 index 00000000..507909c5 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js new file mode 100644 index 00000000..80f00f0d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js @@ -0,0 +1,53 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Preview', { + init : function(ed, url) { + var t = this, css = tinymce.explode(ed.settings.content_css); + + t.editor = ed; + + // Force absolute CSS urls + tinymce.each(css, function(u, k) { + css[k] = ed.documentBaseURI.toAbsolute(u); + }); + + ed.addCommand('mcePreview', function() { + ed.windowManager.open({ + file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), + width : parseInt(ed.getParam("plugin_preview_width", "550")), + height : parseInt(ed.getParam("plugin_preview_height", "600")), + resizable : "yes", + scrollbars : "yes", + popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), + inline : ed.getParam("plugin_preview_inline", 1) + }, { + base : ed.documentBaseURI.getURI() + }); + }); + + ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); + }, + + getInfo : function() { + return { + longname : 'Preview', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('preview', tinymce.plugins.Preview); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/example.html b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/example.html new file mode 100644 index 00000000..b2c3d90c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/example.html @@ -0,0 +1,28 @@ + + + + + +Example of a custom preview page + + + +Editor contents:
            +
            + +
            + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ' + + + + + +{#preview.preview_desc} + + + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js new file mode 100644 index 00000000..b5b3a55e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js new file mode 100644 index 00000000..3933fe65 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js @@ -0,0 +1,34 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Print', { + init : function(ed, url) { + ed.addCommand('mcePrint', function() { + ed.getWin().print(); + }); + + ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); + }, + + getInfo : function() { + return { + longname : 'Print', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('print', tinymce.plugins.Print); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js new file mode 100644 index 00000000..8e939966 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js new file mode 100644 index 00000000..f5a3de8f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js @@ -0,0 +1,101 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Save', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceSave', t._save, t); + ed.addCommand('mceCancel', t._cancel, t); + + // Register buttons + ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); + ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); + + ed.onNodeChange.add(t._nodeChange, t); + ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); + }, + + getInfo : function() { + return { + longname : 'Save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var ed = this.editor; + + if (ed.getParam('save_enablewhendirty')) { + cm.setDisabled('save', !ed.isDirty()); + cm.setDisabled('cancel', !ed.isDirty()); + } + }, + + // Private methods + + _save : function() { + var ed = this.editor, formObj, os, i, elementId; + + formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); + + if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) + return; + + tinyMCE.triggerSave(); + + // Use callback instead + if (os = ed.getParam("save_onsavecallback")) { + if (ed.execCallback('save_onsavecallback', ed)) { + ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); + ed.nodeChanged(); + } + + return; + } + + if (formObj) { + ed.isNotDirty = true; + + if (formObj.onsubmit == null || formObj.onsubmit() != false) + formObj.submit(); + + ed.nodeChanged(); + } else + ed.windowManager.alert("Error: No form element found."); + }, + + _cancel : function() { + var ed = this.editor, os, h = tinymce.trim(ed.startContent); + + // Use callback instead + if (os = ed.getParam("save_oncancelcallback")) { + ed.execCallback('save_oncancelcallback', ed); + return; + } + + ed.setContent(h); + ed.undoManager.clear(); + ed.nodeChanged(); + } + }); + + // Register plugin + tinymce.PluginManager.add('save', tinymce.plugins.Save); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css new file mode 100644 index 00000000..ecdf58c7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js new file mode 100644 index 00000000..165bc12d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js new file mode 100644 index 00000000..4c87e8fa --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js new file mode 100644 index 00000000..80284b9f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -0,0 +1,142 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js new file mode 100644 index 00000000..7c40acd9 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{findwhat:"Zu suchender Text",replacewith:"Ersetzen durch",direction:"Suchrichtung",up:"Aufw\u00e4rts",down:"Abw\u00e4rts",mcase:"Gro\u00df-/Kleinschreibung beachten",findnext:"Weitersuchen",allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.","searchnext_desc":"Weitersuchen",notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.","search_title":"Suchen","replace_title":"Suchen/Ersetzen",replaceall:"Alle ersetzen",replace:"Ersetzen"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js new file mode 100644 index 00000000..8a659009 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm new file mode 100644 index 00000000..d37ed8a0 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -0,0 +1,101 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
            + + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + + + + +
            +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + + + + +
            +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            + +
            +
            +
              +
            • +
            • +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css new file mode 100644 index 00000000..ecdf58c7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js new file mode 100644 index 00000000..165bc12d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js new file mode 100644 index 00000000..4c87e8fa --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js new file mode 100644 index 00000000..80284b9f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js @@ -0,0 +1,142 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js new file mode 100644 index 00000000..7c40acd9 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{findwhat:"Zu suchender Text",replacewith:"Ersetzen durch",direction:"Suchrichtung",up:"Aufw\u00e4rts",down:"Abw\u00e4rts",mcase:"Gro\u00df-/Kleinschreibung beachten",findnext:"Weitersuchen",allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.","searchnext_desc":"Weitersuchen",notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.","search_title":"Suchen","replace_title":"Suchen/Ersetzen",replaceall:"Alle ersetzen",replace:"Ersetzen"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js new file mode 100644 index 00000000..8a659009 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm new file mode 100644 index 00000000..2443a918 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm @@ -0,0 +1,100 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
            + + +
            +
            + + + + + + + + + + + +
            + + + + + + + + + +
            + + + + + +
            +
            +
            + +
            + + + + + + + + + + + + + + + +
            + + + + + + + + + +
            + + + + + +
            +
            +
            + +
            + +
            + + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css new file mode 100644 index 00000000..24efa021 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css @@ -0,0 +1 @@ +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js new file mode 100644 index 00000000..48549c92 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}\u201d\u201c');for(d=0;d$2");while((s=p.indexOf(""))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(g.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(g.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(g.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(f,'$1$2')}g.replace(q,t)}});i.setRng(d)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js new file mode 100644 index 00000000..86fdfceb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js @@ -0,0 +1,436 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.SpellcheckerPlugin', { + getInfo : function() { + return { + longname : 'Spellchecker', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + init : function(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); + + if (t.rpcUrl == '{backend}') { + // Sniff if the browser supports native spellchecking (Don't know of a better way) + if (tinymce.isIE) + return; + + t.hasSupport = true; + + // Disable the context menu when spellchecking is active + ed.onContextMenu.addToTop(function(ed, e) { + if (t.active) + return false; + }); + } + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (t.rpcUrl == '{backend}') { + // Enable/disable native spellchecker + t.editor.getBody().spellcheck = t.active = !t.active; + return; + } + + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + + if (ed.getParam('spellchecker_report_no_misspellings', true)) + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + if (ed.settings.content_css !== false) + ed.contentCSS.push(url + '/css/content.css'); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + // Use basic button if we use the native spellchecker + if (t.rpcUrl == '{backend}') { + // Create simple toggle button if we have native support + if (t.hasSupport) + c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + return c; + } + + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + if (v == t.selectedLang) { + return; + } + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); + + // Build word separator regexp + for (i=0; i elements content is broken after spellchecking. + // Bug #1408: Preceding whitespace characters are removed + // @TODO: I'm not sure that both are still issues on IE9. + if (tinymce.isIE) { + // Enclose mispelled words with temporal tag + v = v.replace(rx, '$1$2'); + // Loop over the content finding mispelled words + while ((pos = v.indexOf('')) != -1) { + // Add text node for the content before the word + txt = v.substring(0, pos); + if (txt.length) { + node = doc.createTextNode(dom.decode(txt)); + elem.appendChild(node); + } + v = v.substring(pos+10); + pos = v.indexOf(''); + txt = v.substring(0, pos); + v = v.substring(pos+11); + // Add span element for the word + elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); + } + // Add text node for the rest of the content + if (v.length) { + node = doc.createTextNode(dom.decode(v)); + elem.appendChild(node); + } + } else { + // Other browsers preserve whitespace characters on innerHTML usage + elem.innerHTML = v.replace(rx, '$1$2'); + } + + // Finally, replace the node with the container + dom.replace(elem, n); + } + }); + + se.setRng(r); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; + + e = 0; // Fixes IE memory leak + + if (!m) { + m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); + t._menu = m; + } + + if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { + var ignoreRpc; + + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), wordSpan); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + if (ed.getParam('show_ignore_words', true)) { + ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + var word = wordSpan.innerHTML; + + t._removeWords(dom.decode(word)); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + } + + if (t.editor.getParam("spellchecker_enable_learn_rpc")) { + m.add({ + title : 'spellchecker.learn_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + ed.setProgressState(1); + t._sendRPC('learnWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + }); + } + + m.update(); + }); + + p1 = DOM.getPos(ed.getContentAreaContainer()); + m.settings.offset_x = p1.x; + m.settings.offset_y = p1.y; + + ed.selection.select(wordSpan); + p1 = dom.getPos(wordSpan); + m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this; + + JSONRequest.sendRPC({ + url : t.rpcUrl, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif new file mode 100644 index 00000000..7d0a4dbc Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/css/props.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/css/props.css new file mode 100644 index 00000000..3b8f0ee7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/css/props.css @@ -0,0 +1,14 @@ +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_toggle_insert_span {padding-top:10px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js new file mode 100644 index 00000000..dda9f928 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){var c=false;var f=a.selection.getSelectedBlocks();var d=[];if(f.length===1){d.push(a.selection.getNode().style.cssText)}else{tinymce.each(f,function(g){d.push(a.dom.getAttrib(g,"style"))});c=true}a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:340+parseInt(a.getLang("style.delta_height",0)),inline:1},{applyStyleToBlocks:c,plugin_url:b,styles:d})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js new file mode 100644 index 00000000..eaa7c771 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js @@ -0,0 +1,71 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + + var applyStyleToBlocks = false; + var blocks = ed.selection.getSelectedBlocks(); + var styles = []; + + if (blocks.length === 1) { + styles.push(ed.selection.getNode().style.cssText); + } + else { + tinymce.each(blocks, function(block) { + styles.push(ed.dom.getAttrib(block, 'style')); + }); + applyStyleToBlocks = true; + } + + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 340 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + applyStyleToBlocks : applyStyleToBlocks, + plugin_url : url, + styles : styles + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); + }, + + getInfo : function() { + return { + longname : 'Style', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/js/props.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/js/props.js new file mode 100644 index 00000000..0a8a8ec3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/js/props.js @@ -0,0 +1,709 @@ +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function aggregateStyles(allStyles) { + var mergedStyles = {}; + + tinymce.each(allStyles, function(style) { + if (style !== '') { + var parsedStyles = tinyMCEPopup.editor.dom.parseStyle(style); + for (var name in parsedStyles) { + if (parsedStyles.hasOwnProperty(name)) { + if (mergedStyles[name] === undefined) { + mergedStyles[name] = parsedStyles[name]; + } + else if (name === 'text-decoration') { + if (mergedStyles[name].indexOf(parsedStyles[name]) === -1) { + mergedStyles[name] = mergedStyles[name] +' '+ parsedStyles[name]; + } + } + } + } + } + }); + + return mergedStyles; +} + +var applyActionIsInsert; +var existingStyles; + +function init(ed) { + var ce = document.getElementById('container'), h; + + existingStyles = aggregateStyles(tinyMCEPopup.getWindowArg('styles')); + ce.style.cssText = tinyMCEPopup.editor.dom.serializeStyle(existingStyles); + + applyActionIsInsert = ed.getParam("edit_css_style_insert_span", false); + document.getElementById('toggle_insert_span').checked = applyActionIsInsert; + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + f.text_none.checked = inStr(ce.style.textDecoration, 'none'); + updateTextDecorations(); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9.]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) + return s.replace(/[^0-9.]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +function updateTextDecorations(){ + var el = document.forms[0].elements; + + var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"]; + var noneChecked = el["text_none"].checked; + tinymce.each(textDecorations, function(id) { + el[id].disabled = noneChecked; + if (noneChecked) { + el[id].checked = false; + } + }); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js new file mode 100644 index 00000000..ad04664e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.style_dlg',{"text_lineheight":"Zeilenh\u00f6he","text_variant":"Variante","text_style":"Stil","text_weight":"Dicke","text_size":"Gr\u00f6\u00dfe","text_font":"Schriftart","text_props":"Text","positioning_tab":"Positionierung","list_tab":"Liste","border_tab":"Rahmen","box_tab":"Box","block_tab":"Block","background_tab":"Hintergrund","text_tab":"Text",apply:"\u00dcbernehmen",title:"CSS-Styles bearbeiten",clip:"Ausschnitt",placement:"Platzierung",overflow:"Verhalten bei \u00dcbergr\u00f6\u00dfe",zindex:"Z-Wert",visibility:"Sichtbar","positioning_type":"Art der Positionierung",position:"Positionierung","bullet_image":"Listenpunkt-Grafik","list_type":"Listenpunkt-Art",color:"Textfarbe",height:"H\u00f6he",width:"Breite",style:"Format",margin:"\u00c4u\u00dferer Abstand",left:"Links",bottom:"Unten",right:"Rechts",top:"Oben",same:"Alle gleich",padding:"Innerer Abstand","box_clear":"Umflie\u00dfung verhindern","box_float":"Umflie\u00dfung","box_height":"H\u00f6he","box_width":"Breite","block_display":"Umbruchverhalten","block_whitespace":"Automatischer Umbruch","block_text_indent":"Einr\u00fcckung","block_text_align":"Ausrichtung","block_vertical_alignment":"Vertikale Ausrichtung","block_letterspacing":"Buchstabenabstand","block_wordspacing":"Wortabstand","background_vpos":"Position Y","background_hpos":"Position X","background_attachment":"Wasserzeicheneffekt","background_repeat":"Wiederholung","background_image":"Hintergrundbild","background_color":"Hintergrundfarbe","text_none":"keine","text_blink":"blinkend","text_case":"Schreibung","text_striketrough":"durchgestrichen","text_underline":"unterstrichen","text_overline":"\u00fcberstrichen","text_decoration":"Gestaltung","text_color":"Farbe",text:"Text",background:"Hintergrund",block:"Block",box:"Box",border:"Rahmen",list:"Liste"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js new file mode 100644 index 00000000..35881b3a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/props.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/props.htm new file mode 100644 index 00000000..7dc087a3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/props.htm @@ -0,0 +1,845 @@ + + + + {#style_dlg.title} + + + + + + + + + + +
            + + +
            +
            +
            + {#style_dlg.text} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + + + + + + +
              + + +
            +
            + +
            + + + +
            + + + + + + +
            + +   + + +
            +
            + +
            + + + + + +
             
            +
            {#style_dlg.text_decoration} + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.background} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + +
             
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.block} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.box} + + + + + + + + + + + + + + +
            + + + + + + +
              + + +
            +
               
            + + + + + + +
              + + +
            +
               
            +
            + +
            +
            + {#style_dlg.padding} + + + + + + + + + + + + + + + + + + + + + + +
             
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.margin} + + + + + + + + + + + + + + + + + + + + + + +
             
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            +
            +
            +
            +
            + +
            +
            + {#style_dlg.border} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
                  
            {#style_dlg.top}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            {#style_dlg.right}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            {#style_dlg.bottom}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            {#style_dlg.left}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            +
            +
            + +
            +
            + {#style_dlg.list} + + + + + + + + + + + + + + + +
            +
            +
            + +
            +
            + {#style_dlg.position} + + + + + + + + + + + + + + + + + + + + + +
               
            + + + + + + +
              + + +
            +
               
            + + + + + + +
              + + +
            +
               
            +
            + +
            +
            + {#style_dlg.placement} + + + + + + + + + + + + + + + + + + + + + + +
             
            {#style_dlg.top} + + + + + + +
              + + +
            +
            {#style_dlg.right} + + + + + + +
              + + +
            +
            {#style_dlg.bottom} + + + + + + +
              + + +
            +
            {#style_dlg.left} + + + + + + +
              + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.clip} + + + + + + + + + + + + + + + + + + + + + + +
             
            {#style_dlg.top} + + + + + + +
              + + +
            +
            {#style_dlg.right} + + + + + + +
              + + +
            +
            {#style_dlg.bottom} + + + + + + +
              + + +
            +
            {#style_dlg.left} + + + + + + +
              + + +
            +
            +
            +
            +
            +
            +
            + +
            + + +
            + +
            + + + +
            +
            + +
            +
            +
            + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/readme.txt b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/readme.txt new file mode 100644 index 00000000..5bac3020 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/style/readme.txt @@ -0,0 +1,19 @@ +Edit CSS Style plug-in notes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Unlike WYSIWYG editor functionality that operates only on the selected text, +typically by inserting new HTML elements with the specified styles. +This plug-in operates on the HTML blocks surrounding the selected text. +No new HTML elements are created. + +This plug-in only operates on the surrounding blocks and not the nearest +parent node. This means that if a block encapsulates a node, +e.g

            text

            , then only the styles in the block are +recognized, not those in the span. + +When selecting text that includes multiple blocks at the same level (peers), +this plug-in accumulates the specified styles in all of the surrounding blocks +and populates the dialogue checkboxes accordingly. There is no differentiation +between styles set in all the blocks versus styles set in some of the blocks. + +When the [Update] or [Apply] buttons are pressed, the styles selected in the +checkboxes are applied to all blocks that surround the selected text. diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js new file mode 100644 index 00000000..2c512916 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]:not(iframe)");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js new file mode 100644 index 00000000..94f45320 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js @@ -0,0 +1,122 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; + + tinymce.create('tinymce.plugins.TabFocusPlugin', { + init : function(ed, url) { + function tabCancel(ed, e) { + if (e.keyCode === 9) + return Event.cancel(e); + } + + function tabHandler(ed, e) { + var x, i, f, el, v; + + function find(d) { + el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); + + function canSelectRecursive(e) { + return e.nodeName==="BODY" || (e.type != 'hidden' && + !(e.style.display == "none") && + !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); + } + function canSelectInOldIe(el) { + return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; + } + function isOldIe() { + return tinymce.isIE6 || tinymce.isIE7; + } + function canSelect(el) { + return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); + } + + each(el, function(e, i) { + if (e.id == ed.id) { + x = i; + return false; + } + }); + if (d > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) + return el[i]; + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) + return el[i]; + } + } + + return null; + } + + if (e.keyCode === 9) { + v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); + + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') + el = find(-1); + else + el = DOM.get(v[0]); + } else { + if (v[1] == ':next') + el = find(1); + else + el = DOM.get(v[1]); + } + + if (el) { + if (el.id && (ed = tinymce.get(el.id || el.name))) + ed.focus(); + else + window.setTimeout(function() { + if (!tinymce.isWebKit) + window.focus(); + el.focus(); + }, 10); + + return Event.cancel(e); + } + } + } + + ed.onKeyUp.add(tabCancel); + + if (tinymce.isGecko) { + ed.onKeyPress.add(tabHandler); + ed.onKeyDown.add(tabCancel); + } else + ed.onKeyDown.add(tabHandler); + + }, + + getInfo : function() { + return { + longname : 'Tabfocus', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/cell.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/cell.htm new file mode 100644 index 00000000..a72a8d69 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/cell.htm @@ -0,0 +1,180 @@ + + + + {#table_dlg.cell_title} + + + + + + + + + +
            + + +
            +
            +
            + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + +
            + + + +
            + +
            +
            +
            + +
            +
            + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + + + + + +
             
            +
            +
            +
            +
            + +
            +
            + +
            + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css new file mode 100644 index 00000000..a067ecdf --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css @@ -0,0 +1,17 @@ +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; +} \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/row.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/row.css new file mode 100644 index 00000000..1f7755da --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/row.css @@ -0,0 +1,25 @@ +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/table.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/table.css new file mode 100644 index 00000000..d11c3f69 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/css/table.css @@ -0,0 +1,13 @@ +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js new file mode 100644 index 00000000..4a35a5ef --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js @@ -0,0 +1 @@ +(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='
            '}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){if(!O){return}var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE?" ":'
            ')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js new file mode 100644 index 00000000..532b79c6 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js @@ -0,0 +1,1456 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var each = tinymce.each; + + // Checks if the selection/caret is at the start of the specified block element + function isAtStart(rng, par) { + var doc = par.ownerDocument, rng2 = doc.createRange(), elm; + + rng2.setStartBefore(par); + rng2.setEnd(rng.endContainer, rng.endOffset); + + elm = doc.createElement('body'); + elm.appendChild(rng2.cloneContents()); + + // Check for text characters of other elements that should be treated as content + return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; + }; + + function getSpanVal(td, name) { + return parseInt(td.getAttribute(name) || 1); + } + + /** + * Table Grid class. + */ + function TableGrid(table, dom, selection) { + var grid, startPos, endPos, selectedCell; + + buildGrid(); + selectedCell = dom.getParent(selection.getStart(), 'th,td'); + if (selectedCell) { + startPos = getPos(selectedCell); + endPos = findEndPos(); + selectedCell = getCell(startPos.x, startPos.y); + } + + function cloneNode(node, children) { + node = node.cloneNode(children); + node.removeAttribute('id'); + + return node; + } + + function buildGrid() { + var startY = 0; + + grid = []; + + each(['thead', 'tbody', 'tfoot'], function(part) { + var rows = dom.select('> ' + part + ' tr', table); + + each(rows, function(tr, y) { + y += startY; + + each(dom.select('> td, > th', tr), function(td, x) { + var x2, y2, rowspan, colspan; + + // Skip over existing cells produced by rowspan + if (grid[y]) { + while (grid[y][x]) + x++; + } + + // Get col/rowspan from cell + rowspan = getSpanVal(td, 'rowspan'); + colspan = getSpanVal(td, 'colspan'); + + // Fill out rowspan/colspan right and down + for (y2 = y; y2 < y + rowspan; y2++) { + if (!grid[y2]) + grid[y2] = []; + + for (x2 = x; x2 < x + colspan; x2++) { + grid[y2][x2] = { + part : part, + real : y2 == y && x2 == x, + elm : td, + rowspan : rowspan, + colspan : colspan + }; + } + } + }); + }); + + startY += rows.length; + }); + }; + + function getCell(x, y) { + var row; + + row = grid[y]; + if (row) + return row[x]; + }; + + function setSpanVal(td, name, val) { + if (td) { + val = parseInt(val); + + if (val === 1) + td.removeAttribute(name, 1); + else + td.setAttribute(name, val, 1); + } + } + + function isCellSelected(cell) { + return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); + }; + + function getSelectedRows() { + var rows = []; + + each(table.rows, function(row) { + each(row.cells, function(cell) { + if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { + rows.push(row); + return false; + } + }); + }); + + return rows; + }; + + function deleteTable() { + var rng = dom.createRng(); + + rng.setStartAfter(table); + rng.setEndAfter(table); + + selection.setRng(rng); + + dom.remove(table); + }; + + function cloneCell(cell) { + var formatNode; + + // Clone formats + tinymce.walk(cell, function(node) { + var curNode; + + if (node.nodeType == 3) { + each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { + node = cloneNode(node, false); + + if (!formatNode) + formatNode = curNode = node; + else if (curNode) + curNode.appendChild(node); + + curNode = node; + }); + + // Add something to the inner node + if (curNode) + curNode.innerHTML = tinymce.isIE ? ' ' : '
            '; + + return false; + } + }, 'childNodes'); + + cell = cloneNode(cell, false); + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + if (formatNode) { + cell.appendChild(formatNode); + } else { + if (!tinymce.isIE) + cell.innerHTML = '
            '; + } + + return cell; + }; + + function cleanup() { + var rng = dom.createRng(); + + // Empty rows + each(dom.select('tr', table), function(tr) { + if (tr.cells.length == 0) + dom.remove(tr); + }); + + // Empty table + if (dom.select('tr', table).length == 0) { + rng.setStartAfter(table); + rng.setEndAfter(table); + selection.setRng(rng); + dom.remove(table); + return; + } + + // Empty header/body/footer + each(dom.select('thead,tbody,tfoot', table), function(part) { + if (part.rows.length == 0) + dom.remove(part); + }); + + // Restore selection to start position if it still exists + buildGrid(); + + // Restore the selection to the closest table position + row = grid[Math.min(grid.length - 1, startPos.y)]; + if (row) { + selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); + selection.collapse(true); + } + }; + + function fillLeftDown(x, y, rows, cols) { + var tr, x2, r, c, cell; + + tr = grid[y][x].elm.parentNode; + for (r = 1; r <= rows; r++) { + tr = dom.getNext(tr, 'tr'); + + if (tr) { + // Loop left to find real cell + for (x2 = x; x2 >= 0; x2--) { + cell = grid[y + r][x2].elm; + + if (cell.parentNode == tr) { + // Append clones after + for (c = 1; c <= cols; c++) + dom.insertAfter(cloneCell(cell), cell); + + break; + } + } + + if (x2 == -1) { + // Insert nodes before first cell + for (c = 1; c <= cols; c++) + tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); + } + } + } + }; + + function split() { + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan, newCell, i; + + if (isCellSelected(cell)) { + cell = cell.elm; + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan > 1 || rowSpan > 1) { + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + // Insert cells right + for (i = 0; i < colSpan - 1; i++) + dom.insertAfter(cloneCell(cell), cell); + + fillLeftDown(x, y, rowSpan - 1, colSpan); + } + } + }); + }); + }; + + function merge(cell, cols, rows) { + var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; + + // Use specified cell and cols/rows + if (cell) { + pos = getPos(cell); + startX = pos.x; + startY = pos.y; + endX = startX + (cols - 1); + endY = startY + (rows - 1); + } else { + startPos = endPos = null; + + // Calculate start/end pos by checking for selected cells in grid works better with context menu + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + if (!startPos) { + startPos = {x: x, y: y}; + } + + endPos = {x: x, y: y}; + } + }); + }); + + // Use selection + startX = startPos.x; + startY = startPos.y; + endX = endPos.x; + endY = endPos.y; + } + + // Find start/end cells + startCell = getCell(startX, startY); + endCell = getCell(endX, endY); + + // Check if the cells exists and if they are of the same part for example tbody = tbody + if (startCell && endCell && startCell.part == endCell.part) { + // Split and rebuild grid + split(); + buildGrid(); + + // Set row/col span to start cell + startCell = getCell(startX, startY).elm; + setSpanVal(startCell, 'colSpan', (endX - startX) + 1); + setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); + + // Remove other cells and add it's contents to the start cell + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + if (!grid[y] || !grid[y][x]) + continue; + + cell = grid[y][x].elm; + + if (cell != startCell) { + // Move children to startCell + children = tinymce.grep(cell.childNodes); + each(children, function(node) { + startCell.appendChild(node); + }); + + // Remove bogus nodes if there is children in the target cell + if (children.length) { + children = tinymce.grep(startCell.childNodes); + count = 0; + each(children, function(node) { + if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) + startCell.removeChild(node); + }); + } + + // Remove cell + dom.remove(cell); + } + } + } + + // Remove empty rows etc and restore caret location + cleanup(); + } + }; + + function insertRow(before) { + var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; + + // Find first/last row + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + cell = cell.elm; + rowElm = cell.parentNode; + newRow = cloneNode(rowElm, false); + posY = y; + + if (before) + return false; + } + }); + + if (before) + return !posY; + }); + + for (x = 0; x < grid[0].length; x++) { + // Cell not found could be because of an invalid table structure + if (!grid[posY][x]) + continue; + + cell = grid[posY][x].elm; + + if (cell != lastCell) { + if (!before) { + rowSpan = getSpanVal(cell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan + 1); + continue; + } + } else { + // Check if cell above can be expanded + if (posY > 0 && grid[posY - 1][x]) { + otherCell = grid[posY - 1][x].elm; + rowSpan = getSpanVal(otherCell, 'rowSpan'); + if (rowSpan > 1) { + setSpanVal(otherCell, 'rowSpan', rowSpan + 1); + continue; + } + } + } + + // Insert new cell into new row + newCell = cloneCell(cell); + setSpanVal(newCell, 'colSpan', cell.colSpan); + + newRow.appendChild(newCell); + + lastCell = cell; + } + } + + if (newRow.hasChildNodes()) { + if (!before) + dom.insertAfter(newRow, rowElm); + else + rowElm.parentNode.insertBefore(newRow, rowElm); + } + }; + + function insertCol(before) { + var posX, lastCell; + + // Find first/last column + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + posX = x; + + if (before) + return false; + } + }); + + if (before) + return !posX; + }); + + each(grid, function(row, y) { + var cell, rowSpan, colSpan; + + if (!row[posX]) + return; + + cell = row[posX].elm; + if (cell != lastCell) { + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan == 1) { + if (!before) { + dom.insertAfter(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } else { + cell.parentNode.insertBefore(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } + } else + setSpanVal(cell, 'colSpan', cell.colSpan + 1); + + lastCell = cell; + } + }); + }; + + function deleteCols() { + var cols = []; + + // Get selected column indexes + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { + each(grid, function(row) { + var cell = row[x].elm, colSpan; + + colSpan = getSpanVal(cell, 'colSpan'); + + if (colSpan > 1) + setSpanVal(cell, 'colSpan', colSpan - 1); + else + dom.remove(cell); + }); + + cols.push(x); + } + }); + }); + + cleanup(); + }; + + function deleteRows() { + var rows; + + function deleteRow(tr) { + var nextTr, pos, lastCell; + + nextTr = dom.getNext(tr, 'tr'); + + // Move down row spanned cells + each(tr.cells, function(cell) { + var rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan - 1); + pos = getPos(cell); + fillLeftDown(pos.x, pos.y, 1, 1); + } + }); + + // Delete cells + pos = getPos(tr.cells[0]); + each(grid[pos.y], function(cell) { + var rowSpan; + + cell = cell.elm; + + if (cell != lastCell) { + rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan <= 1) + dom.remove(cell); + else + setSpanVal(cell, 'rowSpan', rowSpan - 1); + + lastCell = cell; + } + }); + }; + + // Get selected rows and move selection out of scope + rows = getSelectedRows(); + + // Delete all selected rows + each(rows.reverse(), function(tr) { + deleteRow(tr); + }); + + cleanup(); + }; + + function cutRows() { + var rows = getSelectedRows(); + + dom.remove(rows); + cleanup(); + + return rows; + }; + + function copyRows() { + var rows = getSelectedRows(); + + each(rows, function(row, i) { + rows[i] = cloneNode(row, true); + }); + + return rows; + }; + + function pasteRows(rows, before) { + // If we don't have any rows in the clipboard, return immediately + if(!rows) + return; + + var selectedRows = getSelectedRows(), + targetRow = selectedRows[before ? 0 : selectedRows.length - 1], + targetCellCount = targetRow.cells.length; + + // Calc target cell count + each(grid, function(row) { + var match; + + targetCellCount = 0; + each(row, function(cell, x) { + if (cell.real) + targetCellCount += cell.colspan; + + if (cell.elm.parentNode == targetRow) + match = 1; + }); + + if (match) + return false; + }); + + if (!before) + rows.reverse(); + + each(rows, function(row) { + var cellCount = row.cells.length, cell; + + // Remove col/rowspans + for (i = 0; i < cellCount; i++) { + cell = row.cells[i]; + setSpanVal(cell, 'colSpan', 1); + setSpanVal(cell, 'rowSpan', 1); + } + + // Needs more cells + for (i = cellCount; i < targetCellCount; i++) + row.appendChild(cloneCell(row.cells[cellCount - 1])); + + // Needs less cells + for (i = targetCellCount; i < cellCount; i++) + dom.remove(row.cells[i]); + + // Add before/after + if (before) + targetRow.parentNode.insertBefore(row, targetRow); + else + dom.insertAfter(row, targetRow); + }); + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + }; + + function getPos(target) { + var pos; + + each(grid, function(row, y) { + each(row, function(cell, x) { + if (cell.elm == target) { + pos = {x : x, y : y}; + return false; + } + }); + + return !pos; + }); + + return pos; + }; + + function setStartCell(cell) { + startPos = getPos(cell); + }; + + function findEndPos() { + var pos, maxX, maxY; + + maxX = maxY = 0; + + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan; + + if (isCellSelected(cell)) { + cell = grid[y][x]; + + if (x > maxX) + maxX = x; + + if (y > maxY) + maxY = y; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + }); + }); + + return {x : maxX, y : maxY}; + }; + + function setEndCell(cell) { + var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; + + endPos = getPos(cell); + + if (startPos && endPos) { + // Get start/end positions + startX = Math.min(startPos.x, endPos.x); + startY = Math.min(startPos.y, endPos.y); + endX = Math.max(startPos.x, endPos.x); + endY = Math.max(startPos.y, endPos.y); + + // Expand end positon to include spans + maxX = endX; + maxY = endY; + + // Expand startX + for (y = startY; y <= maxY; y++) { + cell = grid[y][startX]; + + if (!cell.real) { + if (startX - (cell.colspan - 1) < startX) + startX -= cell.colspan - 1; + } + } + + // Expand startY + for (x = startX; x <= maxX; x++) { + cell = grid[startY][x]; + + if (!cell.real) { + if (startY - (cell.rowspan - 1) < startY) + startY -= cell.rowspan - 1; + } + } + + // Find max X, Y + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + cell = grid[y][x]; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + } + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + + // Add new selection + for (y = startY; y <= maxY; y++) { + for (x = startX; x <= maxX; x++) { + if (grid[y][x]) + dom.addClass(grid[y][x].elm, 'mceSelected'); + } + } + } + }; + + // Expose to public + tinymce.extend(this, { + deleteTable : deleteTable, + split : split, + merge : merge, + insertRow : insertRow, + insertCol : insertCol, + deleteCols : deleteCols, + deleteRows : deleteRows, + cutRows : cutRows, + copyRows : copyRows, + pasteRows : pasteRows, + getPos : getPos, + setStartCell : setStartCell, + setEndCell : setEndCell + }); + }; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload + + function createTableGrid(node) { + var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); + + if (tblElm) + return new TableGrid(tblElm, ed.dom, selection); + }; + + function cleanup() { + // Restore selection possibilities + ed.getBody().style.webkitUserSelect = ''; + + if (hasCellSelection) { + ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + hasCellSelection = false; + } + }; + + // Register buttons + each([ + ['table', 'table.desc', 'mceInsertTable', true], + ['delete_table', 'table.del', 'mceTableDelete'], + ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table.row_desc', 'mceTableRowProps', true], + ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] + ], function(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') { + ed.selection.select(e); + ed.nodeChanged(); + } + }); + } + + ed.onPreProcess.add(function(ed, args) { + var nodes, i, node, dom = ed.dom, value; + + nodes = dom.select('table', args.node); + i = nodes.length; + while (i--) { + node = nodes[i]; + dom.setAttrib(node, 'data-mce-style', ''); + + if ((value = dom.getAttrib(node, 'width'))) { + dom.setStyle(node, 'width', value); + dom.setAttrib(node, 'width', ''); + } + + if ((value = dom.getAttrib(node, 'height'))) { + dom.setStyle(node, 'height', value); + dom.setAttrib(node, 'height', ''); + } + } + }); + + // Handle node change updates + ed.onNodeChange.add(function(ed, cm, n) { + var p; + + n = ed.selection.getStart(); + p = ed.dom.getParent(n, 'td,th,caption'); + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + + // Disable table tools if we are in caption + if (p && p.nodeName === 'CAPTION') + p = 0; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p); + cm.setDisabled('merge_cells', !p); + }); + + ed.onInit.add(function(ed) { + var startTable, startCell, dom = ed.dom, tableGrid; + + winMan = ed.windowManager; + + // Add cell selection logic + ed.onMouseDown.add(function(ed, e) { + if (e.button != 2) { + cleanup(); + + startCell = dom.getParent(e.target, 'td,th'); + startTable = dom.getParent(startCell, 'table'); + } + }); + + dom.bind(ed.getDoc(), 'mouseover', function(e) { + var sel, table, target = e.target; + + if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { + table = dom.getParent(target, 'table'); + if (table == startTable) { + if (!tableGrid) { + tableGrid = createTableGrid(table); + tableGrid.setStartCell(startCell); + + ed.getBody().style.webkitUserSelect = 'none'; + } + + tableGrid.setEndCell(target); + hasCellSelection = true; + } + + // Remove current selection + sel = ed.selection.getSel(); + + try { + if (sel.removeAllRanges) + sel.removeAllRanges(); + else + sel.empty(); + } catch (ex) { + // IE9 might throw errors here + } + + e.preventDefault(); + } + }); + + ed.onMouseUp.add(function(ed, e) { + var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; + + // Move selection to startCell + if (startCell) { + if (tableGrid) + ed.getBody().style.webkitUserSelect = ''; + + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + } + + // Try to expand text selection as much as we can only Gecko supports cell selection + selectedCells = dom.select('td.mceSelected,th.mceSelected'); + if (selectedCells.length > 0) { + rng = dom.createRng(); + node = selectedCells[0]; + endNode = selectedCells[selectedCells.length - 1]; + rng.setStartBefore(node); + rng.setEndAfter(node); + + setPoint(node, 1); + walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); + + do { + if (node.nodeName == 'TD' || node.nodeName == 'TH') { + if (!dom.hasClass(node, 'mceSelected')) + break; + + lastNode = node; + } + } while (node = walker.next()); + + setPoint(lastNode); + + sel.setRng(rng); + } + + ed.nodeChanged(); + startCell = tableGrid = startTable = null; + } + }); + + ed.onKeyUp.add(function(ed, e) { + cleanup(); + }); + + ed.onKeyDown.add(function (ed, e) { + fixTableCellSelection(ed); + }); + + ed.onMouseDown.add(function (ed, e) { + if (e.button != 2) { + fixTableCellSelection(ed); + } + }); + function tableCellSelected(ed, rng, n, currentCell) { + // The decision of when a table cell is selected is somewhat involved. The fact that this code is + // required is actually a pointer to the root cause of this bug. A cell is selected when the start + // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) + // or the parent of the table (in the case of the selection containing the last cell of a table). + var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), + tableParent, allOfCellSelected, tableCellSelection; + if (table) + tableParent = table.parentNode; + allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && + rng.startOffset == 0 && + rng.endOffset == 0 && + currentCell && + (n.nodeName=="TR" || n==tableParent); + tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; + return allOfCellSelected || tableCellSelection; + // return false; + } + + // this nasty hack is here to work around some WebKit selection bugs. + function fixTableCellSelection(ed) { + if (!tinymce.isWebKit) + return; + + var rng = ed.selection.getRng(); + var n = ed.selection.getNode(); + var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); + + if (!tableCellSelected(ed, rng, n, currentCell)) + return; + if (!currentCell) { + currentCell=n; + } + + // Get the very last node inside the table cell + var end = currentCell.lastChild; + while (end.lastChild) + end = end.lastChild; + + // Select the entire table cell. Nothing outside of the table cell should be selected. + rng.setEnd(end, end.nodeValue.length); + ed.selection.setRng(rng); + } + ed.plugins.table.fixTableCellSelection=fixTableCellSelection; + + // Add context menu + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); + }); + } + + // Fix to allow navigating up and down in a table in WebKit browsers. + if (tinymce.isWebKit) { + function moveSelection(ed, e) { + var VK = tinymce.VK; + var key = e.keyCode; + + function handle(upBool, sourceNode, event) { + var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; + var currentRow = ed.dom.getParent(sourceNode, 'tr'); + var siblingRow = currentRow[siblingDirection]; + + if (siblingRow) { + moveCursorToRow(ed, sourceNode, siblingRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } else { + var tableNode = ed.dom.getParent(currentRow, 'table'); + var middleNode = currentRow.parentNode; + var parentNodeName = middleNode.nodeName.toLowerCase(); + if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { + var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); + if (targetParent !== null) { + return moveToRowInTarget(upBool, targetParent, sourceNode, event); + } + } + return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); + } + } + + function getTargetParent(upBool, topNode, secondNode, nodeName) { + var tbodies = ed.dom.select('>' + nodeName, topNode); + var position = tbodies.indexOf(secondNode); + if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { + return getFirstHeadOrFoot(upBool, topNode); + } else if (position === -1) { + var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; + return tbodies[topOrBottom]; + } else { + return tbodies[position + (upBool ? -1 : 1)]; + } + } + + function getFirstHeadOrFoot(upBool, parent) { + var tagName = upBool ? 'thead' : 'tfoot'; + var headOrFoot = ed.dom.select('>' + tagName, parent); + return headOrFoot.length !== 0 ? headOrFoot[0] : null; + } + + function moveToRowInTarget(upBool, targetParent, sourceNode, event) { + var targetRow = getChildForDirection(targetParent, upBool); + targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } + + function escapeTable(upBool, currentRow, siblingDirection, table, event) { + var tableSibling = table[siblingDirection]; + if (tableSibling) { + moveCursorToStartOfElement(tableSibling); + return true; + } else { + var parentCell = ed.dom.getParent(table, 'td,th'); + if (parentCell) { + return handle(upBool, parentCell, event); + } else { + var backUpSibling = getChildForDirection(currentRow, !upBool); + moveCursorToStartOfElement(backUpSibling); + return tinymce.dom.Event.cancel(event); + } + } + } + + function getChildForDirection(parent, up) { + var child = parent && parent[up ? 'lastChild' : 'firstChild']; + // BR is not a valid table child to return in this case we return the table cell + return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child; + } + + function moveCursorToStartOfElement(n) { + ed.selection.setCursorLocation(n, 0); + } + + function isVerticalMovement() { + return key == VK.UP || key == VK.DOWN; + } + + function isInTable(ed) { + var node = ed.selection.getNode(); + var currentRow = ed.dom.getParent(node, 'tr'); + return currentRow !== null; + } + + function columnIndex(column) { + var colIndex = 0; + var c = column; + while (c.previousSibling) { + c = c.previousSibling; + colIndex = colIndex + getSpanVal(c, "colspan"); + } + return colIndex; + } + + function findColumn(rowElement, columnIndex) { + var c = 0; + var r = 0; + each(rowElement.children, function(cell, i) { + c = c + getSpanVal(cell, "colspan"); + r = i; + if (c > columnIndex) + return false; + }); + return r; + } + + function moveCursorToRow(ed, node, row, upBool) { + var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); + var tgtColumnIndex = findColumn(row, srcColumnIndex); + var tgtNode = row.childNodes[tgtColumnIndex]; + var rowCellTarget = getChildForDirection(tgtNode, upBool); + moveCursorToStartOfElement(rowCellTarget || tgtNode); + } + + function shouldFixCaret(preBrowserNode) { + var newNode = ed.selection.getNode(); + var newParent = ed.dom.getParent(newNode, 'td,th'); + var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); + return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) + } + + function checkSameParentTable(nodeOne, NodeTwo) { + return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); + } + + if (isVerticalMovement() && isInTable(ed)) { + var preBrowserNode = ed.selection.getNode(); + setTimeout(function() { + if (shouldFixCaret(preBrowserNode)) { + handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); + } + }, 0); + } + } + + ed.onKeyDown.add(moveSelection); + } + + // Fixes an issue on Gecko where it's impossible to place the caret behind a table + // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled + function fixTableCaretPos() { + var last; + + // Skip empty text nodes form the end + for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; + + if (last && last.nodeName == 'TABLE') { + if (ed.settings.forced_root_block) + ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '
            '); + else + ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'}); + } + }; + + // Fixes an bug where it's impossible to place the caret before a table in Gecko + // this fix solves it by detecting when the caret is at the beginning of such a table + // and then manually moves the caret infront of the table + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + var rng, table, dom = ed.dom; + + // On gecko it's not possible to place the caret before a table + if (e.keyCode == 37 || e.keyCode == 38) { + rng = ed.selection.getRng(); + table = dom.getParent(rng.startContainer, 'table'); + + if (table && ed.getBody().firstChild == table) { + if (isAtStart(rng, table)) { + rng = dom.createRng(); + + rng.setStartBefore(table); + rng.setEndBefore(table); + + ed.selection.setRng(rng); + + e.preventDefault(); + } + } + } + }); + } + + ed.onKeyUp.add(fixTableCaretPos); + ed.onSetContent.add(fixTableCaretPos); + ed.onVisualAid.add(fixTableCaretPos); + + ed.onPreProcess.add(function(ed, o) { + var last = o.node.lastChild; + + if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") { + ed.dom.remove(last); + } + }); + + + /** + * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line + * + * Removed: Since the new enter logic seems to fix this one. + */ + /* + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) { + var node = ed.selection.getRng().startContainer; + var tableCell = dom.getParent(node, 'td,th'); + if (tableCell) { + var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF"); + dom.insertAfter(zeroSizedNbsp, node); + } + } + }); + } + */ + + fixTableCaretPos(); + ed.startContent = ed.getContent({format : 'raw'}); + }); + + // Register action commands + each({ + mceTableSplitCells : function(grid) { + grid.split(); + }, + + mceTableMergeCells : function(grid) { + var rowSpan, colSpan, cell; + + cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); + if (cell) { + rowSpan = cell.rowSpan; + colSpan = cell.colSpan; + } + + if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { + winMan.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + rows : rowSpan, + cols : colSpan, + onaction : function(data) { + grid.merge(cell, data.cols, data.rows); + }, + plugin_url : url + }); + } else + grid.merge(); + }, + + mceTableInsertRowBefore : function(grid) { + grid.insertRow(true); + }, + + mceTableInsertRowAfter : function(grid) { + grid.insertRow(); + }, + + mceTableInsertColBefore : function(grid) { + grid.insertCol(true); + }, + + mceTableInsertColAfter : function(grid) { + grid.insertCol(); + }, + + mceTableDeleteCol : function(grid) { + grid.deleteCols(); + }, + + mceTableDeleteRow : function(grid) { + grid.deleteRows(); + }, + + mceTableCutRow : function(grid) { + clipboardRows = grid.cutRows(); + }, + + mceTableCopyRow : function(grid) { + clipboardRows = grid.copyRows(); + }, + + mceTablePasteRowBefore : function(grid) { + grid.pasteRows(clipboardRows, true); + }, + + mceTablePasteRowAfter : function(grid) { + grid.pasteRows(clipboardRows); + }, + + mceTableDelete : function(grid) { + grid.deleteTable(); + } + }, function(func, name) { + ed.addCommand(name, function() { + var grid = createTableGrid(); + + if (grid) { + func(grid); + ed.execCommand('mceRepaint'); + cleanup(); + } + }); + }); + + // Register dialog commands + each({ + mceInsertTable : function(val) { + winMan.open({ + url : url + '/table.htm', + width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), + height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + action : val ? val.action : 0 + }); + }, + + mceTableRowProps : function() { + winMan.open({ + url : url + '/row.htm', + width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }, + + mceTableCellProps : function() { + winMan.open({ + url : url + '/cell.htm', + width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + } + }, function(func, name) { + ed.addCommand(name, function(ui, val) { + func(val); + }); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(tinymce); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js new file mode 100644 index 00000000..02ecf22c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js @@ -0,0 +1,319 @@ +tinyMCEPopup.requireLangPack(); + +var ed; + +function init() { + ed = tinyMCEPopup.editor; + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + + var inst = ed; + var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); + var formObj = document.forms[0]; + var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); + + // Get table cell data + var celltype = tdElm.nodeName.toLowerCase(); + var align = ed.dom.getAttrib(tdElm, 'align'); + var valign = ed.dom.getAttrib(tdElm, 'valign'); + var width = trimSize(getStyle(tdElm, 'width', 'width')); + var height = trimSize(getStyle(tdElm, 'height', 'height')); + var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); + var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); + var className = ed.dom.getAttrib(tdElm, 'class'); + var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + var id = ed.dom.getAttrib(tdElm, 'id'); + var lang = ed.dom.getAttrib(tdElm, 'lang'); + var dir = ed.dom.getAttrib(tdElm, 'dir'); + var scope = ed.dom.getAttrib(tdElm, 'scope'); + + // Setup form + addClassesToList('class', 'table_cell_styles'); + TinyMCE_EditableSelects.init(); + + if (!ed.dom.hasClass(tdElm, 'mceSelected')) { + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.backgroundimage.value = backgroundimage; + formObj.width.value = width; + formObj.height.value = height; + formObj.id.value = id; + formObj.lang.value = lang; + formObj.style.value = ed.dom.serializeStyle(st); + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'valign', valign); + selectByValue(formObj, 'class', className, true, true); + selectByValue(formObj, 'celltype', celltype); + selectByValue(formObj, 'dir', dir); + selectByValue(formObj, 'scope', scope); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + } else + tinyMCEPopup.dom.hide('action'); +} + +function updateAction() { + var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getStart(); + tdElm = ed.dom.getParent(el, "td,th"); + trElm = ed.dom.getParent(el, "tr"); + tableElm = ed.dom.getParent(el, "table"); + + // Cell is selected + if (ed.dom.hasClass(tdElm, 'mceSelected')) { + // Update all selected sells + tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { + updateCell(td); + }); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (getSelectValue(formObj, 'action')) { + case "cell": + var celltype = getSelectValue(formObj, 'celltype'); + var scope = getSelectValue(formObj, 'scope'); + + function doUpdate(s) { + if (s) { + updateCell(tdElm); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + } + }; + + if (ed.getParam("accessibility_warnings", 1)) { + if (celltype == "th" && scope == "") + tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); + else + doUpdate(1); + + return; + } + + updateCell(tdElm); + break; + + case "row": + var cell = trElm.firstChild; + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + cell = updateCell(cell, true); + } while ((cell = nextCell(cell)) != null); + + break; + + case "col": + var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + if (cell == tdElm) + break; + col += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1; + } while ((cell = nextCell(cell)) != null); + + for (var i=0; i 0) { + tinymce.each(tableElm.rows, function(tr) { + var i; + + for (i = 0; i < tr.cells.length; i++) { + if (dom.hasClass(tr.cells[i], 'mceSelected')) { + updateRow(tr, true); + return; + } + } + }); + + inst.addVisual(); + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (action) { + case "row": + updateRow(trElm); + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + + if (!isCssSize(border)) { + dom.setAttrib(elm, 'border', border); + } else { + dom.setAttrib(elm, 'border', ''); + } + + if (border == '') { + dom.setStyle(elm, 'border-width', ''); + dom.setStyle(elm, 'border', ''); + dom.setAttrib(elm, 'border', ''); + } + + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
            '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = cssSize(border); + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); + } else + inst.execCommand('mceInsertContent', false, html); + + tinymce.each(dom.select('table[data-mce-new]'), function(node) { + var tdorth = dom.select('td,th', node); + + // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document + if (tinymce.isIE && node.nextSibling == null) { + if (inst.settings.forced_root_block) + dom.insertAfter(dom.create(inst.settings.forced_root_block), node); + else + dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node); + } + + try { + // IE9 might fail to do this selection + inst.selection.setCursorLocation(tdorth[0], 0); + } catch (ex) { + // Ignore + } + + dom.setAttrib(node, 'data-mce-new', ''); + }); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + // Hide advanced fields that isn't available in the schema + tinymce.each("summary id rules dir style frame".split(" "), function(name) { + var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr"); + + if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) { + tr.style.display = 'none'; + } + }); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function isCssSize(value) { + return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); +} + +function cssSize(value, def) { + value = tinymce.trim(value || def); + + if (!isCssSize(value)) { + return parseInt(value, 10) + 'px'; + } + + return value; +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) + st['border-width'] = cssSize(formObj.border.value); + else { + if (!formObj.border.value) { + st['border'] = ''; + st['border-width'] = ''; + } + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = cssSize(formObj.border.value, 1); + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js new file mode 100644 index 00000000..5a64ebd7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.table_dlg',{"rules_border":"alle 4 Seiten (Border)","rules_box":"alle 4 Seiten (Box)","rules_vsides":"links und rechts","rules_rhs":"nur rechts","rules_lhs":"nur links","rules_hsides":"oben und unten","rules_below":"nur unten","rules_above":"nur oben","rules_void":"keins",rules:"Gitter","frame_all":"zwischen allen Zellen","frame_cols":"zwischen Spalten","frame_rows":"zwischen Zeilen","frame_groups":"zwischen Gruppen","frame_none":"keine",frame:"Rahmen",caption:"Beschriftung der Tabelle","missing_scope":"Wollen Sie wirklich keine Beziehung f\u00fcr diese \u00dcberschrift angeben? Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.","cell_limit":"Sie haben die maximale Zellenzahl von {$cells} \u00fcberschritten.","row_limit":"Sie haben die maximale Zeilenzahl von {$rows} \u00fcberschritten.","col_limit":"Sie haben die maximale Spaltenzahl von {$cols} \u00fcberschritten.",colgroup:"Horizontal gruppieren",rowgroup:"Vertikal gruppieren",scope:"Bezug",tfoot:"Tabellenfu\u00df",tbody:"Tabelleninhalt",thead:"Tabellenkopf","row_all":"Alle Zeilen ver\u00e4ndern","row_even":"Gerade Zeilen ver\u00e4ndern","row_odd":"Ungerade Zeilen ver\u00e4ndern","row_row":"Diese Zeile ver\u00e4ndern","cell_all":"Alle Zellen der Tabelle ver\u00e4ndern","cell_row":"Alle Zellen in dieser Zeile ver\u00e4ndern","cell_cell":"Diese Zelle ver\u00e4ndern",th:"\u00dcberschrift",td:"Textzelle",summary:"Zusammenfassung",bgimage:"Hintergrundbild",rtl:"Rechts nach links",ltr:"Links nach rechts",mime:"MIME-Type des Inhalts",langcode:"Sprachcode",langdir:"Schriftrichtung",style:"Format",id:"ID","merge_cells_title":"Zellen vereinen",bgcolor:"Hintergrundfarbe",bordercolor:"Rahmenfarbe","align_bottom":"Unten","align_top":"Oben",valign:"Vertikale Ausrichtung","cell_type":"Zellentyp","cell_title":"Eigenschaften der Zelle","row_title":"Eigenschaften der Zeile","align_middle":"Mittig","align_right":"Rechts","align_left":"Links","align_default":"Standard",align:"Ausrichtung",border:"Rahmen",cellpadding:"Abstand innerhalb der Zellen",cellspacing:"Zellenabstand",rows:"Zeilen",cols:"Spalten",height:"H\u00f6he",width:"Breite",title:"Tabelle einf\u00fcgen/bearbeiten",rowtype:"Gruppierung","advanced_props":"Erweiterte Einstellungen","general_props":"Allgemeine Einstellungen","advanced_tab":"Erweitert","general_tab":"Allgemein","cell_col":"Alle Zellen in dieser Spalte aktualisieren"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js new file mode 100644 index 00000000..463e09ee --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm new file mode 100644 index 00000000..d231090e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm @@ -0,0 +1,32 @@ + + + + {#table_dlg.merge_cells_title} + + + + + + +
            +
            + {#table_dlg.merge_cells_title} + + + + + + + + + +
            :
            :
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/row.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/row.htm new file mode 100644 index 00000000..6ebef284 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/row.htm @@ -0,0 +1,158 @@ + + + + {#table_dlg.row_title} + + + + + + + + + +
            + + +
            +
            +
            + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + +
            + +
            +
            +
            + +
            +
            + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + + + + + +
             
            +
            + + + + + + +
             
            +
            +
            +
            +
            +
            + +
            +
            + +
            + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/table.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/table.htm new file mode 100644 index 00000000..4b5dc318 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/table/table.htm @@ -0,0 +1,194 @@ + + + + {#table_dlg.title} + + + + + + + + + + +
            + + +
            +
            +
            + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            +
            + +
            +
            + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + + + + + +
             
            +
            + +
            + +
            + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            +
            +
            +
            + +
            +
              +
            • + +
            • +
            • + +
            • +
            +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/blank.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/blank.htm new file mode 100644 index 00000000..ecde53fa --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/blank.htm @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/css/template.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/css/template.css new file mode 100644 index 00000000..2d23a493 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/css/template.css @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js new file mode 100644 index 00000000..ebe3c27d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/js/template.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/js/template.js new file mode 100644 index 00000000..bc3045d2 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template/js/template.js @@ -0,0 +1,106 @@ +tinyMCEPopup.requireLangPack(); + +var TemplateDialog = { + preInit : function() { + var url = tinyMCEPopup.getParam("template_external_list_url"); + + if (url != null) + document.write(''); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x + + {#template_dlg.title} + + + + + +
            +
            +
            {#template_dlg.desc}
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            + +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm new file mode 100644 index 00000000..ecde53fa --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css new file mode 100644 index 00000000..2d23a493 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js new file mode 100644 index 00000000..ebe3c27d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js new file mode 100644 index 00000000..bc3045d2 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js @@ -0,0 +1,106 @@ +tinyMCEPopup.requireLangPack(); + +var TemplateDialog = { + preInit : function() { + var url = tinyMCEPopup.getParam("template_external_list_url"); + + if (url != null) + document.write(''); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x + + {#template_dlg.title} + + + + + +
            +
            +
            {#template_dlg.desc}
            +
            + +
            +
            +
            +
            + {#template_dlg.preview} + +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css new file mode 100644 index 00000000..76bc92b5 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css @@ -0,0 +1,21 @@ +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre, figure {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat} +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre, figure {margin-left: 3px} +section, article, address, hgroup, aside, figure {margin: 0 0 1em 3px} + +p {background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)} +h1 {background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)} +h2 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)} +h3 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)} +h4 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)} +h5 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)} +h6 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)} +div {background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)} +section {background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)} +article {background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)} +blockquote {background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)} +address {background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)} +pre {background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)} +hgroup {background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)} +aside {background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)} +figure {background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)} +figcaption {border: 1px dashed #BBB} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js new file mode 100644 index 00000000..c65eaf2b --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.VisualBlocks",{init:function(a,b){var c;if(!window.NodeList){return}a.addCommand("mceVisualBlocks",function(){var e=a.dom,d;if(!c){c=e.uniqueId();d=e.create("link",{id:c,rel:"stylesheet",href:b+"/css/visualblocks.css"});a.getDoc().getElementsByTagName("head")[0].appendChild(d)}else{d=e.get(c);d.disabled=!d.disabled}a.controlManager.setActive("visualblocks",!d.disabled)});a.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"});a.onInit.add(function(){if(a.settings.visualblocks_default_state){a.execCommand("mceVisualBlocks",false,null,{skip_focus:true})}})},getInfo:function(){return{longname:"Visual blocks",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("visualblocks",tinymce.plugins.VisualBlocks)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js new file mode 100644 index 00000000..b9d2ab2e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js @@ -0,0 +1,63 @@ +/** + * editor_plugin_src.js + * + * Copyright 2012, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualBlocks', { + init : function(ed, url) { + var cssId; + + // We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects + if (!window.NodeList) { + return; + } + + ed.addCommand('mceVisualBlocks', function() { + var dom = ed.dom, linkElm; + + if (!cssId) { + cssId = dom.uniqueId(); + linkElm = dom.create('link', { + id: cssId, + rel : 'stylesheet', + href : url + '/css/visualblocks.css' + }); + + ed.getDoc().getElementsByTagName('head')[0].appendChild(linkElm); + } else { + linkElm = dom.get(cssId); + linkElm.disabled = !linkElm.disabled; + } + + ed.controlManager.setActive('visualblocks', !linkElm.disabled); + }); + + ed.addButton('visualblocks', {title : 'visualblocks.desc', cmd : 'mceVisualBlocks'}); + + ed.onInit.add(function() { + if (ed.settings.visualblocks_default_state) { + ed.execCommand('mceVisualBlocks', false, null, {skip_focus : true}); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual blocks', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('visualblocks', tinymce.plugins.VisualBlocks); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js new file mode 100644 index 00000000..1a148e8b --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!="raw"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive("visualchars",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(g=0;g$1');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js new file mode 100644 index 00000000..df985905 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js @@ -0,0 +1,83 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualChars', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceVisualChars', t._toggleVisualChars, t); + + // Register buttons + ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); + + ed.onBeforeGetContent.add(function(ed, o) { + if (t.state && o.format != 'raw' && !o.draft) { + t.state = true; + t._toggleVisualChars(false); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual characters', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _toggleVisualChars : function(bookmark) { + var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; + + t.state = !t.state; + ed.controlManager.setActive('visualchars', t.state); + + if (bookmark) + bm = s.getBookmark(); + + if (t.state) { + nl = []; + tinymce.walk(b, function(n) { + if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) + nl.push(n); + }, 'childNodes'); + + for (i = 0; i < nl.length; i++) { + nv = nl[i].nodeValue; + nv = nv.replace(/(\u00a0)/g, '$1'); + + div = ed.dom.create('div', null, nv); + while (node = div.lastChild) + ed.dom.insertAfter(node, nl[i]); + + ed.dom.remove(nl[i]); + } + } else { + nl = ed.dom.select('span.mceItemNbsp', b); + + for (i = nl.length - 1; i >= 0; i--) + ed.dom.remove(nl[i], 1); + } + + s.moveToBookmark(bm); + } + }); + + // Register plugin + tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js new file mode 100644 index 00000000..42ece209 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(k,"span",{},'0')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js new file mode 100644 index 00000000..34b26555 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js @@ -0,0 +1,122 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.WordCount', { + block : 0, + id : null, + countre : null, + cleanre : null, + + init : function(ed, url) { + var t = this, last = 0, VK = tinymce.VK; + + t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ + t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); + t.update_rate = ed.getParam('wordcount_update_rate', 2000); + t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); + t.id = ed.id + '-word-count'; + + ed.onPostRender.add(function(ed, cm) { + var row, id; + + // Add it to the specified id or the theme advanced path + id = ed.getParam('wordcount_target_id'); + if (!id) { + row = tinymce.DOM.get(ed.id + '_path_row'); + + if (row) + tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); + } else { + tinymce.DOM.add(id, 'span', {}, '0'); + } + }); + + ed.onInit.add(function(ed) { + ed.selection.onSetContent.add(function() { + t._count(ed); + }); + + t._count(ed); + }); + + ed.onSetContent.add(function(ed) { + t._count(ed); + }); + + function checkKeys(key) { + return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); + } + + function checkDelOrBksp(key) { + return key === VK.DELETE || key === VK.BACKSPACE; + } + + ed.onKeyUp.add(function(ed, e) { + if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { + t._count(ed); + } + + last = e.keyCode; + }); + }, + + _getCount : function(ed) { + var tc = 0; + var tx = ed.getContent({ format: 'raw' }); + + if (tx) { + tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces + tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + + // deal with html entities + tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); + tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation + + var wordArray = tx.match(this.countre); + if (wordArray) { + tc = wordArray.length; + } + } + + return tc; + }, + + _count : function(ed) { + var t = this; + + // Keep multiple calls from happening at the same time + if (t.block) + return; + + t.block = 1; + + setTimeout(function() { + if (!ed.destroyed) { + var tc = t._getCount(ed); + tinymce.DOM.setHTML(t.id, tc.toString()); + setTimeout(function() {t.block = 0;}, t.update_rate); + } + }, 1); + }, + + getInfo: function() { + return { + longname : 'Word Count plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); +})(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm new file mode 100644 index 00000000..30a894f7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm new file mode 100644 index 00000000..c1093459 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm new file mode 100644 index 00000000..e8d606a3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm new file mode 100644 index 00000000..0ac6bdb6 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css new file mode 100644 index 00000000..9a6a235c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css @@ -0,0 +1,11 @@ +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css new file mode 100644 index 00000000..e67114db --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css @@ -0,0 +1,9 @@ +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm new file mode 100644 index 00000000..5f667510 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
            : + + + + + +
            +
            :
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js new file mode 100644 index 00000000..9b98a515 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js new file mode 100644 index 00000000..f2405721 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -0,0 +1,132 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), + height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + + ed.onPreInit.add(function() { + // Fixed IE issue where it can't handle these elements correctly + ed.dom.create('abbr'); + }); + }, + + getInfo : function() { + return { + longname : 'XHTML Xtras Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm new file mode 100644 index 00000000..d001ac7c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
            : + + + + + +
            +
            :
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js new file mode 100644 index 00000000..4b51a257 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js @@ -0,0 +1,28 @@ +/** + * abbr.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement('abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js new file mode 100644 index 00000000..6ec2f887 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js @@ -0,0 +1,28 @@ +/** + * acronym.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js new file mode 100644 index 00000000..9c99995a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js @@ -0,0 +1,111 @@ +/** + * attributes.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + dom.setAttrib(elm, attrib.toLowerCase(), value); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + setAttrib(elm, 'onfocus'); + setAttrib(elm, 'onblur'); + setAttrib(elm, 'onclick'); + setAttrib(elm, 'ondblclick'); + setAttrib(elm, 'onmousedown'); + setAttrib(elm, 'onmouseup'); + setAttrib(elm, 'onmouseover'); + setAttrib(elm, 'onmousemove'); + setAttrib(elm, 'onmouseout'); + setAttrib(elm, 'onkeypress'); + setAttrib(elm, 'onkeydown'); + setAttrib(elm, 'onkeyup'); + + // Refresh in old MSIE +// if (tinyMCE.isMSIE5) +// elm.outerHTML = elm.outerHTML; +} + +function insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js new file mode 100644 index 00000000..009b7154 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js @@ -0,0 +1,28 @@ +/** + * cite.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js new file mode 100644 index 00000000..1f957dc7 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -0,0 +1,53 @@ +/** + * del.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('del'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertDel() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('del'); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); + for (var i=0; i 0) { + tagName = element_name; + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select('span,font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); + }); +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js new file mode 100644 index 00000000..c4addfb0 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js @@ -0,0 +1,53 @@ +/** + * ins.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('ins'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertIns() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); + for (var i=0; i + + + {#advanced_dlg.about_title} + + + + + + + +
            +
            +

            {#advanced_dlg.about_title}

            +

            Version: ()

            +

            TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

            +

            Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

            +

            For more information about this software visit the TinyMCE website.

            + +
            + Got Moxie? +
            +
            + +
            +
            +

            {#advanced_dlg.about_loaded}

            + +
            +
            + +

             

            +
            +
            + +
            +
            +
            +
            + +
            + +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm new file mode 100644 index 00000000..75c93b79 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm @@ -0,0 +1,26 @@ + + + + {#advanced_dlg.anchor_title} + + + + +
            + + + + + + + + +
            {#advanced_dlg.anchor_title}
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm new file mode 100644 index 00000000..00ab086f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm @@ -0,0 +1,55 @@ + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + + + + + +
            + + + + + + + + + +
             
             
            +
            + + + + + + + + + + + + + + + + +
             
             
             
            +
            {#advanced_dlg.charmap_usage}
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm new file mode 100644 index 00000000..b625531a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm @@ -0,0 +1,70 @@ + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
            + + +
            +
            +
            + {#advanced_dlg.colorpicker_picker_title} +
            + + +
            + +
            + +
            +
            +
            +
            + +
            +
            + {#advanced_dlg.colorpicker_palette_title} +
            + +
            + +
            +
            +
            + +
            +
            + {#advanced_dlg.colorpicker_named_title} +
            + +
            + +
            + +
            + {#advanced_dlg.colorpicker_name} +
            +
            +
            +
            + +
            + + +
            +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js new file mode 100644 index 00000000..4b8d5637 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js @@ -0,0 +1 @@ +(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(p,m){var k,l,o=p.dom,j="",n,r;previewStyles=p.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function q(s){return s.replace(/%(\w+)/g,"")}k=m.block||m.inline||"span";l=o.create(k);f(m.styles,function(t,s){t=q(t);if(t){o.setStyle(l,s,t)}});f(m.attributes,function(t,s){t=q(t);if(t){o.setAttrib(l,s,t)}});f(m.classes,function(s){s=q(s);if(!o.hasClass(l,s)){o.addClass(l,s)}});o.setStyles(l,{position:"absolute",left:-65535});p.getBody().appendChild(l);n=o.getStyle(p.getBody(),"fontSize",true);n=/px$/.test(n)?parseInt(n,10):0;f(previewStyles.split(" "),function(s){var t=o.getStyle(l,s,true);if(s=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)){t=o.getStyle(p.getBody(),s,true);if(o.toHex(t).toLowerCase()=="#ffffff"){return}}if(s=="font-size"){if(/em|%$/.test(t)){if(n===0){return}t=parseFloat(t,10)/(/%$/.test(t)?100:1);t=(t*n)+"px"}}j+=s+":"+t+";"});o.remove(l);return j}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);n=k.settings;k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;if(!n.theme_advanced_buttons1){n=c({theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap"},n)}m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"top",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},n);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},""),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true);q.nodeChanged()}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js new file mode 100644 index 00000000..82166dcb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js @@ -0,0 +1,1490 @@ +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Generates a preview for a format + function getPreviewCss(ed, fmt) { + var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName; + + previewStyles = ed.settings.preview_styles; + + // No preview forced + if (previewStyles === false) + return ''; + + // Default preview + if (!previewStyles) + previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color'; + + // Removes any variables since these can't be previewed + function removeVars(val) { + return val.replace(/%(\w+)/g, ''); + }; + + // Create block/inline element to use for preview + name = fmt.block || fmt.inline || 'span'; + previewElm = dom.create(name); + + // Add format styles to preview element + each(fmt.styles, function(value, name) { + value = removeVars(value); + + if (value) + dom.setStyle(previewElm, name, value); + }); + + // Add attributes to preview element + each(fmt.attributes, function(value, name) { + value = removeVars(value); + + if (value) + dom.setAttrib(previewElm, name, value); + }); + + // Add classes to preview element + each(fmt.classes, function(value) { + value = removeVars(value); + + if (!dom.hasClass(previewElm, value)) + dom.addClass(previewElm, value); + }); + + // Add the previewElm outside the visual area + dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); + ed.getBody().appendChild(previewElm); + + // Get parent container font size so we can compute px values out of em/% for older IE:s + parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true); + parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; + + each(previewStyles.split(' '), function(name) { + var value = dom.getStyle(previewElm, name, true); + + // If background is transparent then check if the body has a background color we can use + if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { + value = dom.getStyle(ed.getBody(), name, true); + + // Ignore white since it's the default color, not the nicest fix + if (dom.toHex(value).toLowerCase() == '#ffffff') { + return; + } + } + + // Old IE won't calculate the font size so we need to do that manually + if (name == 'font-size') { + if (/em|%$/.test(value)) { + if (parentFontSize === 0) { + return; + } + + // Convert font size from em/% to px + value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); + value = (value * parentFontSize) + 'px'; + } + } + + previewCss += name + ':' + value + ';'; + }); + + dom.remove(previewElm); + + return previewCss; + }; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + controls : { + bold : ['bold_desc', 'Bold'], + italic : ['italic_desc', 'Italic'], + underline : ['underline_desc', 'Underline'], + strikethrough : ['striketrough_desc', 'Strikethrough'], + justifyleft : ['justifyleft_desc', 'JustifyLeft'], + justifycenter : ['justifycenter_desc', 'JustifyCenter'], + justifyright : ['justifyright_desc', 'JustifyRight'], + justifyfull : ['justifyfull_desc', 'JustifyFull'], + bullist : ['bullist_desc', 'InsertUnorderedList'], + numlist : ['numlist_desc', 'InsertOrderedList'], + outdent : ['outdent_desc', 'Outdent'], + indent : ['indent_desc', 'Indent'], + cut : ['cut_desc', 'Cut'], + copy : ['copy_desc', 'Copy'], + paste : ['paste_desc', 'Paste'], + undo : ['undo_desc', 'Undo'], + redo : ['redo_desc', 'Redo'], + link : ['link_desc', 'mceLink'], + unlink : ['unlink_desc', 'unlink'], + image : ['image_desc', 'mceImage'], + cleanup : ['cleanup_desc', 'mceCleanup'], + help : ['help_desc', 'mceHelp'], + code : ['code_desc', 'mceCodeEditor'], + hr : ['hr_desc', 'InsertHorizontalRule'], + removeformat : ['removeformat_desc', 'RemoveFormat'], + sub : ['sub_desc', 'subscript'], + sup : ['sup_desc', 'superscript'], + forecolor : ['forecolor_desc', 'ForeColor'], + forecolorpicker : ['forecolor_desc', 'mceForeColor'], + backcolor : ['backcolor_desc', 'HiliteColor'], + backcolorpicker : ['backcolor_desc', 'mceBackColor'], + charmap : ['charmap_desc', 'mceCharMap'], + visualaid : ['visualaid_desc', 'mceToggleVisualAid'], + anchor : ['anchor_desc', 'mceInsertAnchor'], + newdocument : ['newdocument_desc', 'mceNewDocument'], + blockquote : ['blockquote_desc', 'mceBlockQuote'] + }, + + stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], + + init : function(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + s = ed.settings; + + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + + // Setup default buttons + if (!s.theme_advanced_buttons1) { + s = extend({ + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap" + }, s); + } + + // Default settings + t.settings = s = extend({ + theme_advanced_path : true, + theme_advanced_toolbar_location : 'top', + theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "bottom", + theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", + theme_advanced_more_colors : 1, + theme_advanced_row_height : 23, + theme_advanced_resize_horizontal : 1, + theme_advanced_resizing_use_cookie : 1, + theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, + readonly : ed.settings.readonly + }, s); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + + if (/^\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + + // Init editor + ed.onInit.add(function() { + if (!ed.settings.readonly) { + ed.onNodeChange.add(t._nodeChanged, t); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + case "styleselect": + return this._createStyleSelect(); + + case "formatselect": + return this._createBlockFormats(); + + case "fontselect": + return this._createFontSelect(); + + case "fontsizeselect": + return this._createFontSizeSelect(); + + case "forecolor": + return this._createForeColorMenu(); + + case "backcolor": + return this._createBackColorMenu(); + } + + if ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); + + if (ctrl.getLength() == 0) { + each(ed.dom.getClasses(), function(o, idx) { + var name = 'style_' + idx, fmt; + + fmt = { + inline : 'span', + attributes : {'class' : o['class']}, + selector : '*' + }; + + ed.formatter.register(name, fmt); + + ctrl.add(o['class'], name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; + + // Setup style select box + ctrl = ctrlMan.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(name) { + var matches, formatNames = [], removedFormat; + + each(ctrl.items, function(item) { + formatNames.push(item.value); + }); + + ed.focus(); + ed.undoManager.add(); + + // Toggle off the current format(s) + matches = ed.formatter.matchAll(formatNames); + tinymce.each(matches, function(match) { + if (!name || match == name) { + if (match) + ed.formatter.remove(match); + + removedFormat = true; + } + }); + + if (!removedFormat) + ed.formatter.apply(name); + + ed.undoManager.add(); + ed.nodeChanged(); + + return false; // No auto select + } + }); + + // Handle specified format + ed.onPreInit.add(function() { + var counter = 0, formats = ed.getParam('style_formats'); + + if (formats) { + each(formats, function(fmt) { + var name, keys = 0; + + each(fmt, function() {keys++;}); + + if (keys > 1) { + name = fmt.name = fmt.name || 'style_' + (counter++); + ed.formatter.register(name, fmt); + ctrl.add(fmt.title, name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } else + ctrl.add(fmt.title); + }); + } else { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { + var name, fmt; + + if (val) { + name = 'style_' + (counter++); + fmt = { + inline : 'span', + classes : val, + selector : '*' + }; + + ed.formatter.register(name, fmt); + ctrl.add(t.editor.translate(key), name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } + }); + } + }); + + // Auto import classes if the ctrl box is empty + if (ctrl.getLength() == 0) { + ctrl.onPostRender.add(function(ed, n) { + if (!ctrl.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return ctrl; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', { + title : 'advanced.fontdefault', + onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + + ed.execCommand('FontName', false, v); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && cur.value == v) { + c.select(null); + } + + return false; // No auto select + } + }); + + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + + if (v['class']) { + ed.focus(); + ed.undoManager.add(); + ed.formatter.toggle('fontsize_class', {value : v['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else + ed.execCommand('FontSize', false, v.fontSize); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { + c.select(null); + } + + return false; // No auto select + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + p : 'advanced.paragraph', + address : 'advanced.address', + pre : 'advanced.pre', + h1 : 'advanced.h1', + h2 : 'advanced.h2', + h3 : 'advanced.h3', + h4 : 'advanced.h4', + h5 : 'advanced.h5', + h6 : 'advanced.h6', + div : 'advanced.div', + blockquote : 'advanced.blockquote', + code : 'advanced.code', + dt : 'advanced.dt', + dd : 'advanced.dd', + samp : 'advanced.samp' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() { + return getPreviewCss(t.editor, {block: v}); + }}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = sc.rows; + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + return false; + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + // Make sure focus is given to toolbar in Safari. + // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame + if (tinymce.isWebKit) { + window.focus(); + } + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_ifr'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h, store) { + var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Resize iframe and container + DOM.setStyle(e, 'height', ''); + DOM.setStyle(ifr, 'height', h); + + if (s.theme_advanced_resize_horizontal) { + DOM.setStyle(e, 'width', ''); + DOM.setStyle(ifr, 'width', w); + + // Make sure that the size is never smaller than the over all ui + if (w < e.clientWidth) { + w = e.clientWidth; + DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); + } + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + return false; + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (c.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false; + + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); + + t.toolbarGroup = toolbarGroup; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"}); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + toolbarsExist = true; + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + toolbarGroup.add(tb); + + o.deltaHeight -= s.theme_advanced_row_height; + } + // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly + if (!toolbarsExist) + o.deltaHeight -= s.theme_advanced_row_height; + h.push(toolbarGroup.renderHTML()); + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + + + if (s.theme_advanced_resizing) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + t.resizeTo(o.cw, o.ch); + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var mouseMoveHandler1, mouseMoveHandler2, + mouseUpHandler1, mouseUpHandler2, + startX, startY, startWidth, startHeight, width, height, ifrElm; + + function resizeOnMove(e) { + e.preventDefault(); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + + t.resizeTo(width, height); + }; + + function endResize(e) { + // Stop listening + Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); + Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); + Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); + Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); + + ed.nodeChanged(); + }; + + e.preventDefault(); + + // Get the current rect size + startX = e.screenX; + startY = e.screenY; + ifrElm = DOM.get(t.editor.id + '_ifr'); + startWidth = width = ifrElm.clientWidth; + startHeight = height = ifrElm.clientHeight; + + // Register envent handlers + mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); + mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); + mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); + mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _updateUndoStatus : function(ed) { + var cm = ed.controlManager, um = ed.undoManager; + + cm.setDisabled('undo', !um.hasUndo() && !um.typing); + cm.setDisabled('redo', !um.hasRedo()); + }, + + _nodeChanged : function(ed, cm, n, co, ob) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + function getParent(name) { + var i, parents = ob.parents, func = name; + + if (typeof(name) == 'string') { + func = function(node) { + return node.nodeName == name; + }; + } + + for (i = 0; i < parents.length; i++) { + if (func(parents[i])) + return parents[i]; + } + }; + + cm.setActive('visualaid', ed.hasVisual); + t._updateUndoStatus(ed); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = getParent('A'); + if (c = cm.get('link')) { + c.setDisabled((!p && co) || (p && !p.href)); + c.setActive(!!p && (!p.name && !p.id)); + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name && !p.id); + } + + if (c = cm.get('anchor')) { + c.setActive(!co && !!p && (p.name || (p.id && !p.href))); + } + + p = getParent('IMG'); + if (c = cm.get('image')) + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + t._importClasses(); + + formatNames = []; + each(c.items, function(item) { + formatNames.push(item.value); + }); + + matches = ed.formatter.matchAll(formatNames); + c.select(matches[0]); + tinymce.each(matches, function(match, index) { + if (index > 0) { + c.mark(match); + } + }); + } + + if (c = cm.get('formatselect')) { + p = getParent(ed.dom.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + // Find out current fontSize, fontFamily and fontClass + getParent(function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + } + + if (ed.dom.is(n, s.theme_advanced_font_selector)) { + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + // Select font size + if (c = cm.get('fontsizeselect')) { + // Use computed style + if (s.theme_advanced_runtime_fontsize && !fz && !cl) + fz = ed.dom.getStyle(n, 'fontSize', true); + + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + + DOM.setHTML(p, ''); + + getParent(function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and bogus/hidden elements + if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) + return; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName) + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, ''); + + if (v) { + ti += 'class: ' + v + ' '; + + if (ed.dom.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : this.url + '/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : this.url + '/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}(tinymce)); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/image.htm b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/image.htm new file mode 100644 index 00000000..b8ba729f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/image.htm @@ -0,0 +1,80 @@ + + + + {#advanced_dlg.image_title} + + + + + + +
            + + +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            + x +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg new file mode 100644 index 00000000..b1a377ab Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif new file mode 100644 index 00000000..dec3f7c7 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif new file mode 100644 index 00000000..ca222490 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif new file mode 100644 index 00000000..410c7ad0 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif new file mode 100644 index 00000000..acdf4085 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif new file mode 100644 index 00000000..8f10e7aa Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif new file mode 100644 index 00000000..fdfe0b9a Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif new file mode 100644 index 00000000..9314d044 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif new file mode 100644 index 00000000..38848651 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif new file mode 100644 index 00000000..35701040 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif new file mode 100644 index 00000000..ab50f2d8 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js new file mode 100644 index 00000000..5b358457 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js @@ -0,0 +1,73 @@ +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
            ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
            ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
            '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js new file mode 100644 index 00000000..2909a3a4 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js @@ -0,0 +1,56 @@ +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName; + + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + var aRule = ed.schema.getElementRule('a'); + if (!aRule || aRule.attributes.name) { + attribName = 'name'; + } else { + attribName = 'id'; + } + + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + if (elm) { + elm.setAttribute(attribName, name); + elm[attribName] = name; + ed.undoManager.add(); + } else { + // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it + var attrs = {'class' : 'mceItemAnchor'}; + attrs[attribName] = name; + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF')); + ed.nodeChanged(); + } + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js new file mode 100644 index 00000000..bb186955 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js @@ -0,0 +1,363 @@ +/** + * charmap.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); +}); + +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = '
            '+ + ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
            '; + html = html.replace(/<\/tr>/g, ''); + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js new file mode 100644 index 00000000..cc891c17 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js @@ -0,0 +1,345 @@ +tinyMCEPopup.requireLangPack(); + +var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; + +var colors = [ + "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", + "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", + "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", + "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", + "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", + "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", + "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", + "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", + "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", + "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", + "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", + "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", + "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", + "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", + "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", + "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", + "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", + "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", + "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", + "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", + "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", + "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", + "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", + "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", + "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", + "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", + "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" +]; + +var named = { + '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', + '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', + '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', + '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', + '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', + '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', + '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', + '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', + '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', + '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', + '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', + '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', + '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', + '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', + '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', + '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', + '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', + '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', + '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', + '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', + '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', + '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', + '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' +}; + +var namedLookup = {}; + +function init() { + var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; + + tinyMCEPopup.resizeToInnerSize(); + + generatePicker(); + generateWebColors(); + generateNamedColors(); + + if (inputColor) { + changeFinalColor(inputColor); + + col = convertHexToRGB(inputColor); + + if (col) + updateLight(col.r, col.g, col.b); + } + + for (key in named) { + value = named[key]; + namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); + } +} + +function toHexColor(color) { + var matches, red, green, blue, toInt = parseInt; + + function hex(value) { + value = parseInt(value).toString(16); + + return value.length > 1 ? value : '0' + value; // Padd with leading zero + }; + + color = tinymce.trim(color); + color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' + color = namedLookup[color] || color; + + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); + + if (matches) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else { + matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); + + if (matches) { + red = toInt(matches[1], 16); + green = toInt(matches[2], 16); + blue = toInt(matches[3], 16); + } else { + matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); + + if (matches) { + red = toInt(matches[1] + matches[1], 16); + green = toInt(matches[2] + matches[2], 16); + blue = toInt(matches[3] + matches[3], 16); + } else { + return ''; + } + } + } + + return '#' + hex(red) + hex(green) + hex(blue); +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + var hexColor = toHexColor(color); + + if (hexColor === '') { + var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); + tinyMCEPopup.alert(text + ': ' + color); + } + else { + tinyMCEPopup.restoreSelection(); + + if (f) + f(hexColor); + + tinyMCEPopup.close(); + } +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
            '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
            ' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
            '; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value.replace(/ /g, '%20'), + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) { + st[key] = value; + }); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); + this.styleVal = dom.serializeStyle(st, 'img'); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js new file mode 100644 index 00000000..8c1d73c5 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js @@ -0,0 +1,159 @@ +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value + }); + + if (f.target_list) { + ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list")); + } + + if (f.class_list) { + ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list")); + } + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js new file mode 100644 index 00000000..dd5e366f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js @@ -0,0 +1,78 @@ +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + turnWrapOn(); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function setWhiteSpaceCss(value) { + var el = document.getElementById('htmlSource'); + tinymce.DOM.setStyle(el, 'white-space', value); +} + +function turnWrapOff() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre'); + } else { + setWrap('off'); + } +} + +function turnWrapOn() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre-wrap'); + } else { + setWrap('soft'); + } +} + +function toggleWordWrap(elm) { + if (elm.checked) { + turnWrapOn(); + } else { + turnWrapOff(); + } +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js new file mode 100644 index 00000000..034195ca --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advanced',{"underline_desc":"Unterstrichen (Strg+U)","italic_desc":"Kursiv (Strg+I)","bold_desc":"Fett (Strg+B)",dd:"Definitionsbeschreibung",dt:"Definitionsbegriff",samp:"Beispiel",code:"Code",blockquote:"Zitatblock",h6:"\u00dcberschrift 6",h5:"\u00dcberschrift 5",h4:"\u00dcberschrift 4",h3:"\u00dcberschrift 3",h2:"\u00dcberschrift 2",h1:"\u00dcberschrift 1",pre:"Rohdaten",address:"Adresse",div:"Zusammenh\u00e4ngender Bereich",paragraph:"Absatz",block:"Vorlage",fontdefault:"Schriftart","font_size":"Schriftgr\u00f6\u00dfe","style_select":"Format","anchor_delta_width":"13","more_colors":"Weitere Farben","toolbar_focus":"Zur Werkzeugleiste springen: Alt+Q; Zum Editor springen: Alt-Z; Zum Elementpfad springen: Alt-X",newdocument:"Wollen Sie wirklich den ganzen Inhalt l\u00f6schen?",path:"Pfad","clipboard_msg":"Kopieren, Ausschneiden und Einf\u00fcgen sind im Mozilla Firefox nicht m\u00f6glich.\nWollen Sie mehr \u00fcber dieses Problem erfahren?","blockquote_desc":"Zitatblock","help_desc":"Hilfe","newdocument_desc":"Neues Dokument","image_props_desc":"Bildeigenschaften","paste_desc":"Einf\u00fcgen","copy_desc":"Kopieren","cut_desc":"Ausschneiden","anchor_desc":"Anker einf\u00fcgen/ver\u00e4ndern","visualaid_desc":"Hilfslinien und unsichtbare Elemente ein-/ausblenden","charmap_desc":"Sonderzeichen einf\u00fcgen","backcolor_desc":"Hintergrundfarbe","forecolor_desc":"Textfarbe","custom1_desc":"Benutzerdefinierte Beschreibung","removeformat_desc":"Formatierungen zur\u00fccksetzen","hr_desc":"Trennlinie einf\u00fcgen","sup_desc":"Hochgestellt","sub_desc":"Tiefgestellt","code_desc":"HTML-Quellcode bearbeiten","cleanup_desc":"Quellcode aufr\u00e4umen","image_desc":"Bild einf\u00fcgen/ver\u00e4ndern","unlink_desc":"Link entfernen","link_desc":"Link einf\u00fcgen/ver\u00e4ndern","redo_desc":"Wiederholen (Strg+Y)","undo_desc":"R\u00fcckg\u00e4ngig (Strg+Z)","indent_desc":"Einr\u00fccken","outdent_desc":"Ausr\u00fccken","numlist_desc":"Sortierte Liste","bullist_desc":"Unsortierte Liste","justifyfull_desc":"Blocksatz","justifyright_desc":"Rechtsb\u00fcndig","justifycenter_desc":"Zentriert","justifyleft_desc":"Linksb\u00fcndig","striketrough_desc":"Durchgestrichen","help_shortcut":"Dr\u00fccken Sie ALT-F10 f\u00fcr die Toolbar. Dr\u00fccken Sie ALT-0 f\u00fcr Hilfe","rich_text_area":"Rich Text Feld","shortcuts_desc":"Eingabehilfe",toolbar:"Toolbar","anchor_delta_height":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js new file mode 100644 index 00000000..d33ca1dd --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advanced_dlg',{"link_list":"Linkliste","link_is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","link_is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?","link_titlefield":"Titel","link_target_blank":"Neues Fenster \u00f6ffnen","link_target_same":"Im selben Fenster \u00f6ffnen","link_target":"Fenster","link_url":"Adresse","link_title":"Link einf\u00fcgen/ver\u00e4ndern","image_align_right":"Rechts","image_align_left":"Links","image_align_textbottom":"Unten im Text","image_align_texttop":"Oben im Text","image_align_bottom":"Unten","image_align_middle":"Mittig","image_align_top":"Oben","image_align_baseline":"Zeile","image_align":"Ausrichtung","image_hspace":"Horizontaler Abstand","image_vspace":"Vertikaler Abstand","image_dimensions":"Abmessungen","image_alt":"Alternativtext","image_list":"Bilderliste","image_border":"Rahmen","image_src":"Adresse","image_title":"Bild einf\u00fcgen/ver\u00e4ndern","charmap_title":"Sonderzeichen","colorpicker_name":"Name:","colorpicker_color":"Farbe:","colorpicker_named_title":"Benannte Farben","colorpicker_named_tab":"Benannte Farben","colorpicker_palette_title":"Farbpalette","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Farbwahl","colorpicker_picker_tab":"Farbwahl","colorpicker_title":"Farbe","code_wordwrap":"Automatischer Zeilenumbruch","code_title":"HTML-Quellcode bearbeiten","anchor_name":"Name des Ankers","anchor_title":"Anker einf\u00fcgen/ver\u00e4ndern","about_loaded":"Geladene Plugins","about_version":"Version","about_author":"Urheber","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"Lizenzbedingungen","about_help":"Hilfe","about_general":"\u00dcber","about_title":"\u00dcber TinyMCE","charmap_usage":"Navigation mit linken und rechten Pfeilen.","anchor_invalid":"Bitte geben Sie einen g\u00fcltigen Namen f\u00fcr den Anker ein!","accessibility_help":"Eingabehilfe","accessibility_usage_title":"Allgemeine Verwendung","invalid_color_value":"Ung\u00fcltige Farbangabe"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js new file mode 100644 index 00000000..6e584818 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js new file mode 100644 index 00000000..50cd87e3 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""}); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/link.htm b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/link.htm new file mode 100644 index 00000000..5d9dea9b --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/link.htm @@ -0,0 +1,57 @@ + + + + {#advanced_dlg.link_title} + + + + + + + +
            + + +
            +
            + + + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm new file mode 100644 index 00000000..20ec2f5a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm @@ -0,0 +1,47 @@ + + + + {#advanced_dlg.accessibility_help} + + + + +

            {#advanced_dlg.accessibility_usage_title}

            +

            Toolbars

            +

            Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

            + +

            Status Bar

            +

            To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

            + +

            Context Menu

            +

            Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

            + +

            Keyboard Shortcuts

            + + + + + + + + + + + + + + + + + + + + + +
            KeystrokeFunction
            Control-BBold
            Control-IItalic
            Control-ZUndo
            Control-YRedo
            + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css new file mode 100644 index 00000000..2fd94a1f --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css @@ -0,0 +1,50 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css new file mode 100644 index 00000000..879786fc --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css @@ -0,0 +1,118 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png new file mode 100644 index 00000000..1e53560e Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif new file mode 100644 index 00000000..d2f93671 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif new file mode 100644 index 00000000..85e31dfb Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif new file mode 100644 index 00000000..adfdddcc Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif new file mode 100644 index 00000000..5bb90fd6 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif new file mode 100644 index 00000000..06812cb4 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css new file mode 100644 index 00000000..77083f31 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css @@ -0,0 +1,219 @@ +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr;background:transparent} +.defaultSkin iframe {display:block;} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} +.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} +.defaultSkin span.mce_visualblocks {background-position: -40px -40px} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css new file mode 100644 index 00000000..ee064842 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css @@ -0,0 +1,30 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ +/* You can extend this CSS by adding your own CSS file with the the content_css option */ + +/* Import other styles */ +@import url('content_base.css'); +@import url('content_typography.css'); +@import url('content_grid.css'); + +/* All other custom styles (everything else what Grappelli users might want to deploy) */ +@import url('customized.css'); diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css new file mode 100644 index 00000000..5d5ed2cb --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css @@ -0,0 +1,56 @@ +/* This file contains the CSS data for the editable area(iframe) of TinyMCE */ +/* You can extend this CSS by adding your own CSS file with the the content_css option */ + +* html body { + overflow-y: auto !important; overflow-x: auto !important; + font-size: 0; line-height: 0; +} + +body#tinymce, body#tinymce td, body#tinymce pre, body#tinymce ol, body#tinymce ul, body#tinymce li { + font-family: Arial, sans-serif; + font-size: 11px; line-height: 16px; font-weight: normal; color: #cc4343 !important; + white-space: normal; +} +body#tinymce { + margin: 0; padding: 10px 10px 10px 0 !important; + width: 620px; +} +body#tinymce.fullscreen { + width: 620px !important; /* Use this to apply the actual page-width and guarantee a wysiwyg content-structure */ +} + +a:link, a:visited, a:hover, a:active { + padding: 0; + color: #309bbf !important; + text-decoration: none !important; +} + +a.external:link, a.external:visited, a.external:hover, a.external:active { + padding: 0; + color: #309bbf !important; + text-decoration: underline !important; +} + +/* -- Absolute Break (Style=Umbruch) ---------- */ + +.clear { + clear: both !important; padding: 2px 0; + border-top-width: 2px !important; border-bottom-width: 2px !important; +} + +ol.clear, ul.clear { padding: 2px 0 2px 10px !important; } + +/* Clearing floats without extra markup + Based on How To Clear Floats Without Structural Markup by PiE + [http://www.positioniseverything.net/easyclearing.html] */ + +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clearfix {display: inline-block; border-top-width: 2px !important; border-bottom-width: 2px !important; } +* html .clearfix {height: 1%;} +.clearfix {display: block;} \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css new file mode 100644 index 00000000..e3ba36e0 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css @@ -0,0 +1,72 @@ +/* -- Basic Elements ---------- */ + +body#tinymce { + width: 630px; /* 10px more than body#tinymce in content_base.css to provide equal line-breaks */ +} +body#tinymce.fullscreen { + padding-left: 10px !important; + width: 630px !important; /* 10px more than body#tinymce.fullscreen in content_base.css to provide equal line-breaks */ + background: #eee; +} + +/* -- Typographic Elements ---------- */ + +body#tinymce h1, +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce ol, +body#tinymce ul, +body#tinymce code, +body#tinymce pre, +body#tinymce blockquote { + padding: 2px 5px 5px; + line-height: 16px !important; + background-color: #fff; +} +body#tinymce p.mce-grid-container { + padding: 2px 0 0; + line-height: 16px !important; + background-color: transparent; + border-top: 0px dashed #999 !important; + border-bottom: 0px solid #999 !important; +} +body#tinymce table.mceItemTable td { + border: 1px dashed #bbb !important; +} +body#tinymce div h1, +body#tinymce div h2, +body#tinymce div h3, +body#tinymce div h4, +body#tinymce div p, +body#tinymce div code, +body#tinymce div pre { + padding-left: 0; +} + +body#tinymce h1:before, +body#tinymce h2:before, +body#tinymce h3:before, +body#tinymce h4:before, +body#tinymce p:before, +body#tinymce ol:before, +body#tinymce ul:before, +body#tinymce code:before, +body#tinymce pre:before, +body#tinymce blockquote:before, +body#tinymce div:before { + position: relative; display: block; + font-family: "Andale Mono"; font-size: 9px; font-weight: normal; color: #999; +} +body#tinymce ol:before, +body#tinymce ul:before { + margin-left: -30px; +} +body#tinymce blockquote:before { + margin-left: -25px; +} +body#tinymce p.mce-grid-container:before { + margin-bottom: 3px; + color: #7c7c7c; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_cs.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_cs.css new file mode 100644 index 00000000..abfb8db0 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_cs.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h1:before { content: "Nadpis 1"; } +body#tinymce h2:before { content: "Nadpis 2"; } +body#tinymce h3:before { content: "Nadpis 3"; } +body#tinymce h4:before { content: "Nadpis 4"; } +body#tinymce ol:before { content: "Seřazený seznam"; } +body#tinymce ul:before { content: "Neseřazený seznam"; } +body#tinymce p:before { content: "Odstavec"; } +body#tinymce code:before { content: "Kód programu"; } +body#tinymce pre:before { content: "Předformátovaný text"; } +body#tinymce blockquote:before { content: "Citace"; } +body#tinymce div:before { content: "Div"; } diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css new file mode 100644 index 00000000..429dcac0 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h1:before { content: "Überschrift 1"; } +body#tinymce h2:before { content: "Überschrift 2"; } +body#tinymce h3:before { content: "Überschrift 3"; } +body#tinymce h4:before { content: "Überschrift 4"; } +body#tinymce ol:before { content: "Sortierte Liste"; } +body#tinymce ul:before { content: "Unsortierte Liste"; } +body#tinymce p:before { content: "Absatz"; } +body#tinymce p.mce-grid-container:before { content: "Template"; } +body#tinymce code:before { content: "Code"; } +body#tinymce pre:before { content: "Vorformatiert"; } +body#tinymce blockquote:before { content: "Zitatblock"; } \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css new file mode 100644 index 00000000..f6ce62b8 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h1:before { content: "Heading 1"; } +body#tinymce h2:before { content: "Heading 2"; } +body#tinymce h3:before { content: "Heading 3"; } +body#tinymce h4:before { content: "Heading 4"; } +body#tinymce ol:before { content: "Ordered List"; } +body#tinymce ul:before { content: "Unordered List"; } +body#tinymce p:before { content: "Paragraph"; } +body#tinymce code:before { content: "Code"; } +body#tinymce pre:before { content: "Preformatted"; } +body#tinymce blockquote:before { content: "Blockquote"; } +body#tinymce div:before { content: "Div"; } \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css new file mode 100644 index 00000000..306eb40c --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h2:before { content: "Nagłówek 1"; } +body#tinymce h2:before { content: "Nagłówek 2"; } +body#tinymce h3:before { content: "Nagłówek 3"; } +body#tinymce h4:before { content: "Nagłówek 4"; } +body#tinymce ol:before { content: "Lista numerowana"; } +body#tinymce ul:before { content: "Lista nienumerowana"; } +body#tinymce p:before { content: "Paragraf"; } +body#tinymce code:before { content: "Kod"; } +body#tinymce pre:before { content: "Preformatowane"; } +body#tinymce blockquote:before { content: "Cytat"; } +body#tinymce div:before { content: "Blok"; } diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css new file mode 100644 index 00000000..c203794e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css @@ -0,0 +1,85 @@ +/* ----------------------------------------------------------------------- + + CSS for the display of grid-templates in the editor + Grid applies to tables & tabledesks instead of the originally used divs + + Grid based on BLUEPRINT CSS + http://code.google.com/p/blueprintcss/ + +----------------------------------------------------------------------- */ + + + +/* Basic Grid Properties +----------------------------------------------------------------------- */ + +.span-1, .span-2, .span-3, .span-4, +.span-5, .span-6, .span-7, .span-8, +.span-9, .span-10, .span-11, .span-12, +.span-13, .span-14, .span-15, .span-16, +.span-17, .span-18, .span-19, .span-20, +.span-21, .span-22, .span-23, .span-24 { + overflow: hidden !important; +} + +/* Use these classes to set the width of a column. */ +.span-1 { width: 30px; } +.span-2 { width: 70px; } +.span-3 { width: 110px; } +.span-4 { width: 150px; } +.span-5 { width: 190px; } +.span-6 { width: 230px; } +.span-7 { width: 270px; } +.span-8 { width: 310px; } +.span-9 { width: 350px; } +.span-10 { width: 390px; } +.span-11 { width: 430px; } +.span-12 { width: 470px; } +.span-13 { width: 510px; } +.span-14 { width: 550px; } +.span-15 { width: 590px; } +.span-16 { width: 630px; } +.span-17 { width: 670px; } +.span-18 { width: 710px; } +.span-19 { width: 750px; } +.span-20 { width: 790px; } +.span-21 { width: 830px; } +.span-22 { width: 870px; } +.span-23 { width: 910px; } +.span-24 { width: 950px; margin: 0; } + + + +/* Table - Grid Properties +----------------------------------------------------------------------- */ + +body#tinymce table.mceItemTable { + margin: 0 0 0 -1px; padding: 0; + border: 0 !important; + background: transparent; + table-layout: fixed; + border-collapse: collapse; + border-spacing: 0; +} +body#tinymce table.mceItemTable td { + margin: 0; padding: 0; + border: 1px dashed #ddd !important; + background: transparent; + vertical-align: top; +} +/* Simulates Blueprints class .last */ +body#tinymce table.mceItemTable td + td { + padding-left: 10px !important; +} +/* Nested Tables */ +table.mceItemTable td table.mceItemTable { + margin: -1px 0 -1px -1px !important; +} + + + +/* Append, Prepend, Push, Pull, Borders & Misc Classes/Elements: + Not implemented yet. +----------------------------------------------------------------------- */ + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css new file mode 100644 index 00000000..fd669346 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css @@ -0,0 +1,101 @@ +/* -- Typographic Elements ---------- */ + +body#tinymce h1, +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce li, +body#tinymce pre { + color: #666 !important; +} +body#tinymce h1, +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce ol, +body#tinymce ul, +body#tinymce code, +body#tinymce pre, +body#tinymce blockquote, +body#tinymce div { + margin: 0 0 10px; padding: 0; +} +body#tinymce h1 { + font-size: 19px; line-height: 23px; +} +body#tinymce h2 { + font-size: 17px; line-height: 21px; +} +body#tinymce h3 { + font-size: 15px; line-height: 19px; +} +body#tinymce h4 { + font-size: 12px; line-height: 16px; +} +body#tinymce ol, +body#tinymce ul { + padding-left: 35px !important; + list-style-position: outside; +} +body#tinymce ul { + list-style-type: disc; +} +body#tinymce ol li, +body#tinymce ul li { + margin-bottom: 5px; +} +body#tinymce ol li:last-child, +body#tinymce ul li:last-child { + margin-bottom: 0 !important; +} +body#tinymce pre, +body#tinymce code { + font-family: "Andale Mono"; +} +body#tinymce blockquote { + padding-left: 30px !important; +} + +/* -- Divs ---------- */ + +/*body#tinymce div { + min-height: 15px; + height: auto; + outline: 1px dashed #bbb; +}*/ + +/* -- Tables ---------- */ + +/*body#tinymce table.mceItemTable { + margin: 0; padding: 0; + border: 0 !important; + background: #ebe9e6 !important; + table-layout: auto; + border-collapse: collapse; + border-spacing: 0; +} +body#tinymce table.mceItemTable td { + border: 1px dashed #ccc !important; + background: #ebe9e6 !important; +} + +body#tinymce td { + vertical-align: top; +}*/ + +/* -- Images ---------- */ + +body#tinymce img { float: none; border: none !important; } + +body#tinymce img.img_left { float: left !important; margin: 14px 20px 14px 0; } +body#tinymce img.img_right { float: right !important; margin: 14px 0 14px 20px; border: none; } +body#tinymce img.img_block { display: block; float: none !important; clear: both !important; margin: 14px 0 !important; border: none; } + +body#tinymce img.img_left_nospacetop { float: left !important; margin: 2px 20px 14px 0; } +body#tinymce img.img_right_nospacetop { float: right !important; margin: 2px 0 14px 20px; border: none; } +body#tinymce img.img_block_nospacetop { display: block; float: none !important; clear: both !important; margin: 2px 0 14px 0 !important; border: none; } + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/customized.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/customized.css new file mode 100644 index 00000000..74eaecee --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/customized.css @@ -0,0 +1,22 @@ +/* ----------------------------------------------------------------------- + + Please use this file if you want to deploy any custom TinyMCE styles + which are not covered by the Grappelli skin. + + If you use background-images make sure to put them into the folder + "img/customized/" + +----------------------------------------------------------------------- */ + + + +/* Page Break +----------------------------------------------------------------------- */ + +body#tinymce img.mcePageBreak { + display: block; + width: 100%; + height: 16px; + margin-top: 12px; + background: #fff url(img/customized/pagebreak.png) 0 0 repeat-x; +} \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css new file mode 100644 index 00000000..facf6d60 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css @@ -0,0 +1,55 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ + + +/* Import & Modifications of Django/Grappelli styles +----------------------------------------------------------------------- */ +@import url('../../../../../../../stylesheets/screen.css'); +@import url('../../../../../../../stylesheets/partials/custom/tinymce.css'); +@import url('../../../../../../../stylesheets/mueller/grid/output.css'); + + + +/* Generic +----------------------------------------------------------------------- */ +body { + clear: both; + margin: 0; + padding: 0 20px 0; + height: 100%; + background: #fff !important; +} +body.filebrowser { + margin: 0 !important; +} +body > *:first-child { + margin-top: 20px; +} + +html { + height: 100%; +} +html, body { + background: transparent; + overflow-x: hidden !important; + overflow-y: auto !important; +} \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png new file mode 100644 index 00000000..a3758ef9 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png new file mode 100644 index 00000000..10a09f1e Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png new file mode 100644 index 00000000..81dc1a9b Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png new file mode 100644 index 00000000..56e0f051 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png new file mode 100644 index 00000000..497a5ad5 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png new file mode 100644 index 00000000..e36895f4 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png new file mode 100644 index 00000000..bc65403c Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png new file mode 100644 index 00000000..f4108807 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png new file mode 100644 index 00000000..07f0e0f7 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png new file mode 100644 index 00000000..4c569a2d Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png new file mode 100644 index 00000000..6fc421dd Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png new file mode 100644 index 00000000..267242e0 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png new file mode 100644 index 00000000..73408167 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png new file mode 100644 index 00000000..2f454441 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png new file mode 100644 index 00000000..539d2bb4 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png new file mode 100644 index 00000000..466d68a3 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png new file mode 100644 index 00000000..f36966cc Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_cell_props.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_cell_props.png new file mode 100644 index 00000000..1ff00045 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_cell_props.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_after.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_after.png new file mode 100644 index 00000000..229f59c0 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_after.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_before.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_before.png new file mode 100644 index 00000000..3a682a5e Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_before.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_col.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_col.png new file mode 100644 index 00000000..8f5abac3 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_col.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_row.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_row.png new file mode 100644 index 00000000..1eec2c00 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_row.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_merge_cells.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_merge_cells.png new file mode 100644 index 00000000..85dc4345 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_merge_cells.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_after.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_after.png new file mode 100644 index 00000000..15311abd Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_after.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_before.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_before.png new file mode 100644 index 00000000..f04e317b Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_before.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_props.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_props.png new file mode 100644 index 00000000..eca608ba Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_props.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_split_cells.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_split_cells.png new file mode 100644 index 00000000..614fefdc Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_split_cells.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png new file mode 100644 index 00000000..b7b613d4 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png new file mode 100644 index 00000000..9042cd3e Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png new file mode 100644 index 00000000..a5df8a4b Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png new file mode 100644 index 00000000..677b426d Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png new file mode 100644 index 00000000..c075fc1a Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/button_pagebreak.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/button_pagebreak.png new file mode 100644 index 00000000..bc9deadb Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/button_pagebreak.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/pagebreak.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/pagebreak.png new file mode 100644 index 00000000..b9f04bfd Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/pagebreak.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png new file mode 100644 index 00000000..0b20b492 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png new file mode 100644 index 00000000..c5e796c0 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png new file mode 100644 index 00000000..22d4b0c8 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png new file mode 100644 index 00000000..9f5a976c Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css new file mode 100644 index 00000000..72e226c5 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css @@ -0,0 +1,528 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ + + + +/* Reset +----------------------------------------------------------------------- */ + +.grappelliSkin table, .grappelliSkin tbody, .grappelliSkin tr, .grappelliSkin td, +.grappelliSkin div, .grappelliSkin iframe, +.grappelliSkin a, .grappelliSkin img, .grappelliSkin span, +.grappelliSkin *, .grappelliSkin .text { + margin: 0; + padding: 0; + width: auto; + font-family: Arial, sans-serif; font-size: 11px; line-height: 15px; font-weight: normal; + text-decoration: none; text-align: left; white-space: nowrap; + border: none; + border-collapse: separate; + background: transparent; + vertical-align: baseline; + cursor: default; +} +.grappelliSkin table, .grappelliSkin tbody, .grappelliSkin tr, .grappelliSkin td { + margin: 0 !important; + border: 0 !important; + outline: 0 !important; +} +.grappelliSkin a { + text-decoration: none; + cursor: pointer; +} +.grappelliSkin table td { + padding: 0; + vertical-align: middle; +} +.grappelliSkin table td > a:first-child, +.grappelliSkin table th > a:first-child { + position: relative; + top: 0 !important; +} + +body.rtl .grappelliSkin table, body.rtl .grappelliSkin tbody, body.rtl .grappelliSkin tr, body.rtl .grappelliSkin td, +body.rtl .grappelliSkin div, body.rtl .grappelliSkin iframe, +body.rtl .grappelliSkin a, body.rtl .grappelliSkin img, body.rtl .grappelliSkin span, +body.rtl .grappelliSkin *, body.rtl .grappelliSkin .text { + text-align: right; +} + + + +/* Containers +----------------------------------------------------------------------- */ + +.grappelliSkin table { + background: transparent; +} +.grappelliSkin iframe { + display: block; + position: relative; top: 0; + margin: 0; padding-top: 0; + border-top: 1px solid #fff; + border-bottom: 1px solid #d4d4d4; +} +.predelete .grappelliSkin iframe { + border-top: 1px solid #ffe5e5; + border-bottom: 1px solid #e5caca; +} +.grappelliSkin td.mceToolbar { + padding-bottom: 5px; + border-bottom: 1px solid #d4d4d4!important; +} +.predelete .grappelliSkin td.mceToolbar { + border-bottom: 1px solid #e5caca !important; +} +.grappelliSkin td.mceToolbar.advanced_icons { + border-top: 1px solid #ccc !important; +} +.predelete .grappelliSkin td.mceToolbar.advanced_icons { + border-top: 1px solid #ffe5e5 !important; +} +.grappelliSkin td.mceIframeContainer { + margin-top: 0; padding-top: 0; + height: auto !important; + vertical-align: top !important; +} + + + +/* Layout +----------------------------------------------------------------------- */ + +#changelist span.mceEditor.grappelliSkin { + display: inline-block; + margin: -4px 0 -5px; +} +.grappelliSkin table.mceLayout { + height: auto !important; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: transparent; +} +.predelete .grappelliSkin table.mceLayout { + background: transparent !important; +} +#mce_fullscreen_container { +/* height: 100% !important;*/ + background: transparent; + background: #eee; +} +#mce_fullscreen_container table.mceLayout { + height: 100% !important; + border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; + background: #eee !important; +} + +#mce_fullscreen_container .grappelliSkin table.mceLayout tr.mceFirst > td { + padding: 8px 8px 5px; +} + +/* Additional Toolbar-Rows */ +#changelist .grappelliSkin table.mceToolbar { + margin: 0 !important; +} + +.grappelliSkin table.mceToolbar + table.mceToolbar, +#changelist .grappelliSkin table.mceToolbar + table.mceToolbar { + margin-top: 5px !important; + height: 28px; + background: transparent; +} +.grappelliSkin span.mceIcon, .grappelliSkin img.mceIcon { + display: block; + width: 20px; height: 20px; +} + +body.rtl .grappelliSkin span.mceIcon, body.rtl .grappelliSkin img.mceIcon { + width: 23px; +} + + + +/* Buttons +----------------------------------------------------------------------- */ + +.grappelliSkin .mceButton { + display: block; + margin-right: 2px; + width: 23px; height: 23px !important; + background: #fff; +} +.grappelliSkin .mceButton span, .grappelliSkin .mceListBox .mceOpen { + cursor: pointer; +} + +.grappelliSkin a.mceButtonEnabled { + border: 1px solid; + border-color: #d4d4d4 #c4c4c4 #c4c4c4 #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.grappelliSkin a.mceButtonEnabled:hover { + background: #e1f0f5; +} +.grappelliSkin a.mceButtonActive, .grappelliSkin a.mceButtonSelected { + border-color: #c0c0c0 #d2d2d2 #d2d2d2 #c0c0c0 !important; + background: #ddd; +} +.grappelliSkin .mceButtonDisabled { + border: 1px solid; + border-color: #d4d4d4 #fff #fff #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: transparent; +} +.predelete .grappelliSkin .mceButtonDisabled { + border-color: #e5caca #ffe5e5 #ffe5e5 #e5caca; +} +.grappelliSkin .mceButtonDisabled span { + opacity: 0.4; +} + +body.rtl .grappelliSkin .mceButton { + margin-left: 2px; + margin-right: 0; +} + + + +/* Separator +----------------------------------------------------------------------- */ + +.grappelliSkin .mceSeparator { + display: block; + width: 4px; height: 22px; +} + + + +/* Listbox +----------------------------------------------------------------------- */ + +.grappelliSkin table.mceListBox { + background: transparent; +} + +.grappelliSkin .mceListBox, .grappelliSkin .mceListBox a { + display: block; +} +.grappelliSkin .mceListBox .mceText { + position: relative; + padding: 2px 0 0 4px !important; + width: 90px; height: 21px; + border: 1px solid; + border-color: #c4c4c4 #d4d4d4 #d4d4d4 #c4c4c4; + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + background: #fafafa; + color: #666 !important; font-size: 11px !important; line-height: 20px; + overflow: hidden; +} + +.grappelliSkin .mceListBox .mceOpen { + margin-right: 4px; + width: 14px; height: 23px; + border: 1px solid; + border-color: #c4c4c4; + border-left: none; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; + background: #ddd url('img/menu/icon-mceOpen.png'); +} +.grappelliSkin table.mceListBoxEnabled:hover .mceText, +.grappelliSkin .mceListBoxHover .mceText, +.grappelliSkin .mceListBoxSelected .mceText { + background: #fff; +} +.grappelliSkin table.mceListBoxEnabled:hover .mceOpen, +.grappelliSkin .mceListBoxHover .mceOpen, +.grappelliSkin .mceListBoxSelected .mceOpen { + border-color: #c4c4c4 #d4d4d4 #d4d4d4 #c4c4c4; + background-color: #e1f0f5; +} +.grappelliSkin .mceListBoxSelected .mceText, +.grappelliSkin .mceListBoxSelected .mceOpen { + border-bottom-left-radius: 0 !important; -moz-border-radius-bottomleft: 0 !important; -webkit-border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; -moz-border-radius-bottomright: 0 !important; -webkit-border-bottom-right-radius: 0 !important; +} + +.grappelliSkin .mceListBoxMenu { + overflow: auto; + overflow-x: hidden; +} +.grappelliSkin .mceOldBoxModel .mceListBox .mceText { + height: 23px; +} + + + +/* SplitButton (not defined yet) +----------------------------------------------------------------------- */ +/* ColorSplitButton (not defined yet) +----------------------------------------------------------------------- */ + + + +/* Menu +----------------------------------------------------------------------- */ + +.grappelliSkin .mceMenu { + position: absolute; left: 0; top: -1px; z-index: 1000; + padding: 0; + min-width: 109px !important; + border: 1px solid #c4c4c4; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; + box-shadow: 0 5px 10px #999; -moz-box-shadow: 0 5px 10px #999; -webkit-box-shadow: 0 5px 10px #999; +} +.grappelliSkin .mceMenu table { + width: 100% !important; + border-top-right-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; + background: #fff; +} + +.grappelliSkin .mceMenu.mceDropDown { + border-radius: 5px !important; -moz-border-radius: 5px !important; -webkit-border-radius: 5px !important; + border: 2px solid #eee; +} +.grappelliSkin .mceMenu.mceDropDown table { + border-radius: 2px !important; -moz-border-radius: 2px !important; -webkit-border-radius: 2px !important; +} +.grappelliSkin .mceMenu a, .grappelliSkin .mceMenu span, .grappelliSkin .mceMenu { + display: block; + width: auto !important; + cursor: pointer; +} +.grappelliSkin .mceMenu td { + height: 18px; + border-bottom: 1px solid #d0d0d0; +} +.grappelliSkin .mceMenu tr.mceFirst td a { + border-top-right-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; +} +.grappelliSkin .mceMenu.mceDropDown tr.mceFirst td a { + border-top-left-radius: 3px; -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; +} +.grappelliSkin tr.mceMenuItemSeparator + tr.mceFirst td a { + border-top: none !important; + border-radius: 0 !important; -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; +} +.grappelliSkin .mceMenu tr.mceLast td { + border-bottom: none !important; +} +.grappelliSkin .mceMenu tr.mceLast td a { + border-bottom: none; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; +} + +.grappelliSkin .mceMenu a { + position: relative; + padding: 4px 0 3px; + color: #666 !important; +} +.grappelliSkin .mceMenu .mceText { + position: relative; display: block; + margin: 0; padding: 0 25px 0 4px; + background: transparent !important; +} +.grappelliSkin .mceMenu .mceIcon { + display: none; + width: 0; height: 0; + background: transparent !important; +} +.grappelliSkin .mceMenu .mceMenuItemEnabled a:hover, +.grappelliSkin .mceMenu .mceMenuItemEnabled a:active, +.grappelliSkin .mceMenu .mceMenuItemActive { + background-color: #e1f0f5 !important; +} +.grappelliSkin .mceMenuItemSelected a { + background-color: #ddd; +} +.grappelliSkin td.mceMenuItemSeparator { + height: 2px; + border: none; + background: #a9a9a9; +} + +.grappelliSkin .mceMenuItemTitle a { + border: 0; + background: #f2d6d6; +} + +.grappelliSkin .mceMenuItemTitle span.mceText { + padding-left: 4px; + color: #666; +} +.grappelliSkin .mceMenuItemDisabled .mceText { + color: #999; +} + + + +/* Language Specific Content Additions +----------------------------------------------------------------------- */ + +.grappelliSkin .mceMenuItemTitle span.mceText[title="Format"]:before, +.grappelliSkin .mceMenuItemTitle span.mceText[title="Style"]:before { + content: "Reset "; +} +.grappelliSkin .mceMenuItemTitle span.mceText[title="Format "]:after, +.grappelliSkin .mceMenuItemTitle span.mceText[title="Stil"]:after { + content: " zurücksetzen"; +} + + + +/* Statusbar: Progress, Resize +----------------------------------------------------------------------- */ + +#mce_fullscreen_container .grappelliSkin td.mceStatusbar { + border-top: 1px solid #fff; + height: 100%; +} +.grappelliSkin td.mceStatusbar > div { + display: none; +} + +.grappelliSkin .mcePlaceHolder { + position: relative; + border: 1px solid #d4d4d4; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #d6ebf2 url('img/icons/icon-mceResize.png') 50% 100% no-repeat; + cursor: s-resize; +} +.predelete .grappelliSkin .mcePlaceHolder { + border: 1px solid #e5caca; +} +.table .grappelliSkin .mcePlaceHolder, +.table .grappelliSkin .mcePlaceHolder { + left: 0; +} + +.grappelliSkin a.mceResize { + display: block; + width: 100%; height: 20px; + border: 1px solid transparent; + border-top-color: #fff; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; + background-image: url('img/icons/icon-mceResize.png'); + background-position: 50% 50%; + background-repeat: no-repeat; + cursor: s-resize; +} +.predelete .grappelliSkin a.mceResize { + border-top-color: #ffe5e5; +} +.grappelliSkin a.mceResize:link, .grappelliSkin a.mceResize:visited { + background-color: transparent; +} +.grappelliSkin a.mceResize:hover, .grappelliSkin a.mceResize:active { + border-color: #d4d4d4; + border-top-color: #ebebeb; + background-color: #d6ebf2; +} +.predelete .grappelliSkin a.mceResize:hover, .predelete .grappelliSkin a.mceResize:active { + border-color: #e5caca; + border-top-color: #ffe5e5; + background-color: #d6ebf2; +} + + + +/* Formats +----------------------------------------------------------------------- */ + +.grappelliSkin .mce_formatPreview a { /*apply specific styles here*/ } +.grappelliSkin .mce_p span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_pre span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h1 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h2 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h3 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h4 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h5 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h6 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_div span.mceText { /*apply specific styles here*/ } + + + +/* Toolbar: Theme & Plugins Defaults +----------------------------------------------------------------------- */ + +.grappelliSkin .mceToolbar span { + /*width: 100%; */height: 100%; + background-position: 0 0; + background-repeat: no-repeat; +} + + + +/* Grappelli Button Icons +----------------------------------------------------------------------- */ + +.grappelliSkin span.mce_bold { background-image: url('img/buttons/bold.png'); } +.grappelliSkin span.mce_italic { background-image: url('img/buttons/italic.png'); } +.grappelliSkin span.mce_underline { background-image: url('img/buttons/underline.png'); } +.grappelliSkin span.mce_undo { background-image: url('img/buttons/undo.png'); } +.grappelliSkin span.mce_redo { background-image: url('img/buttons/redo.png'); } +.grappelliSkin span.mce_bullist { background-image: url('img/buttons/bullist.png'); } +.grappelliSkin span.mce_numlist { background-image: url('img/buttons/numlist.png'); } +.grappelliSkin span.mce_blockquote { background-image: url('img/buttons/blockquote.png'); } +.grappelliSkin span.mce_link { background-image: url('img/buttons/link.png'); } +.grappelliSkin span.mce_unlink { background-image: url('img/buttons/unlink.png'); } +.grappelliSkin span.mce_image { background-image: url('img/buttons/image.png'); } +.grappelliSkin span.mce_code { background-image: url('img/buttons/code.png'); } +.grappelliSkin span.mce_charmap { background-image: url('img/buttons/charmap.png'); } + +.grappelliSkin span.mce_fullscreen { background-image: url('img/buttons/fullscreen.png'); } +.grappelliSkin span.mce_media { background-image: url('img/buttons/media.png'); } +.grappelliSkin span.mce_pasteword { background-image: url('img/buttons/pasteword.png'); } +.grappelliSkin span.mce_template { background-image: url('img/buttons/template.png'); } +.grappelliSkin span.mce_table { background-image: url('img/buttons/table.png'); } +.grappelliSkin span.mce_row_props { background-image: url('img/buttons/table_row_props.png'); } +.grappelliSkin span.mce_cell_props { background-image: url('img/buttons/table_cell_props.png'); } +.grappelliSkin span.mce_delete_row { background-image: url('img/buttons/table_delete_row.png'); } +.grappelliSkin span.mce_delete_col { background-image: url('img/buttons/table_delete_col.png'); } +.grappelliSkin span.mce_row_before { background-image: url('img/buttons/table_row_before.png'); } +.grappelliSkin span.mce_row_after { background-image: url('img/buttons/table_row_after.png'); } +.grappelliSkin span.mce_col_before { background-image: url('img/buttons/table_col_before.png'); } +.grappelliSkin span.mce_col_after { background-image: url('img/buttons/table_col_after.png'); } +.grappelliSkin span.mce_split_cells { background-image: url('img/buttons/table_split_cells.png'); } +.grappelliSkin span.mce_merge_cells { background-image: url('img/buttons/table_merge_cells.png'); } +.grappelliSkin span.mce_search { background-image: url('img/buttons/search.png'); } +.grappelliSkin span.mce_cleanup { background-image: url('img/buttons/cleanup.png'); } + +.grappelliSkin span.mce_grappelli_adv { background-image: url('img/buttons/show_advanced.png'); } +.grappelliSkin span.mce_grappelli_documentstructure { background-image: url('img/buttons/visualchars.png'); } + + + +/* Customized Button Icons +----------------------------------------------------------------------- */ + +.grappelliSkin span.mce_pagebreak { background-image: url('img/customized/button_pagebreak.png'); } + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css new file mode 100644 index 00000000..cbce6c6a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css @@ -0,0 +1,24 @@ +body, td, pre { margin:8px;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css new file mode 100644 index 00000000..6d9fc8dd --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css @@ -0,0 +1,106 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +background:#F0F0EE; +color: black; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE; color:#000;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;background-color:transparent;} +a:hover {color:#2B6FB6;background-color:transparent;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;background-color:transparent;} +input.invalid {border:1px solid #EE0000;background-color:transparent;} +input {background:#FFF; border:1px solid #CCC;color:black;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +font-weight:bold; +width:94px; height:23px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#cancel {float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} +.tabs li.current {font-weight: bold; margin-right:2px;} +.tabs span {float:left; display:block; padding:0px 10px 0 0;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css new file mode 100644 index 00000000..effbbe15 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css @@ -0,0 +1,106 @@ +/* Reset */ +.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} +.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} +.highcontrastSkin table td {vertical-align:middle} + +.highcontrastSkin .mceIconOnly {display: block !important;} + +/* External */ +.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} +.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} + +/* Layout */ +.highcontrastSkin table.mceLayout {border: 1px solid;} +.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} +.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} +.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} +.highcontrastSkin .mceStatusbar div {float:left} +.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} + +.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} +.highcontrastSkin .mceToolbar tr { display: block;} +.highcontrastSkin .mceToolbar table { display: block; } + +/* Button */ + +.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} +.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} +.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} + +/* Separator */ +.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} + +/* ListBox */ +.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} +.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} +.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} + +.highcontrastSkin .mceListBoxMenu {overflow-y:auto} + +/* SplitButton */ +.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} +.highcontrastSkin .mceSplitButton tr { display: table-row; } +.highcontrastSkin table.mceSplitButton { display: table; } +.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } +.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} + +/* Menu */ +.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} +.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; direction:ltr} +.highcontrastSkin .mceMenu table {background:white; color: black} +.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} +.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} +.highcontrastSkin .mceMenu td {height:2em} +.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} +.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} +.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} +.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} +.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} +.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} +.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} +.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} +.highcontrastSkin .mceMenu span.mceMenuLine {display:none} +.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} +.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} + +/* ColorSplitButton */ +.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} +.highcontrastSkin .mceColorSplitMenu td {padding:2px} +.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} +.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} +.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} +.highcontrastSkin .mceColorPreview {display:none;} +.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} + +/* Progress,Resize */ +.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.highcontrastSkin .mce_p span.mceText {} +.highcontrastSkin .mce_address span.mceText {font-style:italic} +.highcontrastSkin .mce_pre span.mceText {font-family:monospace} +.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css new file mode 100644 index 00000000..a1a8f9bd --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css @@ -0,0 +1,48 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css new file mode 100644 index 00000000..a54db98d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css @@ -0,0 +1,118 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px} +#cancel {background:url(../default/img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png new file mode 100644 index 00000000..13a5cb03 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png new file mode 100644 index 00000000..7fc57f2b Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png new file mode 100644 index 00000000..c0dcc6ca Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css new file mode 100644 index 00000000..a3102237 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -0,0 +1,222 @@ +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {padding-left: 3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD; direction:ltr} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} +.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} +.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} +.o2k7Skin span.mce_visualblocks {background-position: -40px -40px} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css new file mode 100644 index 00000000..50c9b76a --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -0,0 +1,8 @@ +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css new file mode 100644 index 00000000..960a8e47 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -0,0 +1,5 @@ +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm new file mode 100644 index 00000000..575d2ab6 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm @@ -0,0 +1,26 @@ + + + {#advanced_dlg.code_title} + + + + + +
            +
            {#advanced_dlg.code_title}
            +
            + + +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + + diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js new file mode 100644 index 00000000..4b3209cc --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js @@ -0,0 +1 @@ +(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js new file mode 100644 index 00000000..01ce87c5 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js @@ -0,0 +1,84 @@ +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + deltaHeight : -20 + }; + }, + + getInfo : function() { + return { + longname : 'Simple theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + } + }); + + tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); +})(); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif new file mode 100644 index 00000000..6fcbcb5d Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js new file mode 100644 index 00000000..59bf788d --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.simple',{"cleanup_desc":"Quellcode aufr\u00e4umen","redo_desc":"Wiederholen (Strg+Y)","undo_desc":"R\u00fcckg\u00e4ngig (Strg+Z)","numlist_desc":"Nummerierung","bullist_desc":"Aufz\u00e4hlung","striketrough_desc":"Durchgestrichen","underline_desc":"Unterstrichen (Strg+U)","italic_desc":"Kursiv (Strg+I)","bold_desc":"Fett (Strg+B)"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js new file mode 100644 index 00000000..088ed0fc --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"}); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css new file mode 100644 index 00000000..2506c807 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css @@ -0,0 +1,25 @@ +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css new file mode 100644 index 00000000..076fe84e --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css @@ -0,0 +1,32 @@ +/* Reset */ +.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css new file mode 100644 index 00000000..595809fa --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css @@ -0,0 +1,17 @@ +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png new file mode 100644 index 00000000..527e3495 Binary files /dev/null and b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png differ diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css new file mode 100644 index 00000000..cf6c35d1 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css @@ -0,0 +1,35 @@ +/* Reset */ +.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce.js b/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce.js new file mode 100644 index 00000000..44d9fd90 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce.js @@ -0,0 +1 @@ +(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.8",releaseDate:"2012-11-20",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(c,e,d){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,e,d)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&Object.prototype.toString.call(o)==="[object Array]"){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey},metaKeyPressed:function(b){return a.isMac?b.metaKey:b.ctrlKey&&!b.altKey}}})(tinymce);tinymce.util.Quirks=function(a){var j=tinymce.VK,f=j.BACKSPACE,k=j.DELETE,e=a.dom,l=a.selection,H=a.settings,v=a.parser,o=a.serializer,E=tinymce.each;function A(N,M){try{a.getDoc().execCommand(N,false,M)}catch(L){}}function n(){var L=a.getDoc().documentMode;return L?L:6}function z(L){return L.isDefaultPrevented()}function J(){function L(O){var M,Q,N,P;M=l.getRng();Q=e.getParent(M.startContainer,e.isBlock);if(O){Q=e.getNext(Q,e.isBlock)}if(Q){N=Q.firstChild;while(N&&N.nodeType==3&&N.nodeValue.length===0){N=N.nextSibling}if(N&&N.nodeName==="SPAN"){P=N.cloneNode(false)}}E(e.select("span",Q),function(R){R.setAttribute("data-mce-mark","1")});a.getDoc().execCommand(O?"ForwardDelete":"Delete",false,null);Q=e.getParent(M.startContainer,e.isBlock);E(e.select("span",Q),function(R){var S=l.getBookmark();if(P){e.replace(P.cloneNode(false),R,true)}else{if(!R.getAttribute("data-mce-mark")){e.remove(R,true)}else{R.removeAttribute("data-mce-mark")}}l.moveToBookmark(S)})}a.onKeyDown.add(function(M,O){var N;N=O.keyCode==k;if(!z(O)&&(N||O.keyCode==f)&&!j.modifierPressed(O)){O.preventDefault();L(N)}});a.addCommand("Delete",function(){L()})}function q(){function L(O){var N=e.create("body");var P=O.cloneContents();N.appendChild(P);return l.serializer.serialize(N,{format:"html"})}function M(N){var P=L(N);var Q=e.createRng();Q.selectNode(a.getBody());var O=L(Q);return P===O}a.onKeyDown.add(function(O,Q){var P=Q.keyCode,N;if(!z(Q)&&(P==k||P==f)){N=O.selection.isCollapsed();if(N&&!e.isEmpty(O.getBody())){return}if(tinymce.isIE&&!N){return}if(!N&&!M(O.selection.getRng())){return}O.setContent("");O.selection.setCursorLocation(O.getBody(),0);O.nodeChanged()}})}function I(){a.onKeyDown.add(function(L,M){if(!z(M)&&M.keyCode==65&&j.metaKeyPressed(M)){M.preventDefault();L.execCommand("SelectAll")}})}function K(){if(!a.settings.content_editable){e.bind(a.getDoc(),"focusin",function(L){l.setRng(l.getRng())});e.bind(a.getDoc(),"mousedown",function(L){if(L.target==a.getDoc().documentElement){a.getWin().focus();l.setRng(l.getRng())}})}}function B(){a.onKeyDown.add(function(L,O){if(!z(O)&&O.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var N=l.getNode();var M=N.previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="hr"){e.remove(M);tinymce.dom.Event.cancel(O)}}}})}function y(){if(!Range.prototype.getClientRects){a.onMouseDown.add(function(M,N){if(!z(N)&&N.target.nodeName==="HTML"){var L=M.getBody();L.blur();setTimeout(function(){L.focus()},0)}})}}function h(){a.onClick.add(function(L,M){M=M.target;if(/^(IMG|HR)$/.test(M.nodeName)){l.getSel().setBaseAndExtent(M,0,M,1)}if(M.nodeName=="A"&&e.hasClass(M,"mceItemAnchor")){l.select(M)}L.nodeChanged()})}function c(){function M(){var O=e.getAttribs(l.getStart().cloneNode(false));return function(){var P=l.getStart();if(P!==a.getBody()){e.setAttrib(P,"style",null);E(O,function(Q){P.setAttributeNode(Q.cloneNode(true))})}}}function L(){return !l.isCollapsed()&&e.getParent(l.getStart(),e.isBlock)!=e.getParent(l.getEnd(),e.isBlock)}function N(O,P){P.preventDefault();return false}a.onKeyPress.add(function(O,Q){var P;if(!z(Q)&&(Q.keyCode==8||Q.keyCode==46)&&L()){P=M();O.getDoc().execCommand("delete",false,null);P();Q.preventDefault();return false}});e.bind(a.getDoc(),"cut",function(P){var O;if(!z(P)&&L()){O=M();a.onKeyUp.addToTop(N);setTimeout(function(){O();a.onKeyUp.remove(N)},0)}})}function b(){var M,L;e.bind(a.getDoc(),"selectionchange",function(){if(L){clearTimeout(L);L=0}L=window.setTimeout(function(){var N=l.getRng();if(!M||!tinymce.dom.RangeUtils.compareRanges(N,M)){a.nodeChanged();M=N}},50)})}function x(){document.body.setAttribute("role","application")}function t(){a.onKeyDown.add(function(L,N){if(!z(N)&&N.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var M=l.getNode().previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(N)}}}})}function C(){if(n()>7){return}A("RespectVisibilityInDesign",true);a.contentStyles.push(".mceHideBrInPre pre br {display: none}");e.addClass(a.getBody(),"mceHideBrInPre");v.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type===3&&P.value.charAt(P.value-1)!="\n"){P.value+="\n"}else{R.parent.insert(new tinymce.html.Node("#text",3),R,true).value="\n"}}}});o.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type==3){P.value=P.value.replace(/\r?\n$/,"")}}}})}function g(){e.bind(a.getBody(),"mouseup",function(N){var M,L=l.getNode();if(L.nodeName=="IMG"){if(M=e.getStyle(L,"width")){e.setAttrib(L,"width",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"width","")}if(M=e.getStyle(L,"height")){e.setAttrib(L,"height",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"height","")}}})}function d(){a.onKeyDown.add(function(R,S){var Q,L,M,O,P,T,N;Q=S.keyCode==k;if(!z(S)&&(Q||S.keyCode==f)&&!j.modifierPressed(S)){L=l.getRng();M=L.startContainer;O=L.startOffset;N=L.collapsed;if(M.nodeType==3&&M.nodeValue.length>0&&((O===0&&!N)||(N&&O===(Q?0:1)))){nonEmptyElements=R.schema.getNonEmptyElements();S.preventDefault();P=e.create("br",{id:"__tmp"});M.parentNode.insertBefore(P,M);R.getDoc().execCommand(Q?"ForwardDelete":"Delete",false,null);M=l.getRng().startContainer;T=M.previousSibling;if(T&&T.nodeType==1&&!e.isBlock(T)&&e.isEmpty(T)&&!nonEmptyElements[T.nodeName.toLowerCase()]){e.remove(T)}e.remove("__tmp")}}})}function G(){a.onKeyDown.add(function(P,Q){var N,M,R,L,O;if(z(Q)||Q.keyCode!=j.BACKSPACE){return}N=l.getRng();M=N.startContainer;R=N.startOffset;L=e.getRoot();O=M;if(!N.collapsed||R!==0){return}while(O&&O.parentNode&&O.parentNode.firstChild==O&&O.parentNode!=L){O=O.parentNode}if(O.tagName==="BLOCKQUOTE"){P.formatter.toggle("blockquote",null,O);N=e.createRng();N.setStart(M,0);N.setEnd(M,0);l.setRng(N)}})}function F(){function L(){a._refreshContentEditable();A("StyleWithCSS",false);A("enableInlineTableEditing",false);if(!H.object_resizing){A("enableObjectResizing",false)}}if(!H.readonly){a.onBeforeExecCommand.add(L);a.onMouseDown.add(L)}}function s(){function L(M,N){E(e.select("a"),function(Q){var O=Q.parentNode,P=e.getRoot();if(O.lastChild===Q){while(O&&!e.isBlock(O)){if(O.parentNode.lastChild!==O||O===P){return}O=O.parentNode}e.add(O,"br",{"data-mce-bogus":1})}})}a.onExecCommand.add(function(M,N){if(N==="CreateLink"){L(M)}});a.onSetContent.add(l.onSetContent.add(L))}function m(){if(H.forced_root_block){a.onInit.add(function(){A("DefaultParagraphSeparator",H.forced_root_block)})}}function p(){function L(N,M){if(!N||!M.initial){a.execCommand("mceRepaint")}}a.onUndo.add(L);a.onRedo.add(L);a.onSetContent.add(L)}function i(){a.onKeyDown.add(function(M,N){var L;if(!z(N)&&N.keyCode==f){L=M.getDoc().selection.createRange();if(L&&L.item){N.preventDefault();M.undoManager.beforeChange();e.remove(L.item(0));M.undoManager.add()}}})}function r(){var L;if(n()>=10){L="";E("p div h1 h2 h3 h4 h5 h6".split(" "),function(M,N){L+=(N>0?",":"")+M+":empty"});a.contentStyles.push(L+"{padding-right: 1px !important}")}}function u(){var N,M,ad,L,Y,ab,Z,ac,O,P,aa,W,V,X=document,T=a.getDoc();if(!H.object_resizing||H.webkit_fake_resize===false){return}A("enableObjectResizing",false);aa={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};function R(ah){var ag,af;ag=ah.screenX-ab;af=ah.screenY-Z;W=ag*Y[2]+ac;V=af*Y[3]+O;W=W<5?5:W;V=V<5?5:V;if(j.modifierPressed(ah)||(ad.nodeName=="IMG"&&Y[2]*Y[3]!==0)){W=Math.round(V/P);V=Math.round(W*P)}e.setStyles(L,{width:W,height:V});if(Y[2]<0&&L.clientWidth<=W){e.setStyle(L,"left",N+(ac-W))}if(Y[3]<0&&L.clientHeight<=V){e.setStyle(L,"top",M+(O-V))}}function ae(){function af(ag,ah){if(ah){if(ad.style[ag]||!a.schema.isValid(ad.nodeName.toLowerCase(),ag)){e.setStyle(ad,ag,ah)}else{e.setAttrib(ad,ag,ah)}}}af("width",W);af("height",V);e.unbind(T,"mousemove",R);e.unbind(T,"mouseup",ae);if(X!=T){e.unbind(X,"mousemove",R);e.unbind(X,"mouseup",ae)}e.remove(L);Q(ad)}function Q(ai){var ag,ah,af;S();ag=e.getPos(ai);N=ag.x;M=ag.y;ah=ai.offsetWidth;af=ai.offsetHeight;if(ad!=ai){ad=ai;W=V=0}E(aa,function(al,aj){var ak;ak=e.get("mceResizeHandle"+aj);if(!ak){ak=e.add(T.documentElement,"div",{id:"mceResizeHandle"+aj,"class":"mceResizeHandle",style:"cursor:"+aj+"-resize; margin:0; padding:0"});e.bind(ak,"mousedown",function(am){am.preventDefault();ae();ab=am.screenX;Z=am.screenY;ac=ad.clientWidth;O=ad.clientHeight;P=O/ac;Y=al;L=ad.cloneNode(true);e.addClass(L,"mceClonedResizable");e.setStyles(L,{left:N,top:M,margin:0});T.documentElement.appendChild(L);e.bind(T,"mousemove",R);e.bind(T,"mouseup",ae);if(X!=T){e.bind(X,"mousemove",R);e.bind(X,"mouseup",ae)}})}else{e.show(ak)}e.setStyles(ak,{left:(ah*al[0]+N)-(ak.offsetWidth/2),top:(af*al[1]+M)-(ak.offsetHeight/2)})});if(!tinymce.isOpera&&ad.nodeName=="IMG"){ad.setAttribute("data-mce-selected","1")}}function S(){if(ad){ad.removeAttribute("data-mce-selected")}for(var af in aa){e.hide("mceResizeHandle"+af)}}a.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}");function U(){var af=e.getParent(l.getNode(),"table,img");E(e.select("img[data-mce-selected]"),function(ag){ag.removeAttribute("data-mce-selected")});if(af){Q(af)}else{S()}}a.onNodeChange.add(U);e.bind(T,"selectionchange",U);a.serializer.addAttributeFilter("data-mce-selected",function(af,ag){var ah=af.length;while(ah--){af[ah].attr(ag,null)}})}function D(){if(n()<9){v.addNodeFilter("noscript",function(L){var M=L.length,N,O;while(M--){N=L[M];O=N.firstChild;if(O){N.attr("data-mce-innertext",O.value)}}});o.addNodeFilter("noscript",function(L){var M=L.length,N,P,O;while(M--){N=L[M];P=L[M].firstChild;if(P){P.value=tinymce.html.Entities.decode(P.value)}else{O=N.attributes.map["data-mce-innertext"];if(O){N.attr("data-mce-innertext",null);P=new tinymce.html.Node("#text",3);P.value=O;P.raw=true;N.append(P)}}}})}}t();G();q();if(tinymce.isWebKit){d();J();K();h();m();if(tinymce.isIDevice){b()}else{u();I()}}if(tinymce.isIE){B();x();C();g();i();r();D()}if(tinymce.isGecko){B();y();c();F();s();p()}if(tinymce.isOpera){u()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script noscript style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);textBlockElementsMap=m("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure");v=m("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",textBlockElementsMap);function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){x.reverse();A=o=f.filterNode(x[0].clone());for(u=0;u0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){if(!q){return false}var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},addStyle:function(j){var k=this.doc,i;styleElm=k.getElementById("mceDefaultStyles");if(!styleElm){styleElm=k.createElement("style"),styleElm.id="mceDefaultStyles";styleElm.type="text/css";i=k.getElementsByTagName("head")[0];if(i.firstChild){i.insertBefore(styleElm,i.firstChild)}else{i.appendChild(styleElm)}}if(styleElm.styleSheet){styleElm.styleSheet.cssText+=j}else{styleElm.appendChild(k.createTextNode(j))}},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
            "+j;m.removeChild(m.firstChild)}catch(l){var n=i.create("div");n.innerHTML="
            "+j;g(e.grep(n.childNodes),function(p,o){if(o&&m.canHaveHTML){m.appendChild(p)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,v,q,t,s=d.dom.doc,m=s.body,r,u;function j(C){var y,B,x,A,z;x=h.create("a");y=C?k:v;B=C?p:q;A=n.duplicate();if(y==s||y==s.documentElement){y=m;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);h.remove(x);n.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){h.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{if(y.canHaveHTML){y.innerHTML="\uFEFF";x=y.firstChild;A.moveToElementText(x);A.collapse(f)}}n.setEndPoint(C?"StartToStart":"EndToEnd",A);h.remove(x)}}k=i.startContainer;p=i.startOffset;v=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==v&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){t=k.previousSibling;if(t&&!t.hasChildNodes()&&h.isBlock(t)){t.innerHTML="\uFEFF"}else{t=null}k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(t){t.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{u=k.childNodes[p];l=m.createControlRange();l.addElement(u);l.select();r=d.getRng();if(r.item&&u===r.item(0)){return}}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return ye[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="

            ";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="
            ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var i=this,h=i.getRng(),j,g,l,k;if(h.duplicate||h.item){if(h.item){return h.item(0)}l=h.duplicate();l.collapse(1);j=l.parentElement();if(j.ownerDocument!==i.dom.doc){j=i.dom.getRoot()}g=k=h.parentElement();while(k=k.parentNode){if(k==j){j=g;break}}return j}else{j=h.startContainer;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[Math.min(j.childNodes.length-1,h.startOffset)]}if(j&&j.nodeType==3){return j.parentNode}return j}},getEnd:function(){var h=this,g=h.getRng(),j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);j=g.parentElement();if(j.ownerDocument!==h.dom.doc){j=h.dom.getRoot()}if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=g.endContainer;i=g.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[i>0?i-1:i]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
            '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},selectorChanged:function(g,j){var h=this,i;if(!h.selectorChangedData){h.selectorChangedData={};i={};h.editor.onNodeChange.addToTop(function(l,k,o){var p=h.dom,m=p.getParents(o,null,p.getRoot()),n={};e(h.selectorChangedData,function(r,q){e(m,function(s){if(p.is(s,q)){if(!i[q]){e(r,function(t){t(true,{node:s,selector:q,parents:m})});i[q]=r}n[q]=r;return false}})});e(i,function(r,q){if(!n[q]){delete i[q];e(r,function(s){s(false,{node:o,selector:q,parents:m})})}})})}if(!h.selectorChangedData[g]){h.selectorChangedData[g]=[]}h.selectorChangedData[g].push(j);return h},scrollIntoView:function(k){var j,h,g=this,i=g.dom;h=i.getViewPort(g.editor.getWin());j=i.getPos(k).y;if(jh.y+h.h){g.editor.getWin().scrollTo(0,j0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("noscript",function(j){var k=j.length,l;while(k--){l=j[k].firstChild;if(l){l.value=a.html.Entities.decode(l.value)}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+(c?''+c+"":"")}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.keyboardNav=new d.ui.KeyboardNavigation({root:f.id+"_menu",items:c.select("a",f.id+"_menu"),onCancel:function(){f.hideMenu();f.focus()}});f.keyboardNav.focus();f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch();f.keyboardNav.destroy()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){var f=this;f.parent();a.clear(f.id+"_menu");a.clear(f.id+"_more");c.remove(f.id+"_menu");if(f.keyboardNav){f.keyboardNav.destroy()}}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
            ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
            ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}if(!this.editors.hasOwnProperty(l)){return a}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.contentStyles=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(!q.content_editable){p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden"}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.language+".js")}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,G=this,H=G.settings,D,y,z,C=G.getElement(),p,m,E,v,B,F,x,r=[];k.add(G);H.aria_label=H.aria_label||l.getAttrib(C,"aria-label",G.getLang("aria.rich_text_area"));if(H.theme){if(typeof H.theme!="function"){H.theme=H.theme.replace(/-/,"");p=h.get(H.theme);G.theme=new p();if(G.theme.init){G.theme.init(G,h.urls[H.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{G.theme=H.theme}}function A(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){A(u)});n=new t(G,o);G.plugins[s]=n;if(n.init){n.init(G,o);r.push(s)}}}i(g(H.plugins.replace(/\-/g,"")),A);if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new k.ControlManager(G);G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui&&G.theme){G.orgDisplay=C.style.display;if(typeof H.theme!="function"){D=H.width||C.style.width||C.offsetWidth;y=H.height||C.style.height||C.offsetHeight;z=H.min_height||100;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D,10)+(p.deltaWidth||0),100)}if(F.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),z)}p=G.theme.renderUI({targetNode:C,width:D,height:y,deltaWidth:H.delta_width,deltaHeight:H.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:D,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y';if(H.document_base_url!=k.documentBaseURL){G.iframeHTML+=''}if(k.isIE8){if(H.ie7_compat){G.iframeHTML+=''}else{G.iframeHTML+=''}}G.iframeHTML+='';for(x=0;x'}G.contentCSS=[];v=H.body_id||"tinymce";if(v.indexOf("=")!=-1){v=G.getParam("body_id","","hash");v=v[G.id]||v}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='
            ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",allowTransparency:"true",title:H.aria_label,style:{width:"100%",height:y,display:"block"}});G.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=G.orgDisplay}C.style.visibility=G.orgVisibility;l.get(G.id).style.display="none";l.setAttrib(G.id,"aria-hidden",true);if(!k.relaxedDomain||!E){G.initContentBody()}C=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m,s;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(t,u){var v=t.length,y,A=n.dom,z,x;while(v--){y=t[v];z=y.attr(u);x="data-mce-"+u;if(!y.attributes.map[x]){if(u==="style"){y.attr(x,A.serializeStyle(A.parseStyle(z),y.name))}else{y.attr(x,n.convertURL(z,u,y.name))}}}});n.parser.addNodeFilter("script",function(t,u){var v=t.length,x;while(v--){x=t[v];x.attr("type","mce-"+(x.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(t,u){var v=t.length,x;while(v--){x=t[v];x.type=8;x.name="#comment";x.value="[CDATA["+x.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(u,v){var x=u.length,y,t=n.schema.getNonEmptyElements();while(x--){y=u[x];if(y.isEmpty(t)){y.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer,n);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.onExecCommand.add(function(t,u){if(!/^(FontName|FontSize)$/.test(u)){n.nodeChanged()}});n.serializer.onPreProcess.add(function(t,u){return n.onPreProcess.dispatch(n,u,t)});n.serializer.onPostProcess.add(function(t,u){return n.onPostProcess.dispatch(n,u,t)});n.onPreInit.dispatch(n);if(!p.browser_spellcheck&&!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(t,u){i(p.protect,function(v){u.content=u.content.replace(v,function(x){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(t,u){u.content=u.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
            [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});if(n.contentStyles.length>0){s="";i(n.contentStyles,function(t){s+=t+"\r\n"});n.dom.addStyle(s)}i(n.contentCSS,function(t){n.dom.loadCSS(t)});if(p.auto_focus){setTimeout(function(){var t=k.get(p.auto_focus);t.selection.select(t.getBody(),1);t.selection.collapse(1);t.getBody().focus();t.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){if(u.lastIERng){t.setRng(u.lastIERng)}n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
            "}else{r='
            '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}if(!o.settings.content_editable||document.activeElement===o.getBody()){o.selection.normalize()}return p.content},getContent:function(o){var n=this,p,m=n.getBody();o=o||{};o.format=o.format||"html";o.get=true;o.getInner=true;if(!o.no_events){n.onBeforeGetContent.dispatch(n,o)}if(o.format=="raw"){p=m.innerHTML}else{if(o.format=="text"){p=m.innerText||m.textContent}else{p=n.serializer.serialize(m,o)}}if(o.format!="text"){o.content=k.trim(p)}else{o.content=p}if(!o.no_events){n.onGetContent.dispatch(n,o)}return o.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!p.getAttrib(s,"href",false)){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,o=m.getContainer(),n=m.getDoc();if(!m.removed){m.removed=1;if(b&&n){n.execCommand("SelectAll")}m.save();l.setStyle(m.id,"display",m.orgDisplay);if(!m.settings.content_editable){j.unbind(m.getWin());j.unbind(m.getDoc())}j.unbind(m.getBody());j.clear(o);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(o)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){g.preventDefault();g.stopPropagation()}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(i,m){if(m.keyCode!=65||!a.VK.metaKeyPressed(m)){l.selection.normalize()}l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k(i,n)}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=p.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();if(p.getRng().setStart){v.setStart(x,0);v.setEnd(x,x.childNodes.length);p.setRng(v)}else{f("SelectAll")}}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(x){var v=m.getParent(p.getNode(),"ul,ol");return v&&(x==="insertunorderedlist"&&v.tagName==="UL"||x==="insertorderedlist"&&v.tagName==="OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getBody(),"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}}c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k1||ag==ay||ag.tagName=="BR"){return ag}}}var aq=aa.selection.getRng();var av=aq.startContainer;var ap=aq.endContainer;if(av!=ap&&aq.endOffset===0){var au=ar(av,ap);var at=au.nodeType==3?au.length:au.childNodes.length;aq.setEnd(au,at)}return aq}function ad(at,ay,aw,av,aq){var ap=[],ar=-1,ax,aA=-1,au=-1,az;T(at.childNodes,function(aC,aB){if(aC.nodeName==="UL"||aC.nodeName==="OL"){ar=aB;ax=aC;return false}});T(at.childNodes,function(aC,aB){if(aC.nodeName==="SPAN"&&c.getAttrib(aC,"data-mce-type")=="bookmark"){if(aC.id==ay.id+"_start"){aA=aB}else{if(aC.id==ay.id+"_end"){au=aB}}}});if(ar<=0||(aAar)){T(a.grep(at.childNodes),aq);return 0}else{az=c.clone(aw,X);T(a.grep(at.childNodes),function(aC,aB){if((aAar&&aB>ar)){ap.push(aC);aC.parentNode.removeChild(aC)}});if(aAar){at.insertBefore(az,ax.nextSibling)}}av.push(az);T(ap,function(aB){az.appendChild(aB)});return az}}function an(aq,at,aw){var ap=[],av,ar,au=true;av=am.inline||am.block;ar=c.create(av);ab(ar);N.walk(aq,function(ax){var ay;function az(aA){var aF,aD,aB,aC,aE;aE=au;aF=aA.nodeName.toLowerCase();aD=aA.parentNode.nodeName.toLowerCase();if(aA.nodeType===1&&x(aA)){aE=au;au=x(aA)==="true";aC=true}if(g(aF,"br")){ay=0;if(am.block){c.remove(aA)}return}if(am.wrapper&&y(aA,ae,al)){ay=0;return}if(au&&!aC&&am.block&&!am.wrapper&&I(aF)){aA=c.rename(aA,av);ab(aA);ap.push(aA);ay=0;return}if(am.selector){T(ah,function(aG){if("collapsed" in aG&&aG.collapsed!==ai){return}if(c.is(aA,aG.selector)&&!b(aA)){ab(aA,aG);aB=true}});if(!am.inline||aB){ay=0;return}}if(au&&!aC&&d(av,aF)&&d(aD,av)&&!(!aw&&aA.nodeType===3&&aA.nodeValue.length===1&&aA.nodeValue.charCodeAt(0)===65279)&&!b(aA)){if(!ay){ay=c.clone(ar,X);aA.parentNode.insertBefore(ay,aA);ap.push(ay)}ay.appendChild(aA)}else{if(aF=="li"&&at){ay=ad(aA,at,ar,ap,az)}else{ay=0;T(a.grep(aA.childNodes),az);if(aC){au=aE}ay=0}}}T(ax,az)});if(am.wrap_links===false){T(ap,function(ax){function ay(aC){var aB,aA,az;if(aC.nodeName==="A"){aA=c.clone(ar,X);ap.push(aA);az=a.grep(aC.childNodes);for(aB=0;aB1||!H(az))&&ax===0){c.remove(az,1);return}if(am.inline||am.wrapper){if(!am.exact&&ax===1){az=ay(az)}T(ah,function(aB){T(c.select(aB.inline,az),function(aD){var aC;if(aB.wrap_links===false){aC=aD.parentNode;do{if(aC.nodeName==="A"){return}}while(aC=aC.parentNode)}Z(aB,al,aD,aB.exact?aD:null)})});if(y(az.parentNode,ae,al)){c.remove(az,1);az=0;return C}if(am.merge_with_parents){c.getParent(az.parentNode,function(aB){if(y(aB,ae,al)){c.remove(az,1);az=0;return C}})}if(az&&am.merge_siblings!==false){az=u(E(az),az);az=u(az,E(az,C))}}})}if(am){if(ag){if(ag.nodeType){ac=c.createRng();ac.setStartBefore(ag);ac.setEndAfter(ag);an(p(ac,ah),null,true)}else{an(ag,null,true)}}else{if(!ai||!am.inline||c.select("td.mceSelected,th.mceSelected").length){var ao=aa.selection.getNode();if(!m&&ah[0].defaultBlock&&!c.getParent(ao,c.isBlock)){Y(ah[0].defaultBlock)}aa.selection.setRng(af());ak=r.getBookmark();an(p(r.getRng(C),ah),ak);if(am.styles&&(am.styles.color||am.styles.textDecoration)){a.walk(ao,L,"childNodes");L(ao)}r.moveToBookmark(ak);R(r.getRng(C));aa.nodeChanged()}else{U("apply",ae,al)}}}}function B(ad,am,af){var ag=V(ad),ao=ag[0],ak,aj,ac,al=true;function ae(av){var au,at,ar,aq,ax,aw;if(av.nodeType===3){return}if(av.nodeType===1&&x(av)){ax=al;al=x(av)==="true";aw=true}au=a.grep(av.childNodes);if(al&&!aw){for(at=0,ar=ag.length;at=0;ac--){ab=ah[ac].selector;if(!ab){return C}for(ag=ad.length-1;ag>=0;ag--){if(c.is(ad[ag],ab)){return C}}}}return X}function J(ab,ae,ac){var ad;if(!P){P={};ad={};aa.onNodeChange.addToTop(function(ag,af,ai){var ah=n(ai),aj={};T(P,function(ak,al){T(ah,function(am){if(y(am,al,{},ak.similar)){if(!ad[al]){T(ak,function(an){an(true,{node:am,format:al,parents:ah})});ad[al]=ak}aj[al]=ak;return false}})});T(ad,function(ak,al){if(!aj[al]){delete ad[al];T(ak,function(am){am(false,{node:ai,format:al,parents:ah})})}})})}T(ab.split(","),function(af){if(!P[af]){P[af]=[];P[af].similar=ac}P[af].push(ae)});return this}a.extend(this,{get:V,register:l,apply:Y,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z,formatChanged:J});j();W();function h(ab,ac){if(g(ab,ac.inline)){return C}if(g(ab,ac.block)){return C}if(ac.selector){return c.is(ab,ac.selector)}}function g(ac,ab){ac=ac||"";ab=ab||"";ac=""+(ac.nodeName||ac);ab=""+(ab.nodeName||ab);return ac.toLowerCase()==ab.toLowerCase()}function O(ac,ab){var ad=c.getStyle(ac,ab);if(ab=="color"||ab=="backgroundColor"){ad=c.toHex(ad)}if(ab=="fontWeight"&&ad==700){ad="bold"}return""+ad}function q(ab,ac){if(typeof(ab)!="string"){ab=ab(ac)}else{if(ac){ab=ab.replace(/%(\w+)/g,function(ae,ad){return ac[ad]||ae})}}return ab}function f(ab){return ab&&ab.nodeType===3&&/^([\t \r\n]+|)$/.test(ab.nodeValue)}function S(ad,ac,ab){var ae=c.create(ac,ab);ad.parentNode.insertBefore(ae,ad);ae.appendChild(ad);return ae}function p(ab,am,ae){var ap,an,ah,al,ad=ab.startContainer,ai=ab.startOffset,ar=ab.endContainer,ak=ab.endOffset;function ao(aA){var au,ax,az,aw,av,at;au=ax=aA?ad:ar;av=aA?"previousSibling":"nextSibling";at=c.getRoot();function ay(aB){return aB.nodeName=="BR"&&aB.getAttribute("data-mce-bogus")&&!aB.nextSibling}if(au.nodeType==3&&!f(au)){if(aA?ai>0:akan?an:ai];if(ad.nodeType==3){ai=0}}if(ar.nodeType==1&&ar.hasChildNodes()){an=ar.childNodes.length-1;ar=ar.childNodes[ak>an?an:ak-1];if(ar.nodeType==3){ak=ar.nodeValue.length}}function aq(au){var at=au;while(at){if(at.nodeType===1&&x(at)){return x(at)==="false"?at:au}at=at.parentNode}return au}function aj(au,ay,aA){var ax,av,az,at;function aw(aC,aE){var aF,aB,aD=aC.nodeValue;if(typeof(aE)=="undefined"){aE=aA?aD.length:0}if(aA){aF=aD.lastIndexOf(" ",aE);aB=aD.lastIndexOf("\u00a0",aE);aF=aF>aB?aF:aB;if(aF!==-1&&!ae){aF++}}else{aF=aD.indexOf(" ",aE);aB=aD.indexOf("\u00a0",aE);aF=aF!==-1&&(aB===-1||aF0&&ah.node.nodeType===3&&ah.node.nodeValue.charAt(ah.offset-1)===" "){if(ah.offset>1){ar=ah.node;ar.splitText(ah.offset-1)}}}}if(am[0].inline||am[0].block_expand){if(!am[0].inline||(ad.nodeType!=3||ai===0)){ad=ao(true)}if(!am[0].inline||(ar.nodeType!=3||ak===ar.nodeValue.length)){ar=ao()}}if(am[0].selector&&am[0].expand!==X&&!am[0].inline){ad=af(ad,"previousSibling");ar=af(ar,"nextSibling")}if(am[0].block||am[0].selector){ad=ac(ad,"previousSibling");ar=ac(ar,"nextSibling");if(am[0].block){if(!H(ad)){ad=ao(true)}if(!H(ar)){ar=ao()}}}if(ad.nodeType==1){ai=s(ad);ad=ad.parentNode}if(ar.nodeType==1){ak=s(ar)+1;ar=ar.parentNode}return{startContainer:ad,startOffset:ai,endContainer:ar,endOffset:ak}}function Z(ah,ag,ae,ab){var ad,ac,af;if(!h(ae,ah)){return X}if(ah.remove!="all"){T(ah.styles,function(aj,ai){aj=q(aj,ag);if(typeof(ai)==="number"){ai=aj;ab=0}if(!ab||g(O(ab,ai),aj)){c.setStyle(ae,ai,"")}af=1});if(af&&c.getAttrib(ae,"style")==""){ae.removeAttribute("style");ae.removeAttribute("data-mce-style")}T(ah.attributes,function(ak,ai){var aj;ak=q(ak,ag);if(typeof(ai)==="number"){ai=ak;ab=0}if(!ab||g(c.getAttrib(ab,ai),ak)){if(ai=="class"){ak=c.getAttrib(ae,ai);if(ak){aj="";T(ak.split(/\s+/),function(al){if(/mce\w+/.test(al)){aj+=(aj?" ":"")+al}});if(aj){c.setAttrib(ae,ai,aj);return}}}if(ai=="class"){ae.removeAttribute("className")}if(e.test(ai)){ae.removeAttribute("data-mce-"+ai)}ae.removeAttribute(ai)}});T(ah.classes,function(ai){ai=q(ai,ag);if(!ab||c.hasClass(ab,ai)){c.removeClass(ae,ai)}});ac=c.getAttribs(ae);for(ad=0;adad?ad:af]}if(ab.nodeType===3&&ag&&af>=ab.nodeValue.length){ab=new t(ab,aa.getBody()).next()||ab}if(ab.nodeType===3&&!ag&&af===0){ab=new t(ab,aa.getBody()).prev()||ab}return ab}function U(ak,ab,ai){var al="_mce_caret",ac=aa.settings.caret_debug;function ad(ap){var ao=c.create("span",{id:al,"data-mce-bogus":true,style:ac?"color:red":""});if(ap){ao.appendChild(aa.getDoc().createTextNode(G))}return ao}function aj(ap,ao){while(ap){if((ap.nodeType===3&&ap.nodeValue!==G)||ap.childNodes.length>1){return false}if(ao&&ap.nodeType===1){ao.push(ap)}ap=ap.firstChild}return true}function ag(ao){while(ao){if(ao.id===al){return ao}ao=ao.parentNode}}function af(ao){var ap;if(ao){ap=new t(ao,ao);for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType===3){return ao}}}}function ae(aq,ap){var ar,ao;if(!aq){aq=ag(r.getStart());if(!aq){while(aq=c.get(al)){ae(aq,false)}}}else{ao=r.getRng(true);if(aj(aq)){if(ap!==false){ao.setStartBefore(aq);ao.setEndBefore(aq)}c.remove(aq)}else{ar=af(aq);if(ar.nodeValue.charAt(0)===G){ar=ar.deleteData(0,1)}c.remove(aq,1)}r.setRng(ao)}}function ah(){var aq,ao,av,au,ar,ap,at;aq=r.getRng(true);au=aq.startOffset;ap=aq.startContainer;at=ap.nodeValue;ao=ag(r.getStart());if(ao){av=af(ao)}if(at&&au>0&&au=0;at--){aq.appendChild(c.clone(ax[at],false));aq=aq.firstChild}aq.appendChild(c.doc.createTextNode(G));aq=aq.firstChild;c.insertAfter(aw,ay);r.setCursorLocation(aq,1)}}function an(){var ap,ao,aq;ao=ag(r.getStart());if(ao&&!c.isEmpty(ao)){a.walk(ao,function(ar){if(ar.nodeType==1&&ar.id!==al&&!c.isEmpty(ar)){c.setAttrib(ar,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){aa.onBeforeGetContent.addToTop(function(){var ao=[],ap;if(aj(ag(r.getStart()),ao)){ap=ao.length;while(ap--){c.setAttrib(ao[ap],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ao){aa[ao].addToTop(function(){ae();an()})});aa.onKeyDown.addToTop(function(ao,aq){var ap=aq.keyCode;if(ap==8||ap==37||ap==39){ae(ag(r.getStart()))}an()});r.onSetContent.add(an);self._hasCaretEvents=true}if(ak=="apply"){ah()}else{am()}}function R(ac){var ab=ac.startContainer,ai=ac.startOffset,ae,ah,ag,ad,af;if(ab.nodeType==3&&ai>=ab.nodeValue.length){ai=s(ab);ab=ab.parentNode;ae=true}if(ab.nodeType==1){ad=ab.childNodes;ab=ad[Math.min(ai,ad.length-1)];ah=new t(ab,c.getParent(ab,c.isBlock));if(ai>ad.length-1||ae){ah.next()}for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!f(ag)){af=c.create("a",null,G);ag.parentNode.insertBefore(af,ag);ac.setStart(ag,0);r.setRng(ac);c.remove(af);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(f){var i=f.dom,e=f.selection,d=f.settings,h=f.undoManager,c=f.schema.getNonEmptyElements();function g(A){var v=e.getRng(true),G,j,z,u,p,M,B,o,k,n,t,J,x,C;function E(N){return N&&i.isBlock(N)&&!/^(TD|TH|CAPTION|FORM)$/.test(N.nodeName)&&!/^(fixed|absolute)/i.test(N.style.position)&&i.getContentEditable(N)!=="true"}function F(O){var N;if(b.isIE&&i.isBlock(O)){N=e.getRng();O.appendChild(i.create("span",null,"\u00a0"));e.select(O);O.lastChild.outerHTML="";e.setRng(N)}}function y(P){var O=P,Q=[],N;while(O=O.firstChild){if(i.isBlock(O)){return}if(O.nodeType==1&&!c[O.nodeName.toLowerCase()]){Q.push(O)}}N=Q.length;while(N--){O=Q[N];if(!O.hasChildNodes()||(O.firstChild==O.lastChild&&O.firstChild.nodeValue==="")){i.remove(O)}else{if(O.nodeName=="A"&&(O.innerText||O.textContent)===" "){i.remove(O)}}}}function m(O){var T,R,N,U,S,Q=O,P;N=i.createRng();if(O.hasChildNodes()){T=new a(O,O);while(R=T.current()){if(R.nodeType==3){N.setStart(R,0);N.setEnd(R,0);break}if(c[R.nodeName.toLowerCase()]){N.setStartBefore(R);N.setEndBefore(R);break}Q=R;R=T.next()}if(!R){N.setStart(Q,0);N.setEnd(Q,0)}}else{if(O.nodeName=="BR"){if(O.nextSibling&&i.isBlock(O.nextSibling)){if(!M||M<9){P=i.create("br");O.parentNode.insertBefore(P,O)}N.setStartBefore(O);N.setEndBefore(O)}else{N.setStartAfter(O);N.setEndAfter(O)}}else{N.setStart(O,0);N.setEnd(O,0)}}e.setRng(N);i.remove(P);S=i.getViewPort(f.getWin());U=i.getPos(O).y;if(US.y+S.h){f.getWin().scrollTo(0,U'}return R}function q(Q){var P,O,N;if(z.nodeType==3&&(Q?u>0:u=z.nodeValue.length){if(!b.isIE&&!D()){P=i.create("br");v.insertNode(P);v.setStartAfter(P);v.setEndAfter(P);O=true}}P=i.create("br");v.insertNode(P);if(b.isIE&&t=="PRE"&&(!M||M<8)){P.parentNode.insertBefore(i.doc.createTextNode("\r"),P)}N=i.create("span",{}," ");P.parentNode.insertBefore(N,P);e.scrollIntoView(N);i.remove(N);if(!O){v.setStartAfter(P);v.setEndAfter(P)}else{v.setStartBefore(P);v.setEndBefore(P)}e.setRng(v);h.add()}function s(N){do{if(N.nodeType===3){N.nodeValue=N.nodeValue.replace(/^[\r\n]+/,"")}N=N.firstChild}while(N)}function K(P){var N=i.getRoot(),O,Q;O=P;while(O!==N&&i.getContentEditable(O)!=="false"){if(i.getContentEditable(O)==="true"){Q=O}O=O.parentNode}return O!==N?Q:N}function I(O){var N;if(!b.isIE){O.normalize();N=O.lastChild;if(!N||(/^(left|right)$/gi.test(i.getStyle(N,"float",true)))){i.add(O,"br")}}}if(!v.collapsed){f.execCommand("Delete");return}if(A.isDefaultPrevented()){return}z=v.startContainer;u=v.startOffset;x=(d.force_p_newlines?"p":"")||d.forced_root_block;x=x?x.toUpperCase():"";M=i.doc.documentMode;B=A.shiftKey;if(z.nodeType==1&&z.hasChildNodes()){C=u>z.childNodes.length-1;z=z.childNodes[Math.min(u,z.childNodes.length-1)]||z;if(C&&z.nodeType==3){u=z.nodeValue.length}else{u=0}}j=K(z);if(!j){return}h.beforeChange();if(!i.isBlock(j)&&j!=i.getRoot()){if(!x||B){L()}return}if((x&&!B)||(!x&&B)){z=l(z,u)}p=i.getParent(z,i.isBlock);n=p?i.getParent(p.parentNode,i.isBlock):null;t=p?p.nodeName.toUpperCase():"";J=n?n.nodeName.toUpperCase():"";if(J=="LI"&&!A.ctrlKey){p=n;t=J}if(t=="LI"){if(!x&&B){L();return}if(i.isEmpty(p)){if(/^(UL|OL|LI)$/.test(n.parentNode.nodeName)){return false}H();return}}if(t=="PRE"&&d.br_in_pre!==false){if(!B){L();return}}else{if((!x&&!B&&t!="LI")||(x&&B)){L();return}}x=x||"P";if(q()){if(/^(H[1-6]|PRE)$/.test(t)&&J!="HGROUP"){o=r(x)}else{o=r()}if(d.end_container_on_empty_block&&E(n)&&i.isEmpty(p)){o=i.split(n,p)}else{i.insertAfter(o,p)}m(o)}else{if(q(true)){o=p.parentNode.insertBefore(r(),p);F(o)}else{G=v.cloneRange();G.setEndAfter(p);k=G.extractContents();s(k);o=k.firstChild;i.insertAfter(k,p);y(o);I(p);m(o)}}i.setAttrib(o,"id","");h.add()}f.onKeyDown.add(function(k,j){if(j.keyCode==13){if(g(j)!==false){j.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce_popup.js b/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce_popup.js new file mode 100644 index 00000000..bb8e58c8 --- /dev/null +++ b/static/grappelli/tinymce/jscripts/tiny_mce/tiny_mce_popup.js @@ -0,0 +1,5 @@ + +// Uncomment and change this document.domain value if you are loading the script cross subdomains +// document.domain = 'moxiecode.com'; + +var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(' + + + + + + +
            +
            +

            Full featured example, with Accessibility settings enabled

            + +

            + This page has got the TinyMCE set up to work with configurations related to accessiblity enabled. + In particular +

              +
            • the content_css is set to false, to ensure that all default browser styles are used,
            • +
            • the browser_preferred_colors dialog option is used to ensure that default css is used for dialogs,
            • +
            • and the detect_highcontrast option has been set to ensure that highcontrast mode in Windows browsers + is detected and the toolbars are displayed in a high contrast mode.
            • +
            +

            + + +
            + +
            + +
            + + +
            +
            + + + + diff --git a/static/grappelli_old/tinymce/examples/css/content.css b/static/grappelli_old/tinymce/examples/css/content.css new file mode 100644 index 00000000..a76c38a2 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/css/content.css @@ -0,0 +1,105 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} + +/* Basic formats */ + +.bold { + font-weight: bold; +} + +.italic { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +/* Global align classes */ + +.left { + text-align: inherit; +} + +.center { + text-align: center; +} + +.right { + text-align: right; +} + +.full { + text-align: justify +} + +/* Image and table specific aligns */ + +img.left, table.left { + float: left; + text-align: inherit; +} + +img.center, table.center { + margin-left: auto; + margin-right: auto; + text-align: inherit; +} + +img.center { + display: block; +} + +img.right, table.right { + float: right; + text-align: inherit; +} diff --git a/static/grappelli_old/tinymce/examples/css/word.css b/static/grappelli_old/tinymce/examples/css/word.css new file mode 100644 index 00000000..049a39fb --- /dev/null +++ b/static/grappelli_old/tinymce/examples/css/word.css @@ -0,0 +1,53 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +p {margin:0; padding:0;} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} diff --git a/static/grappelli_old/tinymce/examples/custom_formats.html b/static/grappelli_old/tinymce/examples/custom_formats.html new file mode 100644 index 00000000..ba9d1eb0 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/custom_formats.html @@ -0,0 +1,111 @@ + + + +Custom formats example + + + + + + + + + +
            +
            +

            Custom formats example

            + +

            + This example shows you how to override the default formats for bold, italic, underline, strikethough and alignment to use classes instead of inline styles. + There are more examples on how to use TinyMCE in the Wiki. +

            + + +
            + +
            + + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
            + + +
            +
            + + + diff --git a/static/grappelli_old/tinymce/examples/full.html b/static/grappelli_old/tinymce/examples/full.html new file mode 100644 index 00000000..84b76ca7 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/full.html @@ -0,0 +1,101 @@ + + + +Full featured example + + + + + + + + + +
            +
            +

            Full featured example

            + +

            + This page shows all available buttons and plugins that are included in the TinyMCE core package. + There are more examples on how to use TinyMCE in the Wiki. +

            + + +
            + +
            + + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
            + + +
            +
            + + + + diff --git a/static/grappelli_old/tinymce/examples/index.html b/static/grappelli_old/tinymce/examples/index.html new file mode 100644 index 00000000..6ebfbea5 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/index.html @@ -0,0 +1,10 @@ + + + + TinyMCE examples + + + + + + diff --git a/static/grappelli_old/tinymce/examples/lists/image_list.js b/static/grappelli_old/tinymce/examples/lists/image_list.js new file mode 100644 index 00000000..7ba049a2 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/lists/image_list.js @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url" +// option is defined in TinyMCE init. + +var tinyMCEImageList = new Array( + // Name, URL + ["Logo 1", "media/logo.jpg"], + ["Logo 2 Over", "media/logo_over.jpg"] +); diff --git a/static/grappelli_old/tinymce/examples/lists/link_list.js b/static/grappelli_old/tinymce/examples/lists/link_list.js new file mode 100644 index 00000000..0d464331 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/lists/link_list.js @@ -0,0 +1,10 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url" +// option is defined in TinyMCE init. + +var tinyMCELinkList = new Array( + // Name, URL + ["Moxiecode", "http://www.moxiecode.com"], + ["Freshmeat", "http://www.freshmeat.com"], + ["Sourceforge", "http://www.sourceforge.com"] +); diff --git a/static/grappelli_old/tinymce/examples/lists/media_list.js b/static/grappelli_old/tinymce/examples/lists/media_list.js new file mode 100644 index 00000000..2e049587 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/lists/media_list.js @@ -0,0 +1,14 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCEMediaList = [ + // Name, URL + ["Some Flash", "media/sample.swf"], + ["Some Quicktime", "media/sample.mov"], + ["Some AVI", "media/sample.avi"], + ["Some RealMedia", "media/sample.rm"], + ["Some Shockwave", "media/sample.dcr"], + ["Some Video", "media/sample.mp4"], + ["Some FLV", "media/sample.flv"] +]; \ No newline at end of file diff --git a/static/grappelli_old/tinymce/examples/lists/template_list.js b/static/grappelli_old/tinymce/examples/lists/template_list.js new file mode 100644 index 00000000..e06d3578 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/lists/template_list.js @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCETemplateList = [ + // Name, URL, Description + ["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."], + ["Layout", "templates/layout1.htm", "HTML Layout."] +]; \ No newline at end of file diff --git a/static/grappelli_old/tinymce/examples/media/logo.jpg b/static/grappelli_old/tinymce/examples/media/logo.jpg new file mode 100644 index 00000000..ad535d67 Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/logo.jpg differ diff --git a/static/grappelli_old/tinymce/examples/media/logo_over.jpg b/static/grappelli_old/tinymce/examples/media/logo_over.jpg new file mode 100644 index 00000000..79fcd884 Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/logo_over.jpg differ diff --git a/static/grappelli_old/tinymce/examples/media/sample.avi b/static/grappelli_old/tinymce/examples/media/sample.avi new file mode 100644 index 00000000..238bb688 Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/sample.avi differ diff --git a/static/grappelli_old/tinymce/examples/media/sample.dcr b/static/grappelli_old/tinymce/examples/media/sample.dcr new file mode 100644 index 00000000..353b3ce6 Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/sample.dcr differ diff --git a/static/grappelli_old/tinymce/examples/media/sample.flv b/static/grappelli_old/tinymce/examples/media/sample.flv new file mode 100644 index 00000000..799d137e Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/sample.flv differ diff --git a/static/grappelli_old/tinymce/examples/media/sample.mov b/static/grappelli_old/tinymce/examples/media/sample.mov new file mode 100644 index 00000000..9c0a0932 Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/sample.mov differ diff --git a/static/grappelli_old/tinymce/examples/media/sample.ram b/static/grappelli_old/tinymce/examples/media/sample.ram new file mode 100644 index 00000000..e2ce04cf --- /dev/null +++ b/static/grappelli_old/tinymce/examples/media/sample.ram @@ -0,0 +1 @@ +http://streaming.uga.edu/samples/ayp_lan.rm \ No newline at end of file diff --git a/static/grappelli_old/tinymce/examples/media/sample.rm b/static/grappelli_old/tinymce/examples/media/sample.rm new file mode 100644 index 00000000..8947706e Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/sample.rm differ diff --git a/static/grappelli_old/tinymce/examples/media/sample.swf b/static/grappelli_old/tinymce/examples/media/sample.swf new file mode 100644 index 00000000..9f5fc4ac Binary files /dev/null and b/static/grappelli_old/tinymce/examples/media/sample.swf differ diff --git a/static/grappelli_old/tinymce/examples/menu.html b/static/grappelli_old/tinymce/examples/menu.html new file mode 100644 index 00000000..e48650ab --- /dev/null +++ b/static/grappelli_old/tinymce/examples/menu.html @@ -0,0 +1,18 @@ + + + +Menu + + + +

            Examples

            +Full featured +Simple theme +Skin support +Word processor +Custom formats +Accessibility Options + + diff --git a/static/grappelli_old/tinymce/examples/simple.html b/static/grappelli_old/tinymce/examples/simple.html new file mode 100644 index 00000000..70720caa --- /dev/null +++ b/static/grappelli_old/tinymce/examples/simple.html @@ -0,0 +1,47 @@ + + + +Simple theme example + + + + + + + + + +
            +

            Simple theme example

            + +

            + This page shows you the simple theme and it's core functionality you can extend it by changing the code use the advanced theme if you need to configure/add more buttons etc. + There are more examples on how to use TinyMCE in the Wiki. +

            + + + + +
            + + +
            + + + diff --git a/static/grappelli_old/tinymce/examples/skins.html b/static/grappelli_old/tinymce/examples/skins.html new file mode 100644 index 00000000..c1508588 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/skins.html @@ -0,0 +1,216 @@ + + + +Skin support example + + + + + + + + + +
            +

            Skin support example

            + +

            + This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins//ui.css + There are more examples on how to use TinyMCE in the Wiki. +

            + + + + +
            + + + +
            + + + +
            + + + +
            + + +
            + + + diff --git a/static/grappelli_old/tinymce/examples/templates/layout1.htm b/static/grappelli_old/tinymce/examples/templates/layout1.htm new file mode 100644 index 00000000..a38df3e6 --- /dev/null +++ b/static/grappelli_old/tinymce/examples/templates/layout1.htm @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +
            Column 1Column 2
            Username: {$username}Staffid: {$staffid}
            diff --git a/static/grappelli_old/tinymce/examples/templates/snippet1.htm b/static/grappelli_old/tinymce/examples/templates/snippet1.htm new file mode 100644 index 00000000..b2520bea --- /dev/null +++ b/static/grappelli_old/tinymce/examples/templates/snippet1.htm @@ -0,0 +1 @@ +This is just some code. diff --git a/static/grappelli_old/tinymce/examples/word.html b/static/grappelli_old/tinymce/examples/word.html new file mode 100644 index 00000000..d827b6fe --- /dev/null +++ b/static/grappelli_old/tinymce/examples/word.html @@ -0,0 +1,72 @@ + + + +Word processor example + + + + + + + + + +
            +

            Word processor example

            + +

            + This page shows you how to configure TinyMCE to work more like common word processors. + There are more examples on how to use TinyMCE in the Wiki. +

            + + + + +
            + + +
            + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/langs/de.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/langs/de.js new file mode 100644 index 00000000..14944062 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n({de:{common:{"more_colors":"Weitere Farben","invalid_data":"Fehler: Sie haben ung\u00fcltige Werte eingegeben (rot markiert).","popup_blocked":"Leider hat Ihr Popup-Blocker ein Fenster unterbunden, das f\u00fcr den Betrieb dieses Programms n\u00f6tig ist. Bitte deaktivieren Sie den Popup-Blocker f\u00fcr diese Seite.","clipboard_no_support":"Wird derzeit in Ihrem Browser nicht unterst\u00fctzt. Bitte benutzen Sie stattdessen die Tastenk\u00fcrzel.","clipboard_msg":"Kopieren, Ausschneiden und Einf\u00fcgen sind im Mozilla Firefox nicht m\u00f6glich.\nM\u00f6chten Sie mehr \u00fcber dieses Problem erfahren?","not_set":"- unbestimmt -","class_name":"CSS-Klasse",browse:"Durchsuchen",close:"Schlie\u00dfen",cancel:"Abbrechen",update:"Aktualisieren",insert:"Einf\u00fcgen",apply:"\u00dcbernehmen","edit_confirm":"M\u00f6chten Sie diesen Text jetzt bearbeiten?","invalid_data_number":"{#field} muss eine Zahl sein","invalid_data_min":"{#field} muss eine Zahl gr\u00f6\u00dfer als {#min} sein","invalid_data_size":"{#field} muss eine Zahl oder ein Prozentwert sein",value:"(Wert)"},contextmenu:{full:"Blocksatz",right:"Rechtsb\u00fcndig",center:"Zentriert",left:"Linksb\u00fcndig",align:"Ausrichtung"},insertdatetime:{"day_short":"So,Mo,Di,Mi,Do,Fr,Sa,So","day_long":"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag","months_short":"Jan,Feb,M\u00e4r,Apr,Mai,Juni,Juli,Aug,Sept,Okt,Nov,Dez","months_long":"Januar,Februar,M\u00e4rz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember","inserttime_desc":"Zeit einf\u00fcgen","insertdate_desc":"Datum einf\u00fcgen","time_fmt":"%H:%M:%S","date_fmt":"%d.%m.%Y"},print:{"print_desc":"Drucken"},preview:{"preview_desc":"Vorschau"},directionality:{"rtl_desc":"Schrift von rechts nach links","ltr_desc":"Schrift von links nach rechts"},layer:{content:"Neue Ebene...","absolute_desc":"Absolute Positionierung","backward_desc":"Nach hinten legen","forward_desc":"Nach vorne holen","insertlayer_desc":"Neue Ebene einf\u00fcgen"},save:{"save_desc":"Speichern","cancel_desc":"Alle \u00c4nderungen verwerfen"},nonbreaking:{"nonbreaking_desc":"Gesch\u00fctztes Leerzeichen einf\u00fcgen"},iespell:{download:"ieSpell konnte nicht gefunden werden. Wollen Sie es installieren?","iespell_desc":"Rechtschreibpr\u00fcfung"},advhr:{"advhr_desc":"Trennlinie","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Smilies","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"Suchen/Ersetzen","search_desc":"Suchen","delta_width":"","delta_height":""},advimage:{"image_desc":"Bild einf\u00fcgen/ver\u00e4ndern","delta_width":"","delta_height":""},advlink:{"link_desc":"Link einf\u00fcgen/ver\u00e4ndern","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Attribute einf\u00fcgen/bearbeiten","ins_desc":"Eingef\u00fcgter Text","del_desc":"Entfernter Text","acronym_desc":"Akronym","abbr_desc":"Abk\u00fcrzung","cite_desc":"Quellenangabe","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"CSS-Styles bearbeiten","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Einf\u00fcgemodus ist nun \"Nur Text\". Erneut klicken stellt den Normalmodus wieder her.","plaintext_mode_sticky":"Einf\u00fcgemodus ist nun \"Nur Text\". Erneut klicken (oder das Einf\u00fcgen aus der Zwischenablage) stellt den Normalmodus wieder her.","selectall_desc":"Alles ausw\u00e4hlen","paste_word_desc":"Mit Formatierungen (aus Word) einf\u00fcgen","paste_text_desc":"Als einfachen Text einf\u00fcgen"},"paste_dlg":{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."},table:{"cellprops_delta_width":"150",cell:"Zelle",col:"Spalte",row:"Zeile",del:"Tabelle l\u00f6schen","copy_row_desc":"Zeile kopieren","cut_row_desc":"Zeile ausschneiden","paste_row_after_desc":"Zeile unterhalb aus der Zwischenablage einf\u00fcgen","paste_row_before_desc":"Zeile oberhalb aus der Zwischenablage einf\u00fcgen","props_desc":"Eigenschaften der Tabelle","cell_desc":"Eigenschaften der Zelle","row_desc":"Eigenschaften der Zeile","merge_cells_desc":"Zellen verbinden","split_cells_desc":"Verbundene Zellen trennen","delete_col_desc":"Spalte l\u00f6schen","col_after_desc":"Spalte rechts einf\u00fcgen","col_before_desc":"Spalte links einf\u00fcgen","delete_row_desc":"Zeile l\u00f6schen","row_after_desc":"Zeile unterhalb einf\u00fcgen","row_before_desc":"Zeile oberhalb einf\u00fcgen",desc:"Tabelle erstellen/bearbeiten","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Wenn Sie den Inhalt wiederherstellen, gehen die aktuellen Daten im Editor verloren.\n\nSind sie sicher, dass Sie den Inhalt wiederherstellen m\u00f6chten?","restore_content":"Automatisch gespeicherten Inhalt wiederherstellen.","unload_msg":"Ihre \u00c4nderungen werden verloren gehen, wenn Sie die Seite verlassen."},fullscreen:{desc:"Vollbildschirm"},media:{edit:"Multimediaeinbettung bearbeiten",desc:"Multimedia einbetten/bearbeiten","delta_height":"","delta_width":""},fullpage:{desc:"Dokument-Eigenschaften","delta_width":"","delta_height":""},template:{desc:"Inhalt aus Vorlage einf\u00fcgen"},visualchars:{desc:"Sichtbarkeit der Steuerzeichen an/aus"},spellchecker:{desc:"Rechtschreibpr\u00fcfung an/aus",menu:"Einstellungen der Rechtschreibpr\u00fcfung","ignore_word":"Wort ignorieren","ignore_words":"Alle ignorieren",langs:"Sprachen",wait:"Bitte warten...",sug:"Vorschl\u00e4ge","no_sug":"Keine Vorschl\u00e4ge","no_mpell":"Keine Rechtschreibfehler gefunden.","learn_word":"Zum W\u00f6rterbuch hinzuf\u00fcgen"},pagebreak:{desc:"Seitenumbruch einf\u00fcgen"},advlist:{types:"Typen",def:"Standard","lower_alpha":"a. b. c.","lower_greek":"1. 2. 3.","lower_roman":"i. ii. iii.","upper_alpha":"A. B. C.","upper_roman":"I. II. III.",circle:"Kreis",disc:"Punkt",square:"Quadrat"},colors:{"333300":"Dunkeloliv","993300":"Orange","000000":"Schwarz","003300":"Dunkelgr\u00fcn","003366":"Dunkles himmelblau","000080":"Marineblau","333399":"Indigoblau","333333":"Sehr dunkelgrau","800000":"Kastanienbraun",FF6600:"Orange","808000":"Oliv","008000":"Gr\u00fcn","008080":"Blaugr\u00fcn","0000FF":"Blau","666699":"Graublau","808080":"Grau",FF0000:"Rot",FF9900:"Bernsteinfarben","99CC00":"Gelbgr\u00fcn","339966":"Meergr\u00fcn","33CCCC":"T\u00fcrkis","3366FF":"K\u00f6nigsblau","800080":"Violett","999999":"Mittelgrau",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Gelb","00FF00":"Hellgr\u00fcn","00FFFF":"Aquamarinblau","00CCFF":"Himmelblau","993366":"Braun",C0C0C0:"Silber",FF99CC:"Rosa",FFCC99:"Pfirsichfarben",FFFF99:"Hellgelb",CCFFCC:"Blassgr\u00fcn",CCFFFF:"Blasst\u00fcrkis","99CCFF":"Helles himmelblau",CC99FF:"Pflaumenblau",FFFFFF:"Wei\u00df"},aria:{"rich_text_area":"Rich Text Bereich"},wordcount:{words:"W\u00f6rter: "}}}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/langs/en.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/langs/en.js new file mode 100644 index 00000000..19324f74 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/license.txt b/static/grappelli_old/tinymce/jscripts/tiny_mce/license.txt new file mode 100644 index 00000000..60d6d4c8 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/license.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css new file mode 100644 index 00000000..0e228349 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css @@ -0,0 +1,5 @@ +input.radio {border:1px none #000; background:transparent; vertical-align:middle;} +.panel_wrapper div.current {height:80px;} +#width {width:50px; vertical-align:middle;} +#width2 {width:50px; vertical-align:middle;} +#size {width:100px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js new file mode 100644 index 00000000..4d3b062d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js new file mode 100644 index 00000000..0c652d33 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js @@ -0,0 +1,57 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedHRPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvancedHr', function() { + ed.windowManager.open({ + file : url + '/rule.htm', + width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), + height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('advhr', { + title : 'advhr.advhr_desc', + cmd : 'mceAdvancedHr' + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('advhr', n.nodeName == 'HR'); + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'HR') + ed.selection.select(e); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced HR', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js new file mode 100644 index 00000000..b6cbd66c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js @@ -0,0 +1,43 @@ +var AdvHRDialog = { + init : function(ed) { + var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; + + w = dom.getAttrib(n, 'width'); + f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); + f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; + f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); + selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); + }, + + update : function() { + var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; + + h = ' + + + {#advhr.advhr_desc} + + + + + + + +
            + + +
            +
            + + + + + + + + + + + + + +
            + + + +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css new file mode 100644 index 00000000..54dc8439 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css @@ -0,0 +1,12 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js new file mode 100644 index 00000000..d613a613 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js new file mode 100644 index 00000000..d2678cbc --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm new file mode 100644 index 00000000..870af470 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm @@ -0,0 +1,222 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + +
            + +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + {#advimage_dlg.preview} + +
            +
            +
            +
            + {#advimage_dlg.tab_appearance} + +
            +
            +
            +
            + x + px +

            + + +

            +
            +
            +
            + + + +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            + + + + +
             
            +
            +
            + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + +
            + + + + + +
             
            +
            +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif new file mode 100644 index 00000000..53bf6890 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js new file mode 100644 index 00000000..f0b7c6ee --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js @@ -0,0 +1,464 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = isIE ? '0' : '0 none none'; + else { + var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9); + + if (b.length == 3 && b[isOldIE ? 2 : 1]) + bStyle = b[isOldIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isOldIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js new file mode 100644 index 00000000..fc0f6d1e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advimage_dlg',{"image_list":"Bilderliste","align_right":"Rechts","align_left":"Links","align_textbottom":"Unten im Text","align_texttop":"Oben im Text","align_bottom":"Unten","align_middle":"Mittig","align_top":"Oben","align_baseline":"Zeile",align:"Ausrichtung",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",dimensions:"Ausma\u00dfe",border:"Rahmen",list:"Bilderliste",alt:"Beschreibung",src:"Adresse","dialog_title":"Bild einf\u00fcgen/ver\u00e4ndern","missing_alt":"Wollen Sie wirklich keine Beschreibung eingeben? Bestimmte Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnen so nicht darauf zugreifen, ebenso solche, die einen Textbrowser benutzen oder die Anzeige von Bildern deaktiviert haben.","example_img":"Vorschau auf das Aussehen",misc:"Verschiedenes",mouseout:"bei keinem Mauskontakt",mouseover:"bei Mauskontakt","alt_image":"Alternatives Bild","swap_image":"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Rechts nach links",ltr:"Links nach rechts",classes:"Klassen",style:"Format","long_desc":"Ausf\u00fchrliche Beschreibung",langcode:"Sprachcode",langdir:"Schriftrichtung","constrain_proportions":"Seitenverh\u00e4ltnis beibehalten",preview:"Vorschau",title:"Titel",general:"Allgemein","tab_advanced":"Erweitert","tab_appearance":"Aussehen","tab_general":"Allgemein",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js new file mode 100644 index 00000000..5f122e2c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css new file mode 100644 index 00000000..0a6251a6 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css @@ -0,0 +1,13 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +input {width: 280px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js new file mode 100644 index 00000000..d613a613 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js new file mode 100644 index 00000000..d2678cbc --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm new file mode 100644 index 00000000..ed16b3d4 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm @@ -0,0 +1,235 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + + +
            + + +
            +
            +
            + {#advimage_dlg.general} + + + + + + + + + + + + + + + + + + + +
            + +
            + {#advimage_dlg.preview} + +
            +
            + +
            +
            + {#advimage_dlg.tab_appearance} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + {#advimage_dlg.example_img} + Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam + nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum + edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam + erat volutpat. +
            +
            + + x + + px +
              + + + + +
            +
            +
            +
            + +
            +
            + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            + + + + +
             
            +
            + +
            + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + +
            + + + + +
             
            +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif new file mode 100644 index 00000000..53bf6890 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js new file mode 100644 index 00000000..f0b7c6ee --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js @@ -0,0 +1,464 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = isIE ? '0' : '0 none none'; + else { + var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9); + + if (b.length == 3 && b[isOldIE ? 2 : 1]) + bStyle = b[isOldIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isOldIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js new file mode 100644 index 00000000..fc0f6d1e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advimage_dlg',{"image_list":"Bilderliste","align_right":"Rechts","align_left":"Links","align_textbottom":"Unten im Text","align_texttop":"Oben im Text","align_bottom":"Unten","align_middle":"Mittig","align_top":"Oben","align_baseline":"Zeile",align:"Ausrichtung",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",dimensions:"Ausma\u00dfe",border:"Rahmen",list:"Bilderliste",alt:"Beschreibung",src:"Adresse","dialog_title":"Bild einf\u00fcgen/ver\u00e4ndern","missing_alt":"Wollen Sie wirklich keine Beschreibung eingeben? Bestimmte Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnen so nicht darauf zugreifen, ebenso solche, die einen Textbrowser benutzen oder die Anzeige von Bildern deaktiviert haben.","example_img":"Vorschau auf das Aussehen",misc:"Verschiedenes",mouseout:"bei keinem Mauskontakt",mouseover:"bei Mauskontakt","alt_image":"Alternatives Bild","swap_image":"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Rechts nach links",ltr:"Links nach rechts",classes:"Klassen",style:"Format","long_desc":"Ausf\u00fchrliche Beschreibung",langcode:"Sprachcode",langdir:"Schriftrichtung","constrain_proportions":"Seitenverh\u00e4ltnis beibehalten",preview:"Vorschau",title:"Titel",general:"Allgemein","tab_advanced":"Erweitert","tab_appearance":"Aussehen","tab_general":"Allgemein",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js new file mode 100644 index 00000000..5f122e2c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css new file mode 100644 index 00000000..14364316 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css @@ -0,0 +1,8 @@ +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js new file mode 100644 index 00000000..983fe5a9 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js new file mode 100644 index 00000000..14e46a76 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js new file mode 100644 index 00000000..f013aac1 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js @@ -0,0 +1,543 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self"; + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', linkTarget); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', linkTarget, true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i' + name + ''; + + if ((name = nodes[i].id) != "" && !nodes[i].href) + html += ''; + } + + if (html == "") + return ""; + + html = ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js new file mode 100644 index 00000000..bb0d3e35 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advlink_dlg',{"target_name":"Name der Zielseite",classes:"Klassen",style:"Format",id:"ID","popup_position":"Position (X/Y)",langdir:"Schriftrichtung","popup_size":"Gr\u00f6\u00dfe","popup_dependent":"Vom Elternfenster abh\u00e4ngig
            (nur Mozilla/Firefox) ","popup_resizable":"Vergr\u00f6\u00dfern des Fenster zulassen","popup_location":"Adressleiste anzeigen","popup_menubar":"Browsermen\u00fc anzeigen","popup_toolbar":"Werkzeugleisten anzeigen","popup_statusbar":"Statusleiste anzeigen","popup_scrollbars":"Scrollbalken anzeigen","popup_return":"Link trotz Popup folgen","popup_name":"Name des Fensters","popup_url":"Popup-Adresse",popup:"JavaScript-Popup","target_blank":"In neuem Fenster \u00f6ffnen","target_top":"Im obersten Frame \u00f6ffnen (sprengt das Frameset)","target_parent":"Im \u00fcbergeordneten Fenster/Frame \u00f6ffnen","target_same":"Im selben Fenster/Frame \u00f6ffnen","anchor_names":"Anker","popup_opts":"Optionen","advanced_props":"Erweiterte Eigenschaften","event_props":"Ereignisse","popup_props":"Popup-Eigenschaften","general_props":"Allemeine Eigenschaften","advanced_tab":"Erweitert","events_tab":"Ereignisse","popup_tab":"Popup","general_tab":"Allgemein",list:"Linkliste","is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?",titlefield:"Titel",target:"Fenster",url:"Adresse",title:"Link einf\u00fcgen/bearbeiten","link_list":"Linkliste",rtl:"Rechts nach links",ltr:"Links nach rechts",accesskey:"Tastenk\u00fcrzel",tabindex:"Tabindex",rev:"Beziehung des Linkziels zur Seite",rel:"Beziehung der Seite zum Linkziel",mime:"MIME-Type der Zielseite",encoding:"Zeichenkodierung der Zielseite",langcode:"Sprachcode","target_langcode":"Sprache der Zielseite",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js new file mode 100644 index 00000000..3169a565 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm new file mode 100644 index 00000000..cd0b6053 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm @@ -0,0 +1,371 @@ + + + + {#advlink_dlg.title} + + + + + + + + +
            + + +
            +
            +
            + {#advlink_dlg.general_props} +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
             
            +
            +
            +
            +
            +
            +
             
            +
            +
            +
            +
            +
            +
             
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            + + + +
            +
            + {#advlink_dlg.advanced_props} +
            +
            +
            +
            +
            +
            + + + + + + + + + + + + +
            +
            + + +
            +
            + {#advlink_dlg.event_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css new file mode 100644 index 00000000..14364316 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css @@ -0,0 +1,8 @@ +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js new file mode 100644 index 00000000..983fe5a9 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js new file mode 100644 index 00000000..14e46a76 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js new file mode 100644 index 00000000..f013aac1 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js @@ -0,0 +1,543 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self"; + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', linkTarget); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', linkTarget, true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i' + name + ''; + + if ((name = nodes[i].id) != "" && !nodes[i].href) + html += ''; + } + + if (html == "") + return ""; + + html = ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js new file mode 100644 index 00000000..bb0d3e35 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advlink_dlg',{"target_name":"Name der Zielseite",classes:"Klassen",style:"Format",id:"ID","popup_position":"Position (X/Y)",langdir:"Schriftrichtung","popup_size":"Gr\u00f6\u00dfe","popup_dependent":"Vom Elternfenster abh\u00e4ngig
            (nur Mozilla/Firefox) ","popup_resizable":"Vergr\u00f6\u00dfern des Fenster zulassen","popup_location":"Adressleiste anzeigen","popup_menubar":"Browsermen\u00fc anzeigen","popup_toolbar":"Werkzeugleisten anzeigen","popup_statusbar":"Statusleiste anzeigen","popup_scrollbars":"Scrollbalken anzeigen","popup_return":"Link trotz Popup folgen","popup_name":"Name des Fensters","popup_url":"Popup-Adresse",popup:"JavaScript-Popup","target_blank":"In neuem Fenster \u00f6ffnen","target_top":"Im obersten Frame \u00f6ffnen (sprengt das Frameset)","target_parent":"Im \u00fcbergeordneten Fenster/Frame \u00f6ffnen","target_same":"Im selben Fenster/Frame \u00f6ffnen","anchor_names":"Anker","popup_opts":"Optionen","advanced_props":"Erweiterte Eigenschaften","event_props":"Ereignisse","popup_props":"Popup-Eigenschaften","general_props":"Allemeine Eigenschaften","advanced_tab":"Erweitert","events_tab":"Ereignisse","popup_tab":"Popup","general_tab":"Allgemein",list:"Linkliste","is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?",titlefield:"Titel",target:"Fenster",url:"Adresse",title:"Link einf\u00fcgen/bearbeiten","link_list":"Linkliste",rtl:"Rechts nach links",ltr:"Links nach rechts",accesskey:"Tastenk\u00fcrzel",tabindex:"Tabindex",rev:"Beziehung des Linkziels zur Seite",rel:"Beziehung der Seite zum Linkziel",mime:"MIME-Type der Zielseite",encoding:"Zeichenkodierung der Zielseite",langcode:"Sprachcode","target_langcode":"Sprache der Zielseite",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js new file mode 100644 index 00000000..3169a565 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm new file mode 100644 index 00000000..8ab7c2a9 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm @@ -0,0 +1,338 @@ + + + + {#advlink_dlg.title} + + + + + + + + + +
            + + + + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js new file mode 100644 index 00000000..57ecce6e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js new file mode 100644 index 00000000..a8f046b4 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js @@ -0,0 +1,176 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.AdvListPlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + function buildFormats(str) { + var formats = []; + + each(str.split(/,/), function(type) { + formats.push({ + title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), + styles : { + listStyleType : type == 'default' ? '' : type + } + }); + }); + + return formats; + }; + + // Setup number formats from config or default + t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); + t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); + + if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) + t.isIE7 = true; + }, + + createControl: function(name, cm) { + var t = this, btn, format, editor = t.editor; + + if (name == 'numlist' || name == 'bullist') { + // Default to first item if it's a default item + if (t[name][0].title == 'advlist.def') + format = t[name][0]; + + function hasFormat(node, format) { + var state = true; + + each(format.styles, function(value, name) { + // Format doesn't match + if (editor.dom.getStyle(node, name) != value) { + state = false; + return false; + } + }); + + return state; + }; + + function applyListFormat() { + var list, dom = editor.dom, sel = editor.selection; + + // Check for existing list element + list = dom.getParent(sel.getNode(), 'ol,ul'); + + // Switch/add list type if needed + if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) + editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); + + // Append styles to new list element + if (format) { + list = dom.getParent(sel.getNode(), 'ol,ul'); + if (list) { + dom.setStyles(list, format.styles); + list.removeAttribute('data-mce-style'); + } + } + + editor.focus(); + }; + + btn = cm.createSplitButton(name, { + title : 'advanced.' + name + '_desc', + 'class' : 'mce_' + name, + onclick : function() { + applyListFormat(); + } + }); + + btn.onRenderMenu.add(function(btn, menu) { + menu.onHideMenu.add(function() { + if (t.bookmark) { + editor.selection.moveToBookmark(t.bookmark); + t.bookmark = 0; + } + }); + + menu.onShowMenu.add(function() { + var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; + + if (list || format) { + fmtList = t[name]; + + // Unselect existing items + each(menu.items, function(item) { + var state = true; + + item.setSelected(0); + + if (list && !item.isDisabled()) { + each(fmtList, function(fmt) { + if (fmt.id == item.id) { + if (!hasFormat(list, fmt)) { + state = false; + return false; + } + } + }); + + if (state) + item.setSelected(1); + } + }); + + // Select the current format + if (!list) + menu.items[format.id].setSelected(1); + } + + editor.focus(); + + // IE looses it's selection so store it away and restore it later + if (tinymce.isIE) { + t.bookmark = editor.selection.getBookmark(1); + } + }); + + menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1); + + each(t[name], function(item) { + // IE<8 doesn't support lower-greek, skip it + if (t.isIE7 && item.styles.listStyleType == 'lower-greek') + return; + + item.id = editor.dom.uniqueId(); + + menu.add({id : item.id, title : item.title, onclick : function() { + format = item; + applyListFormat(); + }}); + }); + }); + + return btn; + } + }, + + getInfo : function() { + return { + longname : 'Advanced lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js new file mode 100644 index 00000000..71d86bbe --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f>=2?f-2:0);a.setEnd(n,f>=1?f-1:0);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js new file mode 100644 index 00000000..5b61f7a2 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js @@ -0,0 +1,184 @@ +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AutolinkPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + + init : function(ed, url) { + var t = this; + + // Add a key down handler + ed.onKeyDown.addToTop(function(ed, e) { + if (e.keyCode == 13) + return t.handleEnter(ed); + }); + + // Internet Explorer has built-in automatic linking for most cases + if (tinyMCE.isIE) + return; + + ed.onKeyPress.add(function(ed, e) { + if (e.which == 41) + return t.handleEclipse(ed); + }); + + // Add a key up handler + ed.onKeyUp.add(function(ed, e) { + if (e.keyCode == 32) + return t.handleSpacebar(ed); + }); + }, + + handleEclipse : function(ed) { + this.parseCurrentLine(ed, -1, '(', true); + }, + + handleSpacebar : function(ed) { + this.parseCurrentLine(ed, 0, '', true); + }, + + handleEnter : function(ed) { + this.parseCurrentLine(ed, -1, '', false); + }, + + parseCurrentLine : function(ed, end_offset, delimiter, goback) { + var r, end, start, endContainer, bookmark, text, matches, prev, len; + + // We need at least five characters to form a URL, + // hence, at minimum, five characters from the beginning of the line. + r = ed.selection.getRng(true).cloneRange(); + if (r.startOffset < 5) { + // During testing, the caret is placed inbetween two text nodes. + // The previous text node contains the URL. + prev = r.endContainer.previousSibling; + if (prev == null) { + if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null) + return; + + prev = r.endContainer.firstChild.nextSibling; + } + len = prev.length; + r.setStart(prev, len); + r.setEnd(prev, len); + + if (r.endOffset < 5) + return; + + end = r.endOffset; + endContainer = prev; + } else { + endContainer = r.endContainer; + + // Get a text node + if (endContainer.nodeType != 3 && endContainer.firstChild) { + while (endContainer.nodeType != 3 && endContainer.firstChild) + endContainer = endContainer.firstChild; + + // Move range to text node + if (endContainer.nodeType == 3) { + r.setStart(endContainer, 0); + r.setEnd(endContainer, endContainer.nodeValue.length); + } + } + + if (r.endOffset == 1) + end = 2; + else + end = r.endOffset - 1 - end_offset; + } + + start = end; + + do + { + // Move the selection one character backwards. + r.setStart(endContainer, end >= 2 ? end - 2 : 0); + r.setEnd(endContainer, end >= 1 ? end - 1 : 0); + end -= 1; + + // Loop until one of the following is found: a blank space,  , delimeter, (end-2) >= 0 + } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter); + + if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + end += 1; + } else if (r.startOffset == 0) { + r.setStart(endContainer, 0); + r.setEnd(endContainer, start); + } + else { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + } + + // Exclude last . from word like "www.site.com." + var text = r.toString(); + if (text.charAt(text.length - 1) == '.') { + r.setEnd(endContainer, start - 1); + } + + text = r.toString(); + matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i); + + if (matches) { + if (matches[1] == 'www.') { + matches[1] = 'http://www.'; + } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { + matches[1] = 'mailto:' + matches[1]; + } + + bookmark = ed.selection.getBookmark(); + + ed.selection.setRng(r); + tinyMCE.execCommand('createlink',false, matches[1] + matches[2]); + ed.selection.moveToBookmark(bookmark); + ed.nodeChanged(); + + // TODO: Determine if this is still needed. + if (tinyMCE.isWebKit) { + // move the caret to its original position + ed.selection.collapse(false); + var max = Math.min(endContainer.length, start + 1); + r.setStart(endContainer, max); + r.setEnd(endContainer, max); + ed.selection.setRng(r); + } + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Autolink', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js new file mode 100644 index 00000000..46d9dc3d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js new file mode 100644 index 00000000..7673bcff --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js @@ -0,0 +1,119 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + /** + * Auto Resize + * + * This plugin automatically resizes the content area to fit its content height. + * It will retain a minimum height, which is the height of the content area when + * it's initialized. + */ + tinymce.create('tinymce.plugins.AutoResizePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + var t = this, oldSize = 0; + + if (ed.getParam('fullscreen_is_enabled')) + return; + + /** + * This method gets executed each time the editor needs to resize. + */ + function resize() { + var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; + + // Get height differently depending on the browser used + myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight); + + // Don't make it smaller than the minimum height + if (myHeight > t.autoresize_min_height) + resizeHeight = myHeight; + + // If a maximum height has been defined don't exceed this height + if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { + resizeHeight = t.autoresize_max_height; + body.style.overflowY = "auto"; + de.style.overflowY = "auto"; // Old IE + } else { + body.style.overflowY = "hidden"; + de.style.overflowY = "hidden"; // Old IE + body.scrollTop = 0; + } + + // Resize content element + if (resizeHeight !== oldSize) { + deltaSize = resizeHeight - oldSize; + DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); + oldSize = resizeHeight; + + // WebKit doesn't decrease the size of the body element until the iframe gets resized + // So we need to continue to resize the iframe down until the size gets fixed + if (tinymce.isWebKit && deltaSize < 0) + resize(); + } + }; + + t.editor = ed; + + // Define minimum height + t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight)); + + // Define maximum height + t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0)); + + // Add padding at the bottom for better UX + ed.onInit.add(function(ed){ + ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); + }); + + // Add appropriate listeners for resizing content area + ed.onChange.add(resize); + ed.onSetContent.add(resize); + ed.onPaste.add(resize); + ed.onKeyUp.add(resize); + ed.onPostRender.add(resize); + + if (ed.getParam('autoresize_on_init', true)) { + ed.onLoad.add(resize); + ed.onLoadContent.add(resize); + } + + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceAutoResize', resize); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto Resize', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js new file mode 100644 index 00000000..6da98ff3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js @@ -0,0 +1 @@ +(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){if(!i.removed){h.storeDraft();i.nodeChanged()}},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()]*>|]*>/gi, "").length > 0) { + // Show confirm dialog if the editor isn't empty + ed.windowManager.confirm( + PLUGIN_NAME + ".warning_message", + function(ok) { + if (ok) + self.restoreDraft(); + } + ); + } else + self.restoreDraft(); + } + }); + + // Enable/disable restoredraft button depending on if there is a draft stored or not + ed.onNodeChange.add(function() { + var controlManager = ed.controlManager; + + if (controlManager.get(RESTORE_DRAFT)) + controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft()); + }); + + ed.onInit.add(function() { + // Check if the user added the restore button, then setup auto storage logic + if (ed.controlManager.get(RESTORE_DRAFT)) { + // Setup storage engine + self.setupStorage(ed); + + // Auto save contents each interval time + setInterval(function() { + if (!ed.removed) { + self.storeDraft(); + ed.nodeChanged(); + } + }, settings.autosave_interval); + } + }); + + /** + * This event gets fired when a draft is stored to local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onStoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft is restored from local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRestoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft removed/expired. + * + * @event onRemoveDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRemoveDraft = new Dispatcher(self); + + // Add ask before unload dialog only add one unload handler + if (!unloadHandlerAdded) { + window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler; + unloadHandlerAdded = TRUE; + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + /** + * Returns an expiration date UTC string. + * + * @method getExpDate + * @return {String} Expiration date UTC string. + */ + getExpDate : function() { + return new Date( + new Date().getTime() + this.editor.settings.autosave_retention + ).toUTCString(); + }, + + /** + * This method will setup the storage engine. If the browser has support for it. + * + * @method setupStorage + */ + setupStorage : function(ed) { + var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; + + self.key = PLUGIN_NAME + ed.id; + + // Loop though each storage engine type until we find one that works + tinymce.each([ + function() { + // Try HTML5 Local Storage + if (localStorage) { + localStorage.setItem(testKey, testVal); + + if (localStorage.getItem(testKey) === testVal) { + localStorage.removeItem(testKey); + + return localStorage; + } + } + }, + + function() { + // Try HTML5 Session Storage + if (sessionStorage) { + sessionStorage.setItem(testKey, testVal); + + if (sessionStorage.getItem(testKey) === testVal) { + sessionStorage.removeItem(testKey); + + return sessionStorage; + } + } + }, + + function() { + // Try IE userData + if (tinymce.isIE) { + ed.getElement().style.behavior = "url('#default#userData')"; + + // Fake localStorage on old IE + return { + autoExpires : TRUE, + + setItem : function(key, value) { + var userDataElement = ed.getElement(); + + userDataElement.setAttribute(key, value); + userDataElement.expires = self.getExpDate(); + + try { + userDataElement.save("TinyMCE"); + } catch (e) { + // Ignore, saving might fail if "Userdata Persistence" is disabled in IE + } + }, + + getItem : function(key) { + var userDataElement = ed.getElement(); + + try { + userDataElement.load("TinyMCE"); + return userDataElement.getAttribute(key); + } catch (e) { + // Ignore, loading might fail if "Userdata Persistence" is disabled in IE + return null; + } + }, + + removeItem : function(key) { + ed.getElement().removeAttribute(key); + } + }; + } + }, + ], function(setup) { + // Try executing each function to find a suitable storage engine + try { + self.storage = setup(); + + if (self.storage) + return false; + } catch (e) { + // Ignore + } + }); + }, + + /** + * This method will store the current contents in the the storage engine. + * + * @method storeDraft + */ + storeDraft : function() { + var self = this, storage = self.storage, editor = self.editor, expires, content; + + // Is the contents dirty + if (storage) { + // If there is no existing key and the contents hasn't been changed since + // it's original value then there is no point in saving a draft + if (!storage.getItem(self.key) && !editor.isDirty()) + return; + + // Store contents if the contents if longer than the minlength of characters + content = editor.getContent({draft: true}); + if (content.length > editor.settings.autosave_minlength) { + expires = self.getExpDate(); + + // Store expiration date if needed IE userData has auto expire built in + if (!self.storage.autoExpires) + self.storage.setItem(self.key + "_expires", expires); + + self.storage.setItem(self.key, content); + self.onStoreDraft.dispatch(self, { + expires : expires, + content : content + }); + } + } + }, + + /** + * This method will restore the contents from the storage engine back to the editor. + * + * @method restoreDraft + */ + restoreDraft : function() { + var self = this, storage = self.storage, content; + + if (storage) { + content = storage.getItem(self.key); + + if (content) { + self.editor.setContent(content); + self.onRestoreDraft.dispatch(self, { + content : content + }); + } + } + }, + + /** + * This method will return true/false if there is a local storage draft available. + * + * @method hasDraft + * @return {boolean} true/false state if there is a local draft. + */ + hasDraft : function() { + var self = this, storage = self.storage, expDate, exists; + + if (storage) { + // Does the item exist at all + exists = !!storage.getItem(self.key); + if (exists) { + // Storage needs autoexpire + if (!self.storage.autoExpires) { + expDate = new Date(storage.getItem(self.key + "_expires")); + + // Contents hasn't expired + if (new Date().getTime() < expDate.getTime()) + return TRUE; + + // Remove it if it has + self.removeDraft(); + } else + return TRUE; + } + } + + return false; + }, + + /** + * Removes the currently stored draft. + * + * @method removeDraft + */ + removeDraft : function() { + var self = this, storage = self.storage, key = self.key, content; + + if (storage) { + // Get current contents and remove the existing draft + content = storage.getItem(key); + storage.removeItem(key); + storage.removeItem(key + "_expires"); + + // Dispatch remove event if we had any contents + if (content) { + self.onRemoveDraft.dispatch(self, { + content : content + }); + } + } + }, + + "static" : { + // Internal unload handler will be called before the page is unloaded + _beforeUnloadHandler : function(e) { + var msg; + + tinymce.each(tinyMCE.editors, function(ed) { + // Store a draft for each editor instance + if (ed.plugins.autosave) + ed.plugins.autosave.storeDraft(); + + // Never ask in fullscreen mode + if (ed.getParam("fullscreen_is_enabled")) + return; + + // Setup a return message if the editor is dirty + if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload")) + msg = ed.getLang("autosave.unload_msg"); + }); + + return msg; + } + } + }); + + tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave); +})(tinymce); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js new file mode 100644 index 00000000..fce6bd3e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n('en.autosave',{ +restore_content: "Restore auto-saved content", +warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" +}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js new file mode 100644 index 00000000..8f8821fd --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
            /gi,"\n");b(//gi,"\n");b(/
            /gi,"\n");b(/

            /gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
            ");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js new file mode 100644 index 00000000..4e7eb337 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -0,0 +1,120 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.BBCodePlugin', { + init : function(ed, url) { + var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t['_' + dialect + '_bbcode2html'](o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t['_' + dialect + '_bbcode2html'](o.content); + + if (o.get) + o.content = t['_' + dialect + '_html2bbcode'](o.content); + }); + }, + + getInfo : function() { + return { + longname : 'BBCode Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + // HTML -> BBCode in PunBB dialect + _punbb_html2bbcode : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: to [b] + rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); + rep(/(.*?)<\/font>/gi,"$1"); + rep(//gi,"[img]$1[/img]"); + rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); + rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); + rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); + rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); + rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); + rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); + rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); + rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); + rep(/<\/(strong|b)>/gi,"[/b]"); + rep(/<(strong|b)>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)>/gi,"[i]"); + rep(/<\/u>/gi,"[/u]"); + rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); + rep(//gi,"[u]"); + rep(/]*>/gi,"[quote]"); + rep(/<\/blockquote>/gi,"[/quote]"); + rep(/
            /gi,"\n"); + rep(//gi,"\n"); + rep(/
            /gi,"\n"); + rep(/

            /gi,""); + rep(/<\/p>/gi,"\n"); + rep(/ |\u00a0/gi," "); + rep(/"/gi,"\""); + rep(/</gi,"<"); + rep(/>/gi,">"); + rep(/&/gi,"&"); + + return s; + }, + + // BBCode -> HTML from PunBB dialect + _punbb_bbcode2html : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: [b] to + rep(/\n/gi,"
            "); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img\](.*?)\[\/img\]/gi,""); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); + + return s; + } + }); + + // Register plugin + tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100644 index 00000000..2ed042c3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(f){var i=this,g,d,j,e;i.editor=f;d=f.settings.contextmenu_never_use_native;i.onContextMenu=new tinymce.util.Dispatcher(this);e=function(k){h(f,k)};g=f.onContextMenu.add(function(k,l){if((j!==0?j:l.ctrlKey)&&!d){return}a.cancel(l);if(l.target.nodeName=="IMG"){k.selection.select(l.target)}i._getMenu(k).showMenu(l.clientX||l.pageX,l.clientY||l.pageY);a.add(k.getDoc(),"click",e);k.nodeChanged()});f.onRemove.add(function(){if(i._menu){i._menu.removeAll()}});function h(k,l){j=0;if(l&&l.button==2){j=l.ctrlKey;return}if(i._menu){i._menu.removeAll();i._menu.destroy();a.remove(k.getDoc(),"click",e);i._menu=null}}f.onMouseDown.add(h);f.onKeyDown.add(h);f.onKeyDown.add(function(k,l){if(l.shiftKey&&!l.ctrlKey&&!l.altKey&&l.keyCode===121){a.cancel(l);g(k,l)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 00000000..48b0fff9 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,163 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + /** + * This plugin a context menu to TinyMCE editor instances. + * + * @class tinymce.plugins.ContextMenu + */ + tinymce.create('tinymce.plugins.ContextMenu', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @method init + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed) { + var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu; + + t.editor = ed; + + contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; + + /** + * This event gets fired when the context menu is shown. + * + * @event onContextMenu + * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. + * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. + */ + t.onContextMenu = new tinymce.util.Dispatcher(this); + + hideMenu = function(e) { + hide(ed, e); + }; + + showMenu = ed.onContextMenu.add(function(ed, e) { + // Block TinyMCE menu on ctrlKey and work around Safari issue + if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) + return; + + Event.cancel(e); + + // Select the image if it's clicked. WebKit would other wise expand the selection + if (e.target.nodeName == 'IMG') + ed.selection.select(e.target); + + t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); + Event.add(ed.getDoc(), 'click', hideMenu); + + ed.nodeChanged(); + }); + + ed.onRemove.add(function() { + if (t._menu) + t._menu.removeAll(); + }); + + function hide(ed, e) { + realCtrlKey = 0; + + // Since the contextmenu event moves + // the selection we need to store it away + if (e && e.button == 2) { + realCtrlKey = e.ctrlKey; + return; + } + + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hideMenu); + t._menu = null; + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + ed.onKeyDown.add(function(ed, e) { + if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { + Event.cancel(e); + showMenu(ed, e); + } + }); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Contextmenu', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p = DOM.getPos(ed.getContentAreaContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1, + keyboard_focus: true + }); + + t._menu = m; + + m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); + m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); + m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + } + + m.addSeparator(); + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + + m.addSeparator(); + am = m.addMenu({title : 'contextmenu.align'}); + am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); + am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); + am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); + am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + } + }); + + // Register plugin + tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js new file mode 100644 index 00000000..90847e78 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js new file mode 100644 index 00000000..b1340141 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js @@ -0,0 +1,85 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Directionality', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + function setDir(dir) { + var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks(); + + if (blocks.length) { + curDir = dom.getAttrib(blocks[0], "dir"); + + tinymce.each(blocks, function(block) { + // Add dir to block if the parent block doesn't already have that dir + if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { + if (curDir != dir) { + dom.setAttrib(block, "dir", dir); + } else { + dom.setAttrib(block, "dir", null); + } + } + }); + + ed.nodeChanged(); + } + } + + ed.addCommand('mceDirectionLTR', function() { + setDir("ltr"); + }); + + ed.addCommand('mceDirectionRTL', function() { + setDir("rtl"); + }); + + ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); + ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); + + ed.onNodeChange.add(t._nodeChange, t); + }, + + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var dom = ed.dom, dir; + + n = dom.getParent(n, dom.isBlock); + if (!n) { + cm.setDisabled('ltr', 1); + cm.setDisabled('rtl', 1); + return; + } + + dir = dom.getAttrib(n, 'dir'); + cm.setActive('ltr', dir == "ltr"); + cm.setDisabled('ltr', 0); + cm.setActive('rtl', dir == "rtl"); + cm.setDisabled('rtl', 0); + } + }); + + // Register plugin + tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js new file mode 100644 index 00000000..dbdd8ffb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js @@ -0,0 +1 @@ +(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js new file mode 100644 index 00000000..71d54169 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js @@ -0,0 +1,43 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + tinymce.create('tinymce.plugins.EmotionsPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceEmotion', function() { + ed.windowManager.open({ + file : url + '/emotions.htm', + width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), + height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); + }, + + getInfo : function() { + return { + longname : 'Emotions', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); +})(tinymce); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm new file mode 100644 index 00000000..10135565 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm @@ -0,0 +1,42 @@ + + + + {#emotions_dlg.title} + + + + + +

            +
            {#emotions_dlg.title}:

            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            {#emotions_dlg.usage}
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif new file mode 100644 index 00000000..ba90cc36 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif new file mode 100644 index 00000000..74d897a4 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif new file mode 100644 index 00000000..963a96b8 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif new file mode 100644 index 00000000..c7cf1011 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif new file mode 100644 index 00000000..716f55e1 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif new file mode 100644 index 00000000..334d49e0 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif new file mode 100644 index 00000000..4efd549e Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif new file mode 100644 index 00000000..82c5b182 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif new file mode 100644 index 00000000..ca2451e1 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif new file mode 100644 index 00000000..fe66220c Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif new file mode 100644 index 00000000..fd27edfa Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif new file mode 100644 index 00000000..0cc9bb71 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif new file mode 100644 index 00000000..2075dc16 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif new file mode 100644 index 00000000..bef7e257 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif new file mode 100644 index 00000000..0631c761 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif new file mode 100644 index 00000000..648e6e87 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js new file mode 100644 index 00000000..b360f20b --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js @@ -0,0 +1,43 @@ +tinyMCEPopup.requireLangPack(); + +var EmotionsDialog = { + addKeyboardNavigation: function(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table"); + + settings ={ + root: "emoticon_table", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); + }, + init : function(ed) { + tinyMCEPopup.resizeToInnerSize(); + this.addKeyboardNavigation(); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { + src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, + alt : ed.getLang(title), + title : ed.getLang(title), + border : 0 + })); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js new file mode 100644 index 00000000..9ef427cb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.emotions_dlg',{cry:"Weinend",cool:"Cool",desc:"Smilies",title:"Smiley einf\u00fcgen",yell:"Br\u00fcllend",wink:"Zwinkernd",undecided:"Unentschlossen","tongue_out":"Zunge raus",surprised:"\u00dcberrascht",smile:"L\u00e4chelnd",sealed:"Verschlossen","money_mouth":"Geld",laughing:"Lachend",kiss:"K\u00fcssend",innocent:"Unschuldig",frown:"Stirnrunzelnd","foot_in_mouth":"Reingefallen",embarassed:"Verlegen",usage:"Navigation mit linken und rechten Pfeilen."}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js new file mode 100644 index 00000000..037c4b58 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm new file mode 100644 index 00000000..50b2b344 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm @@ -0,0 +1,22 @@ + + + + {#example_dlg.title} + + + + + +
            +

            Here is a example dialog.

            +

            Selected text:

            +

            Custom arg:

            + +
            + + +
            +
            + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js new file mode 100644 index 00000000..ec1f81ea --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js new file mode 100644 index 00000000..9a0e7da1 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js @@ -0,0 +1,84 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('example'); + + tinymce.create('tinymce.plugins.ExamplePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceExample', function() { + ed.windowManager.open({ + file : url + '/dialog.htm', + width : 320 + parseInt(ed.getLang('example.delta_width', 0)), + height : 120 + parseInt(ed.getLang('example.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('example', { + title : 'example.desc', + cmd : 'mceExample', + image : url + '/img/example.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('example', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif new file mode 100644 index 00000000..1ab5da44 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js new file mode 100644 index 00000000..fa834113 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js @@ -0,0 +1,19 @@ +tinyMCEPopup.requireLangPack(); + +var ExampleDialog = { + init : function() { + var f = document.forms[0]; + + // Get the selected contents as text and place it in the input + f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); + f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); + }, + + insert : function() { + // Insert the contents from the input into the document + tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js new file mode 100644 index 00000000..e0784f80 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js new file mode 100644 index 00000000..ebcf948d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js new file mode 100644 index 00000000..0a4551d3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js new file mode 100644 index 00000000..e1c55e41 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + + tinymce.create('tinymce.plugins.ExampleDependencyPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + }, + + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example Dependency plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency', + version : "1.0" + }; + } + }); + + /** + * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order. + * plugins in this list will be initialised when this plugin is initialized. (before the init method is called). + * plugins in a depends list should typically be specified using the short name). If neccesary this can be done + * with an object which has the url to the plugin and the shortname. + */ + tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css new file mode 100644 index 00000000..2675cec1 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css @@ -0,0 +1,143 @@ +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +#doctypes { + width: 200px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + +.panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js new file mode 100644 index 00000000..dcf76024 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype=""}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='\n'}f+=c.getParam("fullpage_default_doctype",'');f+="\n\n\n";if(e=c.getParam("fullpage_default_title")){f+=""+e+"\n"}if(e=c.getParam("fullpage_default_encoding")){f+='\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="\n\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js new file mode 100644 index 00000000..23de7c5a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -0,0 +1,405 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Node = tinymce.html.Node; + + tinymce.create('tinymce.plugins.FullPagePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullPageProperties', function() { + ed.windowManager.open({ + file : url + '/fullpage.htm', + width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), + height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + data : t._htmlToData() + }); + }); + + // Register buttons + ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); + + ed.onBeforeSetContent.add(t._setContent, t); + ed.onGetContent.add(t._getContent, t); + }, + + getInfo : function() { + return { + longname : 'Fullpage', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + _htmlToData : function() { + var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; + + function getAttr(elm, name) { + var value = elm.attr(name); + + return value || ''; + }; + + // Default some values + data.fontface = editor.getParam("fullpage_default_fontface", ""); + data.fontsize = editor.getParam("fullpage_default_fontsize", ""); + + // Parse XML PI + elm = headerFragment.firstChild; + if (elm.type == 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) + data.docencoding = matches[1]; + } + + // Parse doctype + elm = headerFragment.getAll('#doctype')[0]; + if (elm) + data.doctype = '"; + + // Parse title element + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.metatitle = elm.firstChild.value; + } + + // Parse meta elements + each(headerFragment.getAll('meta'), function(meta) { + var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; + + if (name) + data['meta' + name.toLowerCase()] = meta.attr('content'); + else if (httpEquiv == "Content-Type") { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + + if (matches) + data.docencoding = matches[1]; + } + }); + + // Parse html attribs + elm = headerFragment.getAll('html')[0]; + if (elm) + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + + // Parse stylesheet + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') + data.stylesheet = elm.attr('href'); + + // Parse body parts + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); + } + + return data; + }, + + _dataToHtml : function(data) { + var headerFragment, headElement, html, elm, value, dom = this.editor.dom; + + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + }; + + function addHeadNode(node) { + if (headElement.firstChild) + headElement.insert(node, headElement.firstChild); + else + headElement.append(node); + }; + + headerFragment = this._parseHeader(); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new Node('head', 1); + + if (elm.firstChild) + elm.insert(headElement, elm.firstChild, true); + else + elm.append(headElement); + } + + // Add/update/remove XML-PI + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + + if (data.docencoding) + value += ' encoding="' + data.docencoding + '"'; + + if (elm.type != 7) { + elm = new Node('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + + elm.value = value; + } else if (elm && elm.type == 7) + elm.remove(); + + // Add/update/remove doctype + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new Node('#doctype', 10); + + if (data.xml_pi) + headerFragment.insert(elm, headerFragment.firstChild); + else + addHeadNode(elm); + } + + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) + elm.remove(); + + // Add/update/remove title + elm = headerFragment.getAll('title')[0]; + if (data.metatitle) { + if (!elm) { + elm = new Node('title', 1); + elm.append(new Node('#text', 3)).value = data.metatitle; + addHeadNode(elm); + } + } + + // Add meta encoding + if (data.docencoding) { + elm = null; + each(headerFragment.getAll('meta'), function(meta) { + if (meta.attr('http-equiv') == 'Content-Type') + elm = meta; + }); + + if (!elm) { + elm = new Node('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + + elm.attr('content', 'text/html; charset=' + data.docencoding); + } + + // Add/update/remove meta + each('keywords,description,author,copyright,robots'.split(','), function(name) { + var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; + + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + + if (meta.attr('name') == name) { + if (value) + meta.attr('content', value); + else + meta.remove(); + + return; + } + } + + if (value) { + elm = new Node('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + + addHeadNode(elm); + } + }); + + // Add/update/delete link + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') { + if (data.stylesheet) + elm.attr('href', data.stylesheet); + else + elm.remove(); + } else if (data.stylesheet) { + elm = new Node('link', 1); + elm.attr({ + rel : 'stylesheet', + text : 'text/css', + href : data.stylesheet + }); + elm.shortEnded = true; + + addHeadNode(elm); + } + + // Update body attributes + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + + // Update iframe body as well + dom.setAttribs(this.editor.getBody(), { + style : data.style, + dir : data.dir, + vLink : data.visited_color, + link : data.link_color, + aLink : data.active_color + }); + } + + // Set html attributes + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + + // Serialize header fragment and crop away body part + html = new tinymce.html.Serializer({ + validate: false, + indent: true, + apply_source_formatting : true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + + this.head = html.substring(0, html.indexOf('')); + }, + + _parseHeader : function() { + // Parse the contents with a DOM parser + return new tinymce.html.DomParser({ + validate: false, + root_name: '#document' + }).parse(this.head); + }, + + _setContent : function(ed, o) { + var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; + + function low(s) { + return s.replace(/<\/?[A-Z]+/g, function(a) { + return a.toLowerCase(); + }) + }; + + // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate + if (o.format == 'raw' && self.head) + return; + + if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) + return; + + // Parse out head, body and footer + content = content.replace(/<(\/?)BODY/gi, '<$1body'); + startPos = content.indexOf('', startPos); + self.head = low(content.substring(0, startPos + 1)); + + endPos = content.indexOf('\n'; + + header += editor.getParam('fullpage_default_doctype', ''); + header += '\n\n\n'; + + if (value = editor.getParam('fullpage_default_title')) + header += '' + value + '\n'; + + if (value = editor.getParam('fullpage_default_encoding')) + header += '\n'; + + if (value = editor.getParam('fullpage_default_font_family')) + styles += 'font-family: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_font_size')) + styles += 'font-size: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_text_color')) + styles += 'color: ' + value + ';'; + + header += '\n\n'; + + return header; + }, + + _getContent : function(ed, o) { + var self = this; + + if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) + o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); + } + }); + + // Register plugin + tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm new file mode 100644 index 00000000..14ab8652 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm @@ -0,0 +1,259 @@ + + + + {#fullpage_dlg.title} + + + + + + + +
            + + +
            +
            +
            + {#fullpage_dlg.meta_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
             
             
             
             
             
              + +
            +
            + +
            + {#fullpage_dlg.langprops} + + + + + + + + + + + + + + + + + + + + + + +
            + +
              + +
             
            + +
             
            +
            +
            + +
            +
            + {#fullpage_dlg.appearance_textprops} + + + + + + + + + + + + + + + + +
            + +
            + +
            + + + + + +
             
            +
            +
            + +
            + {#fullpage_dlg.appearance_bgprops} + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            +
            + +
            + {#fullpage_dlg.appearance_marginprops} + + + + + + + + + + + + + + +
            +
            + +
            + {#fullpage_dlg.appearance_linkprops} + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
             
            +
            + + + + + +
             
            +
              
            +
            + +
            + {#fullpage_dlg.appearance_style} + + + + + + + + + + +
            + + + + +
             
            +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js new file mode 100644 index 00000000..3f672ad3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js @@ -0,0 +1,232 @@ +/** + * fullpage.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinyMCEPopup.requireLangPack(); + + var defaultDocTypes = + 'XHTML 1.0 Transitional=,' + + 'XHTML 1.0 Frameset=,' + + 'XHTML 1.0 Strict=,' + + 'XHTML 1.1=,' + + 'HTML 4.01 Transitional=,' + + 'HTML 4.01 Strict=,' + + 'HTML 4.01 Frameset='; + + var defaultEncodings = + 'Western european (iso-8859-1)=iso-8859-1,' + + 'Central European (iso-8859-2)=iso-8859-2,' + + 'Unicode (UTF-8)=utf-8,' + + 'Chinese traditional (Big5)=big5,' + + 'Cyrillic (iso-8859-5)=iso-8859-5,' + + 'Japanese (iso-2022-jp)=iso-2022-jp,' + + 'Greek (iso-8859-7)=iso-8859-7,' + + 'Korean (iso-2022-kr)=iso-2022-kr,' + + 'ASCII (us-ascii)=us-ascii'; + + var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; + var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; + + function setVal(id, value) { + var elm = document.getElementById(id); + + if (elm) { + value = value || ''; + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") + elm.checked = !!value; + else + elm.value = value; + } + }; + + function getVal(id) { + var elm = document.getElementById(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + }; + + window.FullPageDialog = { + changedStyle : function() { + var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); + + setVal('fontface', styles['font-face']); + setVal('fontsize', styles['font-size']); + setVal('textcolor', styles['color']); + + if (val = styles['background-image']) + setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); + else + setVal('bgimage', ''); + + setVal('bgcolor', styles['background-color']); + + // Reset margin form elements + setVal('topmargin', ''); + setVal('rightmargin', ''); + setVal('bottommargin', ''); + setVal('leftmargin', ''); + + // Expand margin + if (val = styles['margin']) { + val = val.split(' '); + styles['margin-top'] = val[0] || ''; + styles['margin-right'] = val[1] || val[0] || ''; + styles['margin-bottom'] = val[2] || val[0] || ''; + styles['margin-left'] = val[3] || val[0] || ''; + } + + if (val = styles['margin-top']) + setVal('topmargin', val.replace(/px/, '')); + + if (val = styles['margin-right']) + setVal('rightmargin', val.replace(/px/, '')); + + if (val = styles['margin-bottom']) + setVal('bottommargin', val.replace(/px/, '')); + + if (val = styles['margin-left']) + setVal('leftmargin', val.replace(/px/, '')); + + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('textcolor_pick', 'textcolor'); + }, + + changedStyleProp : function() { + var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); + + styles['font-face'] = getVal('fontface'); + styles['font-size'] = getVal('fontsize'); + styles['color'] = getVal('textcolor'); + styles['background-color'] = getVal('bgcolor'); + + if (val = getVal('bgimage')) + styles['background-image'] = "url('" + val + "')"; + else + styles['background-image'] = ''; + + delete styles['margin']; + + if (val = getVal('topmargin')) + styles['margin-top'] = val + "px"; + else + styles['margin-top'] = ''; + + if (val = getVal('rightmargin')) + styles['margin-right'] = val + "px"; + else + styles['margin-right'] = ''; + + if (val = getVal('bottommargin')) + styles['margin-bottom'] = val + "px"; + else + styles['margin-bottom'] = ''; + + if (val = getVal('leftmargin')) + styles['margin-left'] = val + "px"; + else + styles['margin-left'] = ''; + + // Serialize, parse and reserialize this will compress redundant styles + setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); + this.changedStyle(); + }, + + update : function() { + var data = {}; + + tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { + data[node.id] = getVal(node.id); + }); + + tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); + tinyMCEPopup.close(); + } + }; + + function init() { + var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; + + // Setup doctype select box + list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'doctype', item[0], item[1]); + } + + // Setup fonts select box + list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'fontface', item[0], item[1]); + } + + // Setup fontsize select box + list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); + for (i = 0; i < list.length; i++) + addSelectValue(form, 'fontsize', list[i], list[i]); + + // Setup encodings select box + list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'docencoding', item[0], item[1]); + } + + // Setup color pickers + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); + document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); + document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); + document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); + document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); + document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); + + // Resize some elements + if (isVisible('stylesheetbrowser')) + document.getElementById('stylesheet').style.width = '220px'; + + if (isVisible('link_href_browser')) + document.getElementById('element_link_href').style.width = '230px'; + + if (isVisible('bgimage_browser')) + document.getElementById('bgimage').style.width = '210px'; + + // Update form + tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { + setVal(key, value); + }); + + FullPageDialog.changedStyle(); + + // Update colors + updateColor('textcolor_pick', 'textcolor'); + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('visited_color_pick', 'visited_color'); + updateColor('active_color_pick', 'active_color'); + updateColor('link_color_pick', 'link_color'); + }; + + tinyMCEPopup.onInit.add(init); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js new file mode 100644 index 00000000..ecdff9ed --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.fullpage_dlg',{title:"Dokument-Eigenschaften","meta_tab":"Allgemein","appearance_tab":"Aussehen","advanced_tab":"Erweitert","meta_props":"Meta-Information",langprops:"Sprache und Codierung","meta_title":"Titel","meta_keywords":"Keywords","meta_description":"Beschreibung","meta_robots":"Robots",doctypes:"DocType",langcode:"Sprachcode",langdir:"Sprachrichtung",ltr:"Links nach Rechts",rtl:"Rechts nach Links","xml_pi":"XML Deklaration",encoding:"Zeichencodierung","appearance_bgprops":"Hintergrund-Eigenschaften","appearance_marginprops":"Abst\u00e4nde des Body","appearance_linkprops":"Linkfarben","appearance_textprops":"Text-Eigenschaften",bgcolor:"Hintergrundfarbe",bgimage:"Hintergrundbild","left_margin":"Linker Abstand","right_margin":"Rechter Abstand","top_margin":"Oberer Abstand","bottom_margin":"Unterer Abstand","text_color":"Textfarbe","font_size":"Schriftgr\u00f6\u00dfe","font_face":"Schriftart","link_color":"Linkfarbe","hover_color":"Hover-Farbe","visited_color":"Visited-Farbe","active_color":"Active-Farbe",textcolor:"Farbe",fontsize:"Schriftgr\u00f6\u00dfe",fontface:"Schriftart","meta_index_follow":"Indizieren und den Links folgen","meta_index_nofollow":"Indizieren, aber den Links nicht folgen","meta_noindex_follow":"Nicht indizieren, aber den Links folgen","meta_noindex_nofollow":"Nicht indizieren und auch nicht den Links folgen","appearance_style":"CSS-Stylesheet und Stileigenschaften",stylesheet:"CSS-Stylesheet",style:"CSS-Stil",author:"Autor",copyright:"Copyright",add:"Neues Element hinzuf\u00fcgen",remove:"Ausgew\u00e4hltes Element entfernen",moveup:"Ausgew\u00e4hltes Element nach oben bewegen",movedown:"Ausgew\u00e4hltes Element nach unten bewegen","head_elements":"\u00dcberschriftenelemente",info:"Information","add_title":"Titel-Element","add_meta":"Meta-Element","add_script":"Script-Element","add_style":"Style-Element","add_link":"Link-Element","add_base":"Base-Element","add_comment":"HTML-Kommentar","title_element":"Titel-Element","script_element":"Script-Element","style_element":"Style-Element","base_element":"Base-Element","link_element":"Link-Element","meta_element":"Meta_Element","comment_element":"Kommentar",src:"Src",language:"Sprache",href:"Href",target:"Ziel",type:"Typ",charset:"Zeichensatz",defer:"Defer",media:"Media",properties:"Eigenschaften",name:"Name",value:"Wert",content:"Inhalt",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"Allgemein","advanced_props":"Erweitert"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js new file mode 100644 index 00000000..516edc74 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.fullpage_dlg',{title:"Document Properties","meta_tab":"General","appearance_tab":"Appearance","advanced_tab":"Advanced","meta_props":"Meta Information",langprops:"Language and Encoding","meta_title":"Title","meta_keywords":"Keywords","meta_description":"Description","meta_robots":"Robots",doctypes:"Doctype",langcode:"Language Code",langdir:"Language Direction",ltr:"Left to Right",rtl:"Right to Left","xml_pi":"XML Declaration",encoding:"Character Encoding","appearance_bgprops":"Background Properties","appearance_marginprops":"Body Margins","appearance_linkprops":"Link Colors","appearance_textprops":"Text Properties",bgcolor:"Background Color",bgimage:"Background Image","left_margin":"Left Margin","right_margin":"Right Margin","top_margin":"Top Margin","bottom_margin":"Bottom Margin","text_color":"Text Color","font_size":"Font Size","font_face":"Font Face","link_color":"Link Color","hover_color":"Hover Color","visited_color":"Visited Color","active_color":"Active Color",textcolor:"Color",fontsize:"Font Size",fontface:"Font Family","meta_index_follow":"Index and Follow the Links","meta_index_nofollow":"Index and Don\'t Follow the Links","meta_noindex_follow":"Do Not Index but Follow the Links","meta_noindex_nofollow":"Do Not Index and Don\'t Follow the Links","appearance_style":"Stylesheet and Style Properties",stylesheet:"Stylesheet",style:"Style",author:"Author",copyright:"Copyright",add:"Add New Element",remove:"Remove Selected Element",moveup:"Move Selected Element Up",movedown:"Move Selected Element Down","head_elements":"Head Elements",info:"Information","add_title":"Title Element","add_meta":"Meta Element","add_script":"Script Element","add_style":"Style Element","add_link":"Link Element","add_base":"Base Element","add_comment":"Comment Node","title_element":"Title Element","script_element":"Script Element","style_element":"Style Element","base_element":"Base Element","link_element":"Link Element","meta_element":"Meta Element","comment_element":"Comment",src:"Source",language:"Language",href:"HREF",target:"Target",type:"Type",charset:"Charset",defer:"Defer",media:"Media",properties:"Properties",name:"Name",value:"Value",content:"Content",rel:"Rel",rev:"Rev",hreflang:"HREF Lang","general_props":"General","advanced_props":"Advanced"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js new file mode 100644 index 00000000..a2eb0348 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js new file mode 100644 index 00000000..524b487a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js @@ -0,0 +1,159 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.FullScreenPlugin', { + init : function(ed, url) { + var t = this, s = {}, vp, posCss; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullScreen', function() { + var win, de = DOM.doc.documentElement; + + if (ed.getParam('fullscreen_is_enabled')) { + if (ed.getParam('fullscreen_new_window')) + closeFullscreen(); // Call to close in new window + else { + DOM.win.setTimeout(function() { + tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); + tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent()); + tinyMCE.remove(ed); + DOM.remove('mce_fullscreen_container'); + de.style.overflow = ed.getParam('fullscreen_html_overflow'); + DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); + DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); + tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings + }, 10); + } + + return; + } + + if (ed.getParam('fullscreen_new_window')) { + win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); + try { + win.resizeTo(screen.availWidth, screen.availHeight); + } catch (e) { + // Ignore + } + } else { + tinyMCE.oldSettings = tinyMCE.settings; // Store old settings + s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; + s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); + vp = DOM.getViewPort(); + s.fullscreen_scrollx = vp.x; + s.fullscreen_scrolly = vp.y; + + // Fixes an Opera bug where the scrollbars doesn't reappear + if (tinymce.isOpera && s.fullscreen_overflow == 'visible') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where horizontal scrollbars would appear + if (tinymce.isIE && s.fullscreen_overflow == 'scroll') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where the scrollbars doesn't reappear + if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) + s.fullscreen_html_overflow = 'auto'; + + if (s.fullscreen_overflow == '0px') + s.fullscreen_overflow = ''; + + DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); + de.style.overflow = 'hidden'; //Fix for IE6/7 + vp = DOM.getViewPort(); + DOM.win.scrollTo(0, 0); + + if (tinymce.isIE) + vp.h -= 1; + + // Use fixed position if it exists + if (tinymce.isIE6 || document.compatMode == 'BackCompat') + posCss = 'absolute;top:' + vp.y; + else + posCss = 'fixed;top:0'; + + n = DOM.add(DOM.doc.body, 'div', { + id : 'mce_fullscreen_container', + style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); + DOM.add(n, 'div', {id : 'mce_fullscreen'}); + + tinymce.each(ed.settings, function(v, n) { + s[n] = v; + }); + + s.id = 'mce_fullscreen'; + s.width = n.clientWidth; + s.height = n.clientHeight - 15; + s.fullscreen_is_enabled = true; + s.fullscreen_editor_id = ed.id; + s.theme_advanced_resizing = false; + s.save_onsavecallback = function() { + ed.setContent(tinyMCE.get(s.id).getContent()); + ed.execCommand('mceSave'); + }; + + tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { + s[k] = v; + }); + + if (s.theme_advanced_toolbar_location === 'external') + s.theme_advanced_toolbar_location = 'top'; + + t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); + t.fullscreenEditor.onInit.add(function() { + t.fullscreenEditor.setContent(ed.getContent()); + t.fullscreenEditor.focus(); + }); + + t.fullscreenEditor.render(); + + t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); + t.fullscreenElement.update(); + //document.body.overflow = 'hidden'; + + t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { + var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; + + // Get outer/inner size to get a delta size that can be used to calc the new iframe size + outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]); + innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); + + fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); + }); + } + }); + + // Register buttons + ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); + }); + }, + + getInfo : function() { + return { + longname : 'Fullscreen', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm new file mode 100644 index 00000000..ffe528e4 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm @@ -0,0 +1,110 @@ + + + + + + + + + +
            + +
            + + + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js new file mode 100644 index 00000000..b2ce9279 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("grappelli");var e=tinymce.DOM;tinymce.create("tinymce.plugins.Grappelli",{init:function(t,n){var r=this;tb=t.getParam("grappelli_adv_toolbar","toolbar2");documentstructure_css=n+"../../../themes/advanced/skins/grappelli/content_documentstructure_"+t.settings.language+".css";cookie_date=new Date;var s=cookie_date.getFullYear();cookie_date.setYear(s+1);cookie_grappelli_show_documentstructure=tinymce.util.Cookie.get("grappelli_show_documentstructure");cookie_grappelli_show_documentstructure!=null?t.settings.grappelli_show_documentstructure=cookie_grappelli_show_documentstructure:tinymce.util.Cookie.set("grappelli_show_documentstructure",t.settings.grappelli_show_documentstructure,cookie_date,"/");t.onInit.add(function(){"mce_fullscreen"==t.id&&t.dom.addClass(t.dom.select("body"),"fullscreen");t.settings.grappelli_adv_hidden?r._hide_adv_menu(t):r._show_adv_menu(t);t.settings.grappelli_show_documentstructure=="on"?r._show_documentstructure(t):r._hide_documentstructure(t)});t.addCommand("Grappelli_Adv",function(){e.isHidden(t.controlManager.get(tb).id)?r._show_adv_menu(t):r._hide_adv_menu(t)});t.addCommand("Grappelli_DocumentStructure",function(){i=t.controlManager;t.settings.grappelli_show_documentstructure=="on"?r._hide_documentstructure(t):r._show_documentstructure(t)});t.addButton("grappelli_adv",{title:"grappelli.grappelli_adv_desc",cmd:"Grappelli_Adv"});t.addButton("grappelli_documentstructure",{title:"grappelli.grappelli_documentstructure_desc",cmd:"Grappelli_DocumentStructure"});t.onBeforeExecCommand.add(function(e,t,n,i){if("mceFullScreen"!=t)return;if("mce_fullscreen"==e.id){base_ed=tinyMCE.get(e.settings.fullscreen_editor_id);e.settings.grappelli_adv_hidden?r._hide_adv_menu(base_ed):r._show_adv_menu(base_ed);e.settings.grappelli_show_documentstructure=="on"?r._show_documentstructure(base_ed):r._hide_documentstructure(base_ed)}});t.addShortcut("alt+shift+z",t.getLang("grappelli_adv_desc"),"Grappelli_Adv")},_resizeIframe:function(t,n,r){var i=t.getContentAreaContainer().firstChild;e.setStyle(i,"height",i.clientHeight+r);t.theme.deltaHeight+=r},_show_documentstructure:function(e){head=e.getBody().previousSibling;var t=head.childNodes;for(var n=0;n= 0; i--) { + // c_cn = cn[i]; + // if (c_cn.nodeType == 3 || (!ed.dom.isBlock(c_cn) && c_cn.nodeType != 8)) { + // if (c_cn.nodeType != 3 || /[^\s]/g.test(c_cn.nodeValue)) { + // bl = ed.dom.create('p'); + // bl.appendChild(c_cn.cloneNode(1)); + // new_cn = c_cn.parentNode.replaceChild(bl, c_cn); + // // move caret + // r = ed.getDoc().createRange(); + // r.setStart(bl, bl.nodeValue ? bl.nodeValue.length : 0); + // r.setEnd(bl, bl.nodeValue ? bl.nodeValue.length : 0); + // ed.selection.setRng(r); + // } + // } + // } + // } + // }); + + }, + + // INTERNAL: RESIZE + _resizeIframe: function(ed, tb, b) { + var iframe = ed.getContentAreaContainer().firstChild; + DOM.setStyle(iframe, "height", iframe.clientHeight + b); + ed.theme.deltaHeight += b + }, + + // INTERNAL: SHOW/HIDE DOCUMENT STRUCTURE + _show_documentstructure: function(ed) { + head = ed.getBody().previousSibling; + var headChilds = head.childNodes; + + for (var i = 0; i < headChilds.length; i++) { + if (headChilds[i].nodeName == "LINK" + && headChilds[i].getAttribute('href') == documentstructure_css) { + // documentstructure_css is already set so... + return; + } + } + var vs_link = document.createElement("link"); + vs_link.rel="stylesheet"; + vs_link.mce_href = documentstructure_css; + vs_link.href = documentstructure_css; + head.appendChild(vs_link); + ed.settings.grappelli_show_documentstructure = 'on'; + tinymce.util.Cookie.set('grappelli_show_documentstructure', 'on', cookie_date, '/'); + ed.controlManager.setActive('grappelli_documentstructure', true); + }, + _hide_documentstructure: function(ed) { + head = ed.getBody().previousSibling; + vs_link = null; + + var headChilds = head.childNodes; + + for (var i = 0; i < headChilds.length; i++) { + if (headChilds[i].nodeName == "LINK" + && headChilds[i].getAttribute('href') == documentstructure_css) { + // found the node with documentstructure_css + vs_link = headChilds[i]; + break; + } + } + + if (vs_link !== null) { + // if we found the node with documentstructure_css, delete it + head.removeChild(vs_link); + ed.settings.grappelli_show_documentstructure = 'off'; + tinymce.util.Cookie.set('grappelli_show_documentstructure', 'off', cookie_date, '/'); + ed.controlManager.setActive('grappelli_documentstructure', false); + } + }, + + // INTERNAL: SHOW/HIDE ADVANCED MENU + _show_adv_menu: function(ed) { + if (ed.controlManager.get(tb, false)) { + ed.controlManager.setActive("grappelli_adv", 1); + DOM.show(ed.controlManager.get(tb).id); + this._resizeIframe(ed, tb, -28); + ed.settings.grappelli_adv_hidden = 0; + } + }, + _hide_adv_menu: function(ed) { + if (ed.controlManager.get(tb, false)) { + ed.controlManager.setActive("grappelli_adv", 0); + DOM.hide(ed.controlManager.get(tb).id); + this._resizeIframe(ed, tb, 28); + ed.settings.grappelli_adv_hidden = 1; + } + }, + + // GET INFO + getInfo: function() { + return { + longname: "Grappelli Plugin", + author: "vonautomatisch (patrick kranzlmueller)", + authorurl: "http://vonautomatisch.at", + infourl: "http://code.google.com/p/django-grappelli/", + version: "1.1" + } + } + + }); + + tinymce.PluginManager.add("grappelli", tinymce.plugins.Grappelli) + +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png new file mode 100644 index 00000000..466d68a3 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png new file mode 100644 index 00000000..3a6e6a9f Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/cs.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/cs.js new file mode 100644 index 00000000..95322fe4 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/cs.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("cs.grappelli",{ +grappelli_adv_desc:"Zobrazit/Skrýt pokročilé možnosti", +grappelli_documentstructure_desc:"Zobrazit/Skrýt strukturu dokumentu", +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js new file mode 100644 index 00000000..b72068c8 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("de.grappelli",{ +grappelli_adv_desc:"Erweitertes Menü anzeigen/verbergen", +grappelli_documentstructure_desc:"Dokumentenstruktur anzeigen/verbergen", +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js new file mode 100644 index 00000000..c2647680 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("en.grappelli",{ +grappelli_adv_desc:"Show/Hide Advanced Menu", +grappelli_documentstructure_desc:"Show/Hide Document Structure", +}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js new file mode 100644 index 00000000..bbcccac7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("fr.grappelli",{ +grappelli_adv_desc:"Basculer le menu avancé", +grappelli_documentstructure_desc:"Basculé la structure de document", +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js new file mode 100644 index 00000000..a34b0282 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("pl.grappelli",{ +grappelli_adv_desc:"Pokaż/Ukryj zaawansowane menu", +grappelli_documentstructure_desc:"Pokaż/Ukryj strukturę dokumentu" +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js new file mode 100644 index 00000000..6ecdf067 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("ru.grappelli",{ +grappelli_adv_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0435\u0020\u041c\u0435\u043d\u044e", +grappelli_documentstructure_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u0020\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430", +}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js new file mode 100644 index 00000000..17077ad5 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("grappelli_contextmenu");var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e);d.addCommand("mcePBefore",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");pe.parentNode.insertBefore(new_p,pe)}});d.addCommand("mcePAfter",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");d.dom.insertAfter(new_p,pe)}});d.addCommand("mcePBeforeRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");pe.parentNode.insertBefore(new_p,pe)}});d.addCommand("mcePAfterRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
            ");d.dom.insertAfter(new_p,pe)}});d.addCommand("mceDelete",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){d.dom.remove(pe)}});d.addCommand("mceDeleteRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){d.dom.remove(pe)}});d.addCommand("mceMoveUp",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){pre_prev=f._getPreviousSibling(pe);if(pre_prev){pre_prev.parentNode.insertBefore(pe,pre_prev)}}});d.addCommand("mceMoveUpRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){pre_prev=f._getPreviousSibling(pe);if(pre_prev){pre_prev.parentNode.insertBefore(pe,pre_prev)}}})},getInfo:function(){return{longname:"Grappelli (Contextmenu)",author:"Patrick Kranzlmueller",authorurl:"http://vonautomatisch.at",infourl:"http://code.google.com/p/django-grappelli/",version:"0.1"}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;pe=h.dom.getParent(d,function(m){nn=m.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return m}},h.dom.getRoot());re=h.dom.getParent(d,function(m){nn=m.nodeName;nn_p=m.parentNode.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"&&nn_p=="BODY"){return m}},h.dom.getRoot());title_prefix=pe.nodeName;title_prefix_root=re.nodeName;title_b_before="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpbefore_desc";title_b_after="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpafter_desc";title_b_before_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpbeforeroot_desc";title_b_after_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpafterroot_desc";title_b_delete="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_delete_desc";title_b_delete_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_deleteroot_desc";title_b_moveup="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_moveup_desc";title_b_moveup_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_moveuproot_desc";f.add({title:title_b_before,icon:"",cmd:"mcePBefore"});f.add({title:title_b_after,icon:"",cmd:"mcePAfter"});if(pe.parentNode.nodeName!="BODY"){f.addSeparator();f.add({title:title_b_before_root,icon:"",cmd:"mcePBeforeRoot"});f.add({title:title_b_after_root,icon:"",cmd:"mcePAfterRoot"})}f.addSeparator();f.add({title:title_b_delete,icon:"",cmd:"mceDelete"});if(pe.parentNode.nodeName!="BODY"){f.add({title:title_b_delete_root,icon:"",cmd:"mceDeleteRoot"})}f.addSeparator();f.add({title:title_b_moveup,icon:"",cmd:"mceMoveUp"});if(pe.parentNode.nodeName!="BODY"){f.add({title:title_b_moveup_root,icon:"",cmd:"mceMoveUpRoot"})}l.onContextMenu.dispatch(l,f,d,e);return f},_getPreviousSibling:function(e){var d=e.previousSibling;while(d&&(d.nodeType==document.TEXT_NODE||d.nodeType==document.CDATA_NODE)&&d.nodeValue.match(/^\s*$/)){d=d.previousSibling}return d}});tinymce.PluginManager.add("grappelli_contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js new file mode 100644 index 00000000..87b81d60 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js @@ -0,0 +1,250 @@ +(function() { + + tinymce.PluginManager.requireLangPack('grappelli_contextmenu'); + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.ContextMenu', { + init : function(ed) { + var t = this; + + t.editor = ed; + t.onContextMenu = new tinymce.util.Dispatcher(this); + + ed.onContextMenu.add(function(ed, e) { + if (!e.ctrlKey) { + t._getMenu(ed).showMenu(e.clientX, e.clientY); + Event.add(ed.getDoc(), 'click', hide); + Event.cancel(e); + } + }); + + function hide() { + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hide); + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + + // Register commands + // INSERT ELEMENTS + ed.addCommand('mcePBefore', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + pe.parentNode.insertBefore(new_p, pe); + } + }); + ed.addCommand('mcePAfter', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + ed.dom.insertAfter(new_p, pe); + } + }); + + // INSERT ROOT ELEMENTS + ed.addCommand('mcePBeforeRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + pe.parentNode.insertBefore(new_p, pe); + } + }); + ed.addCommand('mcePAfterRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
            '); + ed.dom.insertAfter(new_p, pe); + } + }); + + // DELETE + ed.addCommand('mceDelete', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + ed.dom.remove(pe); + } + }); + + ed.addCommand('mceDeleteRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + ed.dom.remove(pe); + } + }); + + // MOVE + ed.addCommand('mceMoveUp', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + pre_prev = t._getPreviousSibling(pe); + if (pre_prev) { + pre_prev.parentNode.insertBefore(pe, pre_prev); + } + } + }); + ed.addCommand('mceMoveUpRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + pre_prev = t._getPreviousSibling(pe); + if (pre_prev) { + pre_prev.parentNode.insertBefore(pe, pre_prev); + } + } + }); + + }, + + getInfo : function() { + return { + longname : 'Grappelli (Contextmenu)', + author : 'Patrick Kranzlmueller', + authorurl : 'http://vonautomatisch.at', + infourl : 'http://code.google.com/p/django-grappelli/', + version : '0.1' + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1 + }); + + t._menu = m; + + // parent element + pe = ed.dom.getParent(el, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + // root element + re = ed.dom.getParent(el, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE' && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + + title_prefix = pe.nodeName; + title_prefix_root = re.nodeName; + + title_b_before = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpbefore_desc'; + title_b_after = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpafter_desc'; + title_b_before_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpbeforeroot_desc'; + title_b_after_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpafterroot_desc'; + title_b_delete = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_delete_desc'; + title_b_delete_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_deleteroot_desc'; + title_b_moveup = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_moveup_desc'; + title_b_moveup_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_moveuproot_desc'; + + m.add({title : title_b_before, icon : '', cmd : 'mcePBefore'}); + m.add({title : title_b_after, icon : '', cmd : 'mcePAfter'}); + + if (pe.parentNode.nodeName != "BODY") { + m.addSeparator(); + m.add({title : title_b_before_root, icon : '', cmd : 'mcePBeforeRoot'}); + m.add({title : title_b_after_root, icon : '', cmd : 'mcePAfterRoot'}); + } + + m.addSeparator(); + m.add({title : title_b_delete, icon : '', cmd : 'mceDelete'}); + if (pe.parentNode.nodeName != "BODY") { + m.add({title : title_b_delete_root, icon : '', cmd : 'mceDeleteRoot'}); + } + + m.addSeparator(); + m.add({title : title_b_moveup, icon : '', cmd : 'mceMoveUp'}); + if (pe.parentNode.nodeName != "BODY") { + m.add({title : title_b_moveup_root, icon : '', cmd : 'mceMoveUpRoot'}); + } + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + + }, + + _getPreviousSibling: function(obj) { + var prevNode = obj.previousSibling; + while(prevNode && (prevNode.nodeType == document.TEXT_NODE || prevNode.nodeType == document.CDATA_NODE) && prevNode.nodeValue.match(/^\s*$/)) { + prevNode = prevNode.previousSibling; + } + return prevNode; + } + + }); + + // Register plugin + tinymce.PluginManager.add('grappelli_contextmenu', tinymce.plugins.ContextMenu); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/cs.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/cs.js new file mode 100644 index 00000000..8845bddd --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/cs.js @@ -0,0 +1,19 @@ +tinyMCE.addI18n("cs.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Vlož odstavec PŘED aktuální element", +grappelli_contextmenu_insertpafter_desc:"Vlož odstavec ZA aktuální element", +grappelli_contextmenu_insertpbeforeroot_desc:"Vlož odstavec PŘED aktuální KOŘENOVÝ element", +grappelli_contextmenu_insertpafterroot_desc:"Vlož odstavec ZA aktuální KOŘENOVÝ element", +grappelli_contextmenu_delete_desc:"Smazat aktuální element", +grappelli_contextmenu_deleteroot_desc:"Smazat aktuální KOŘENOVÝ element", +grappelli_contextmenu_moveup_desc:"Posunout element NAHORU", +grappelli_contextmenu_moveuproot_desc:"Posunout aktuální kořenový element NAHORU", + +P_grappelli_contextmenu_insertpbefore_desc:"Vlož odstavec PŘED aktuální element", +P_grappelli_contextmenu_insertpafter_desc:"Vlož odstavec ZA aktuální element", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Vlož odstavec PŘED aktuální KOŘENOVÝ element", +P_grappelli_contextmenu_insertpafterroot_desc:"Vlož odstavec ZA aktuální KOŘENOVÝ element", +P_grappelli_contextmenu_delete_desc:"Smazat aktuální element", +P_grappelli_contextmenu_deleteroot_desc:"Smazat aktuální KOŘENOVÝ element", +P_grappelli_contextmenu_moveup_desc:"Posunout element NAHORU", +P_grappelli_contextmenu_moveuproot_desc:"Posunout aktuální kořenový element NAHORU", +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js new file mode 100644 index 00000000..b4b6080f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("de.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Absatz VOR aktuellem ELEMENT einfügen", +grappelli_contextmenu_insertpafter_desc:"Absatz NACH aktuellen ELEMENT einfügen", +grappelli_contextmenu_insertpbeforeroot_desc:"Absatz VOR aktuellem HAUPTELEMENT einfügen", +grappelli_contextmenu_insertpafterroot_desc:"Absatz NACH aktuellen HAUPTELEMENT einfügen", +grappelli_contextmenu_delete_desc:"Aktuelles ELEMENT löschen", +grappelli_contextmenu_deleteroot_desc:"Aktuelles HAUPTELEMENT löschen", +grappelli_contextmenu_moveup_desc:"Aktuelles ELEMENT NACH OBEN verschieben", +grappelli_contextmenu_moveuproot_desc:"Aktuelles HAUPTELEMENT NACH OBEN verschieben", + +P_grappelli_contextmenu_insertpbefore_desc:"Absatz VOR Absatz einfügen", +P_grappelli_contextmenu_insertpafter_desc:"Absatz NACH Absatz einfügen", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Absatz VOR Template einfügen", +P_grappelli_contextmenu_insertpafterroot_desc:"Absatz NACH Template einfügen", +P_grappelli_contextmenu_delete_desc:"Absatz löschen", +P_grappelli_contextmenu_deleteroot_desc:"Template löschen", +P_grappelli_contextmenu_moveup_desc:"Absatz NACH OBEN verschieben", +P_grappelli_contextmenu_moveuproot_desc:"Template NACH OBEN verschieben", + +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js new file mode 100644 index 00000000..29de91b7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("en.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Insert Paragraph BEFORE current element", +grappelli_contextmenu_insertpafter_desc:"Insert Paragraph AFTER current element", +grappelli_contextmenu_insertpbeforeroot_desc:"Insert Paragraph BEFORE current ROOT-LEVEL element", +grappelli_contextmenu_insertpafterroot_desc:"Insert Paragraph AFTER current ROOT-LEVEL element", +grappelli_contextmenu_delete_desc:"Delete current element", +grappelli_contextmenu_deleteroot_desc:"Delete current ROOT-LEVEL element", +grappelli_contextmenu_moveup_desc:"MOVE UP current ELEMENT", +grappelli_contextmenu_moveuproot_desc:"MOVE UP current ROOT-LEVEL element", + +P_grappelli_contextmenu_insertpbefore_desc:"Insert Paragraph BEFORE current element", +P_grappelli_contextmenu_insertpafter_desc:"Insert Paragraph AFTER current element", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Insert Paragraph BEFORE current ROOT-LEVEL element", +P_grappelli_contextmenu_insertpafterroot_desc:"Insert Paragraph AFTER current ROOT-LEVEL element", +P_grappelli_contextmenu_delete_desc:"Delete current element", +P_grappelli_contextmenu_deleteroot_desc:"Delete current ROOT-LEVEL element", +P_grappelli_contextmenu_moveup_desc:"MOVE UP current ELEMENT", +P_grappelli_contextmenu_moveuproot_desc:"MOVE UP current ROOT-LEVEL element", + +}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js new file mode 100644 index 00000000..168e4b85 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js @@ -0,0 +1,10 @@ +tinyMCE.addI18n("fr.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Insérer Paragraph AVANT la sélection", +grappelli_contextmenu_insertpafter_desc:"Insérer Paragraph APRÈS la sélection", +grappelli_contextmenu_insertpbeforeroot_desc:"Insérer Paragraph AVANT la racine de la sélection", +grappelli_contextmenu_insertpafterroot_desc:"Insérer Paragraph APRÈS la racine de la sélection", +grappelli_contextmenu_delete_desc:"Supprimer la sélection", +grappelli_contextmenu_deleteroot_desc:"Supprimer la racine de la sélection", +grappelli_contextmenu_moveup_desc:"Monter la sélection", +grappelli_contextmenu_moveuproot_desc:"Monter la racine de la sélection", +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js new file mode 100644 index 00000000..0d90c7cf --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js @@ -0,0 +1,19 @@ +tinyMCE.addI18n("pl.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Wstaw paragraf PRZED aktualnym elementem", +grappelli_contextmenu_insertpafter_desc:"Wstaw paragraf PO aktualnym elemencie", +grappelli_contextmenu_insertpbeforeroot_desc:"Wstaw paragraf PRZED aktualnym BAZOWYM elementem", +grappelli_contextmenu_insertpafterroot_desc:"Wstaw paragraf PO aktualnym BAZOWYM elemencie", +grappelli_contextmenu_delete_desc:"Usuń aktualny element", +grappelli_contextmenu_deleteroot_desc:"Usuń aktualny BAZOWY element", +grappelli_contextmenu_moveup_desc:"PRZENIEŚ aktualny ELEMENT WYŻEJ", +grappelli_contextmenu_moveuproot_desc:"PRZENIEŚ aktualny BAZOWY element WYŻEJ", + +P_grappelli_contextmenu_insertpbefore_desc:"Wstaw paragraf PRZED aktualnym elementem", +P_grappelli_contextmenu_insertpafter_desc:"Wstaw paragraf PO aktualnym elemencie", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Wstaw paragraf PRZED aktualnym BAZOWYM elementem", +P_grappelli_contextmenu_insertpafterroot_desc:"Wstaw paragraf PO aktualnym BAZOWYM elemencie", +P_grappelli_contextmenu_delete_desc:"Usuń aktualny element", +P_grappelli_contextmenu_deleteroot_desc:"Usuń aktualny BAZOWY element", +P_grappelli_contextmenu_moveup_desc:"PRZENIEŚ aktualny ELEMENT WYŻEJ", +P_grappelli_contextmenu_moveuproot_desc:"PRZENIEŚ aktualny BAZOWY element WYŻEJ" +}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js new file mode 100644 index 00000000..c069407d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("ru.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +grappelli_contextmenu_insertpafter_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +grappelli_contextmenu_insertpbeforeroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u042b\u041c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +grappelli_contextmenu_insertpafterroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0413\u041e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +grappelli_contextmenu_delete_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +grappelli_contextmenu_deleteroot_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +grappelli_contextmenu_moveup_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u042d\u041b\u0415\u041c\u0415\u041d\u0422", +grappelli_contextmenu_moveuproot_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", + +P_grappelli_contextmenu_insertpbefore_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +P_grappelli_contextmenu_insertpafter_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +P_grappelli_contextmenu_insertpbeforeroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u042b\u041c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +P_grappelli_contextmenu_insertpafterroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0413\u041e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +P_grappelli_contextmenu_delete_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +P_grappelli_contextmenu_deleteroot_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +P_grappelli_contextmenu_moveup_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u042d\u041b\u0415\u041c\u0415\u041d\u0422", +P_grappelli_contextmenu_moveuproot_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", + +}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js new file mode 100644 index 00000000..e9cba106 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js new file mode 100644 index 00000000..1b2bb984 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.IESpell', { + init : function(ed, url) { + var t = this, sp; + + if (!tinymce.isIE) + return; + + t.editor = ed; + + // Register commands + ed.addCommand('mceIESpell', function() { + try { + sp = new ActiveXObject("ieSpell.ieSpellExtension"); + sp.CheckDocumentNode(ed.getDoc().documentElement); + } catch (e) { + if (e.number == -2146827859) { + ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { + if (s) + window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); + }); + } else + ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); + } + }); + + // Register buttons + ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); + }, + + getInfo : function() { + return { + longname : 'IESpell (IE Only)', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js new file mode 100644 index 00000000..8bb96f9c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","
            "));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js new file mode 100644 index 00000000..67123ca3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js @@ -0,0 +1,699 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; + + tinymce.create('tinymce.plugins.InlinePopups', { + init : function(ed, url) { + // Replace window manager + ed.onBeforeRenderUI.add(function() { + ed.windowManager = new tinymce.InlineWindowManager(ed); + DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); + }); + }, + + getInfo : function() { + return { + longname : 'InlinePopups', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { + InlineWindowManager : function(ed) { + var t = this; + + t.parent(ed); + t.zIndex = 300000; + t.count = 0; + t.windows = {}; + }, + + open : function(f, p) { + var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; + + f = f || {}; + p = p || {}; + + // Run native windows + if (!f.inline) + return t.parent(f, p); + + parentWindow = t._frontWindow(); + if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { + parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; + } + + // Only store selection if the type is a normal window + if (!f.type) + t.bookmark = ed.selection.getBookmark(1); + + id = DOM.uniqueId(); + vp = DOM.getViewPort(); + f.width = parseInt(f.width || 320); + f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); + f.min_width = parseInt(f.min_width || 150); + f.min_height = parseInt(f.min_height || 100); + f.max_width = parseInt(f.max_width || 2000); + f.max_height = parseInt(f.max_height || 2000); + f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); + f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); + f.movable = f.resizable = true; + p.mce_width = f.width; + p.mce_height = f.height; + p.mce_inline = true; + p.mce_window_id = id; + p.mce_auto_focus = f.auto_focus; + + // Transpose +// po = DOM.getPos(ed.getContainer()); +// f.left -= po.x; +// f.top -= po.y; + + t.features = f; + t.params = p; + t.onOpen.dispatch(t, f, p); + + if (f.type) { + opt += ' mceModal'; + + if (f.type) + opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); + + f.resizable = false; + } + + if (f.statusbar) + opt += ' mceStatusbar'; + + if (f.resizable) + opt += ' mceResizable'; + + if (f.minimizable) + opt += ' mceMinimizable'; + + if (f.maximizable) + opt += ' mceMaximizable'; + + if (f.movable) + opt += ' mceMovable'; + + // Create DOM objects + t._addAll(DOM.doc.body, + ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, + ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, + ['div', {id : id + '_top', 'class' : 'mceTop'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_title'}, f.title || ''] + ], + + ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, + ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], + ['span', {id : id + '_content'}], + ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] + ], + + ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_status'}, 'Content'] + ], + + ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], + ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] + ] + ] + ); + + DOM.setStyles(id, {top : -10000, left : -10000}); + + // Fix gecko rendering bug, where the editors iframe messed with window contents + if (tinymce.isGecko) + DOM.setStyle(id, 'overflow', 'auto'); + + // Measure borders + if (!f.type) { + dw += DOM.get(id + '_left').clientWidth; + dw += DOM.get(id + '_right').clientWidth; + dh += DOM.get(id + '_top').clientHeight; + dh += DOM.get(id + '_bottom').clientHeight; + } + + // Resize window + DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); + + u = f.url || f.file; + if (u) { + if (tinymce.relaxedDomain) + u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; + + u = tinymce._addVer(u); + } + + if (!f.type) { + DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); + DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); + DOM.setAttrib(id + '_ifr', 'src', u); + } else { + DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); + + if (f.type == 'confirm') + DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); + + DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); + DOM.setHTML(id + '_content', f.content.replace('\n', '
            ')); + + Event.add(id, 'keyup', function(evt) { + var VK_ESCAPE = 27; + if (evt.keyCode === VK_ESCAPE) { + f.button_func(false); + return Event.cancel(evt); + } + }); + + Event.add(id, 'keydown', function(evt) { + var cancelButton, VK_TAB = 9; + if (evt.keyCode === VK_TAB) { + cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; + if (cancelButton && cancelButton !== evt.target) { + cancelButton.focus(); + } else { + DOM.get(id + '_ok').focus(); + } + return Event.cancel(evt); + } + }); + } + + // Register events + mdf = Event.add(id, 'mousedown', function(e) { + var n = e.target, w, vp; + + w = t.windows[id]; + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + if (n.className == 'mceClose') { + t.close(null, id); + return Event.cancel(e); + } else if (n.className == 'mceMax') { + w.oldPos = w.element.getXY(); + w.oldSize = w.element.getSize(); + + vp = DOM.getViewPort(); + + // Reduce viewport size to avoid scrollbars + vp.w -= 2; + vp.h -= 2; + + w.element.moveTo(vp.x, vp.y); + w.element.resizeTo(vp.w, vp.h); + DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); + DOM.addClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMed') { + // Reset to old size + w.element.moveTo(w.oldPos.x, w.oldPos.y); + w.element.resizeTo(w.oldSize.w, w.oldSize.h); + w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); + + DOM.removeClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMove') + return t._startDrag(id, e, n.className); + else if (DOM.hasClass(n, 'mceResize')) + return t._startDrag(id, e, n.className.substring(13)); + } + }); + + clf = Event.add(id, 'click', function(e) { + var n = e.target; + + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + switch (n.className) { + case 'mceClose': + t.close(null, id); + return Event.cancel(e); + + case 'mceButton mceOk': + case 'mceButton mceCancel': + f.button_func(n.className == 'mceButton mceOk'); + return Event.cancel(e); + } + } + }); + + // Make sure the tab order loops within the dialog. + Event.add([id + '_left', id + '_right'], 'focus', function(evt) { + var iframe = DOM.get(id + '_ifr'); + if (iframe) { + var body = iframe.contentWindow.document.body; + var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); + if (evt.target.id === (id + '_left')) { + focusable[focusable.length - 1].focus(); + } else { + focusable[0].focus(); + } + } else { + DOM.get(id + '_ok').focus(); + } + }); + + // Add window + w = t.windows[id] = { + id : id, + mousedown_func : mdf, + click_func : clf, + element : new Element(id, {blocker : 1, container : ed.getContainer()}), + iframeElement : new Element(id + '_ifr'), + features : f, + deltaWidth : dw, + deltaHeight : dh + }; + + w.iframeElement.on('focus', function() { + t.focus(id); + }); + + // Setup blocker + if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { + DOM.add(DOM.doc.body, 'div', { + id : 'mceModalBlocker', + 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', + style : {zIndex : t.zIndex - 1} + }); + + DOM.show('mceModalBlocker'); // Reduces flicker in IE + DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); + } else + DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); + + if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) + DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); + + DOM.setAttrib(id, 'aria-hidden', 'false'); + t.focus(id); + t._fixIELayout(id, 1); + + // Focus ok button + if (DOM.get(id + '_ok')) + DOM.get(id + '_ok').focus(); + t.count++; + + return w; + }, + + focus : function(id) { + var t = this, w; + + if (w = t.windows[id]) { + w.zIndex = this.zIndex++; + w.element.setStyle('zIndex', w.zIndex); + w.element.update(); + + id = id + '_wrapper'; + DOM.removeClass(t.lastId, 'mceFocus'); + DOM.addClass(id, 'mceFocus'); + t.lastId = id; + + if (w.focussedElement) { + w.focussedElement.focus(); + } else if (DOM.get(id + '_ok')) { + DOM.get(w.id + '_ok').focus(); + } else if (DOM.get(w.id + '_ifr')) { + DOM.get(w.id + '_ifr').focus(); + } + } + }, + + _addAll : function(te, ne) { + var i, n, t = this, dom = tinymce.DOM; + + if (is(ne, 'string')) + te.appendChild(dom.doc.createTextNode(ne)); + else if (ne.length) { + te = te.appendChild(dom.create(ne[0], ne[1])); + + for (i=2; i ix) { + fw = w; + ix = w.zIndex; + } + }); + return fw; + }, + + setTitle : function(w, ti) { + var e; + + w = this._findId(w); + + if (e = DOM.get(w + '_title')) + e.innerHTML = DOM.encode(ti); + }, + + alert : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'alert', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + confirm : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'confirm', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + // Internal functions + + _findId : function(w) { + var t = this; + + if (typeof(w) == 'string') + return w; + + each(t.windows, function(wo) { + var ifr = DOM.get(wo.id + '_ifr'); + + if (ifr && w == ifr.contentWindow) { + w = wo.id; + return false; + } + }); + + return w; + }, + + _fixIELayout : function(id, s) { + var w, img; + + if (!tinymce.isIE6) + return; + + // Fixes the bug where hover flickers and does odd things in IE6 + each(['n','s','w','e','nw','ne','sw','se'], function(v) { + var e = DOM.get(id + '_resize_' + v); + + DOM.setStyles(e, { + width : s ? e.clientWidth : '', + height : s ? e.clientHeight : '', + cursor : DOM.getStyle(e, 'cursor', 1) + }); + + DOM.setStyle(id + "_bottom", 'bottom', '-1px'); + + e = 0; + }); + + // Fixes graphics glitch + if (w = this.windows[id]) { + // Fixes rendering bug after resize + w.element.hide(); + w.element.show(); + + // Forced a repaint of the window + //DOM.get(id).style.filter = ''; + + // IE has a bug where images used in CSS won't get loaded + // sometimes when the cache in the browser is disabled + // This fix tries to solve it by loading the images using the image object + each(DOM.select('div,a', id), function(e, i) { + if (e.currentStyle.backgroundImage != 'none') { + img = new Image(); + img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); + } + }); + + DOM.get(id).style.filter = ''; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); +})(); + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif new file mode 100644 index 00000000..21913985 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif new file mode 100644 index 00000000..f957e49a Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif new file mode 100644 index 00000000..6baf64ad Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif new file mode 100644 index 00000000..20acbbf7 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif new file mode 100644 index 00000000..d5de1cc2 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif new file mode 100644 index 00000000..c2a2ad45 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif new file mode 100644 index 00000000..0b4cc368 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css new file mode 100644 index 00000000..a50d4fc5 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -0,0 +1,90 @@ +/* Clearlooks 2 */ + +/* Reset */ +.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} + +/* General */ +.clearlooks2 {position:absolute; direction:ltr} +.clearlooks2 .mceWrapper {position:static} +.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} +.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} +.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} + +/* Top */ +.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} +.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} +.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} +.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} +.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} +.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} +.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} +.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} +.clearlooks2 .mceFocus .mceTop span {color:#FFF} + +/* Middle */ +.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} +.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} +.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} +.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} +.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} + +/* Bottom */ +.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} +.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} +.clearlooks2 .mceBottom div {top:0} +.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} +.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} +.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} +.clearlooks2 .mceBottom span {display:none} +.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} +.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} +.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} +.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} +.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} + +/* Actions */ +.clearlooks2 a {width:29px; height:16px; top:3px;} +.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} +.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} +.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} +.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} +.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} +.clearlooks2 .mceMovable .mceMove {display:block} +.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} +.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} +.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} +.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} +.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} +.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} + +/* Resize */ +.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} +.clearlooks2 .mceResizable .mceResize {display:block} +.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} +.clearlooks2 .mceMinimizable .mceMin {display:block} +.clearlooks2 .mceMaximizable .mceMax {display:block} +.clearlooks2 .mceMaximized .mceMed {display:block} +.clearlooks2 .mceMaximized .mceMax {display:none} +.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} +.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} +.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} +.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} +.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} +.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} +.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} +.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} + +/* Alert/Confirm */ +.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} +.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} +.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} +.clearlooks2 a:hover {font-weight:bold;} +.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} +.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} +.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} +.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} +.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} +.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm new file mode 100644 index 00000000..f9ec6421 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm @@ -0,0 +1,387 @@ + + + +Template for dialogs + + + + +
            +
            +
            +
            +
            +
            +
            + Blured +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Focused +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Statusbar +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Statusbar, Resizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Resizable, Maximizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Blurred, Maximizable, Statusbar, Resizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Maximized, Maximizable, Minimizable +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Blured +
            + +
            +
            + Content +
            +
            + +
            +
            +
            +
            + Statusbar text. +
            + + + + + + + + + + + + + + +
            +
            + +
            +
            +
            +
            +
            +
            + Alert +
            + +
            +
            + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
            +
            +
            + +
            +
            +
            +
            +
            + + + Ok + +
            +
            + +
            +
            +
            +
            +
            +
            + Confirm +
            + +
            +
            + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
            +
            +
            + +
            +
            +
            +
            +
            + + + Ok + Cancel + +
            +
            +
            + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js new file mode 100644 index 00000000..938ce6b1 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;gh[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js new file mode 100644 index 00000000..daed2806 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js @@ -0,0 +1,262 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + function findParentLayer(node) { + do { + if (node.className && node.className.indexOf('mceItemLayer') != -1) { + return node; + } + } while (node = node.parentNode); + }; + + tinymce.create('tinymce.plugins.Layer', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceInsertLayer', t._insertLayer, t); + + ed.addCommand('mceMoveForward', function() { + t._move(1); + }); + + ed.addCommand('mceMoveBackward', function() { + t._move(-1); + }); + + ed.addCommand('mceMakeAbsolute', function() { + t._toggleAbsolute(); + }); + + // Register buttons + ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); + ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); + ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); + ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); + + ed.onInit.add(function() { + var dom = ed.dom; + + if (tinymce.isIE) + ed.getDoc().execCommand('2D-Position', false, true); + }); + + // Remove serialized styles when selecting a layer since it might be changed by a drag operation + ed.onMouseUp.add(function(ed, e) { + var layer = findParentLayer(e.target); + + if (layer) { + ed.dom.setAttrib(layer, 'data-mce-style', ''); + } + }); + + // Fixes edit focus issues with layers on Gecko + // This will enable designMode while inside a layer and disable it when outside + ed.onMouseDown.add(function(ed, e) { + var node = e.target, doc = ed.getDoc(), parent; + + if (tinymce.isGecko) { + if (findParentLayer(node)) { + if (doc.designMode !== 'on') { + doc.designMode = 'on'; + + // Repaint caret + node = doc.body; + parent = node.parentNode; + parent.removeChild(node); + parent.appendChild(node); + } + } else if (doc.designMode == 'on') { + doc.designMode = 'off'; + } + } + }); + + ed.onNodeChange.add(t._nodeChange, t); + ed.onVisualAid.add(t._visualAid, t); + }, + + getInfo : function() { + return { + longname : 'Layer', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var le, p; + + le = this._getParentLayer(n); + p = ed.dom.getParent(n, 'DIV,P,IMG'); + + if (!p) { + cm.setDisabled('absolute', 1); + cm.setDisabled('moveforward', 1); + cm.setDisabled('movebackward', 1); + } else { + cm.setDisabled('absolute', 0); + cm.setDisabled('moveforward', !le); + cm.setDisabled('movebackward', !le); + cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); + } + }, + + // Private methods + + _visualAid : function(ed, e, s) { + var dom = ed.dom; + + tinymce.each(dom.select('div,p', e), function(e) { + if (/^(absolute|relative|fixed)$/i.test(e.style.position)) { + if (s) + dom.addClass(e, 'mceItemVisualAid'); + else + dom.removeClass(e, 'mceItemVisualAid'); + + dom.addClass(e, 'mceItemLayer'); + } + }); + }, + + _move : function(d) { + var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; + + nl = []; + tinymce.walk(ed.getBody(), function(n) { + if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) + nl.push(n); + }, 'childNodes'); + + // Find z-indexes + for (i=0; i -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else { + if (z[ci] > 0) + nl[ci].style.zIndex = z[ci] - 1; + } + } else { + // Move forward + + // Try find a higher one + for (i=0; i z[ci]) { + fi = i; + break; + } + } + + if (fi > -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else + nl[ci].style.zIndex = z[ci] + 1; + } + + ed.execCommand('mceRepaint'); + }, + + _getParentLayer : function(n) { + return this.editor.dom.getParent(n, function(n) { + return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); + }); + }, + + _insertLayer : function() { + var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody(); + + ed.dom.add(body, 'div', { + style : { + position : 'absolute', + left : p.x, + top : (p.y > 20 ? p.y : 20), + width : 100, + height : 100 + }, + 'class' : 'mceItemVisualAid mceItemLayer' + }, ed.selection.getContent() || ed.getLang('layer.content')); + + // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 + if (tinymce.isIE) + dom.setHTML(body, body.innerHTML); + }, + + _toggleAbsolute : function() { + var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); + + if (!le) + le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); + + if (le) { + if (le.style.position.toLowerCase() == "absolute") { + ed.dom.setStyles(le, { + position : '', + left : '', + top : '', + width : '', + height : '' + }); + + ed.dom.removeClass(le, 'mceItemVisualAid'); + ed.dom.removeClass(le, 'mceItemLayer'); + } else { + if (le.style.left == "") + le.style.left = 20 + 'px'; + + if (le.style.top == "") + le.style.top = 20 + 'px'; + + if (le.style.width == "") + le.style.width = le.width ? (le.width + 'px') : '100px'; + + if (le.style.height == "") + le.style.height = le.height ? (le.height + 'px') : '100px'; + + le.style.position = "absolute"; + + ed.dom.setAttrib(le, 'data-mce-style', ''); + ed.addVisual(ed.getBody()); + } + + ed.execCommand('mceRepaint'); + ed.nodeChanged(); + } + } + }); + + // Register plugin + tinymce.PluginManager.add('layer', tinymce.plugins.Layer); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js new file mode 100644 index 00000000..2ed5f41a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js @@ -0,0 +1 @@ +(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js new file mode 100644 index 00000000..3cdcde57 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js @@ -0,0 +1,139 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + * + * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align + * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash + * + * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are + * not apart of the newer specifications for HTML and XHTML. + */ + +(function(tinymce) { + // Override inline_styles setting to force TinyMCE to produce deprecated contents + tinymce.onAddEditor.addToTop(function(tinymce, editor) { + editor.settings.inline_styles = false; + }); + + // Create the legacy ouput plugin + tinymce.create('tinymce.plugins.LegacyOutput', { + init : function(editor) { + editor.onInit.add(function() { + var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', + fontSizes = tinymce.explode(editor.settings.font_size_style_values), + schema = editor.schema; + + // Override some internal formats to produce legacy elements and attributes + editor.formatter.register({ + // Change alignment formats to use the deprecated align attribute + alignleft : {selector : alignElements, attributes : {align : 'left'}}, + aligncenter : {selector : alignElements, attributes : {align : 'center'}}, + alignright : {selector : alignElements, attributes : {align : 'right'}}, + alignfull : {selector : alignElements, attributes : {align : 'justify'}}, + + // Change the basic formatting elements to use deprecated element types + bold : [ + {inline : 'b', remove : 'all'}, + {inline : 'strong', remove : 'all'}, + {inline : 'span', styles : {fontWeight : 'bold'}} + ], + italic : [ + {inline : 'i', remove : 'all'}, + {inline : 'em', remove : 'all'}, + {inline : 'span', styles : {fontStyle : 'italic'}} + ], + underline : [ + {inline : 'u', remove : 'all'}, + {inline : 'span', styles : {textDecoration : 'underline'}, exact : true} + ], + strikethrough : [ + {inline : 'strike', remove : 'all'}, + {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true} + ], + + // Change font size and font family to use the deprecated font element + fontname : {inline : 'font', attributes : {face : '%value'}}, + fontsize : { + inline : 'font', + attributes : { + size : function(vars) { + return tinymce.inArray(fontSizes, vars.value) + 1; + } + } + }, + + // Setup font elements for colors as well + forecolor : {inline : 'font', attributes : {color : '%value'}}, + hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} + }); + + // Check that deprecated elements are allowed if not add them + tinymce.each('b,i,u,strike'.split(','), function(name) { + schema.addValidElements(name + '[*]'); + }); + + // Add font element if it's missing + if (!schema.getElementRule("font")) + schema.addValidElements("font[face|size|color|style]"); + + // Add the missing and depreacted align attribute for the serialization engine + tinymce.each(alignElements.split(','), function(name) { + var rule = schema.getElementRule(name), found; + + if (rule) { + if (!rule.attributes.align) { + rule.attributes.align = {}; + rule.attributesOrder.push('align'); + } + } + }); + + // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes + editor.onNodeChange.add(function(editor, control_manager) { + var control, fontElm, fontName, fontSize; + + // Find font element get it's name and size + fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); + if (fontElm) { + fontName = fontElm.face; + fontSize = fontElm.size; + } + + // Select/unselect the font name in droplist + if (control = control_manager.get('fontselect')) { + control.select(function(value) { + return value == fontName; + }); + } + + // Select/unselect the font size in droplist + if (control = control_manager.get('fontsizeselect')) { + control.select(function(value) { + var index = tinymce.inArray(fontSizes, value.fontSize); + + return index + 1 == fontSize; + }); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'LegacyOutput', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); +})(tinymce); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js new file mode 100644 index 00000000..ec21b256 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js @@ -0,0 +1 @@ +(function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{return v&&u.tagName==="P"&&t.tagName==="P"}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(y){var v="TABBING";var s="EMPTY";var J="ESCAPE";var z="PARAGRAPH";var N="UNKNOWN";var x=N;function E(U){return U.keyCode===tinymce.VK.TAB&&!(U.altKey||U.ctrlKey)&&(y.queryCommandState("InsertUnorderedList")||y.queryCommandState("InsertOrderedList"))}function w(){var U=B();var W=U.parentNode.parentNode;var V=U.parentNode.lastChild===U;return V&&!t(W)&&P(U)}function t(U){if(n(U)){return U.parentNode&&U.parentNode.tagName==="LI"}else{return U.tagName==="LI"}}function F(){return y.selection.isCollapsed()&&P(B())}function B(){var U=y.selection.getStart();return((U.tagName=="BR"||U.tagName=="")&&U.parentNode.tagName=="LI")?U.parentNode:U}function P(U){var V=U.childNodes.length;if(U.tagName==="LI"){return V==0?true:V==1&&(U.firstChild.tagName==""||U.firstChild.tagName=="BR"||H(U))}return false}function H(U){var V=tinymce.grep(U.parentNode.childNodes,function(Y){return Y.tagName=="LI"});var W=U==V[V.length-1];var X=U.firstChild;return tinymce.isIE9&&W&&(X.nodeValue==String.fromCharCode(160)||X.nodeValue==String.fromCharCode(32))}function T(U){return U.keyCode===tinymce.VK.ENTER}function A(U){return T(U)&&!U.shiftKey}function M(U){if(E(U)){return v}else{if(A(U)&&w()){return N}else{if(A(U)&&F()){return s}else{return N}}}}function D(U,V){if(x==v||x==s||tinymce.isGecko&&x==J){r.cancel(V)}}function C(){var U=y.selection.getRng(true);var V=U.startContainer;if(V.nodeType==3){var W=V.nodeValue;if(tinymce.isIE9&&W.length>1&&W.charCodeAt(W.length-1)==32){return(U.endOffset==W.length-1)}else{return(U.endOffset==W.length)}}else{if(V.nodeType==1){return U.endOffset==V.childNodes.length}}return false}function I(){var W=y.selection.getNode();var V="h1,h2,h3,h4,h5,h6,p,div";var U=y.dom.is(W,V)&&W.parentNode.tagName==="LI"&&W.parentNode.lastChild===W;return y.selection.isCollapsed()&&U&&C()}function K(W,Y){if(A(Y)&&I()){var X=W.selection.getNode();var V=W.dom.create("li");var U=W.dom.getParent(X,"li");W.dom.insertAfter(V,U);if(tinymce.isIE6||tinymce.isIE7||tinyMCE.isIE8){W.selection.setCursorLocation(V,1)}else{W.selection.setCursorLocation(V,0)}Y.preventDefault()}}function u(X,Z){var ac;if(!tinymce.isGecko){return}var V=X.selection.getStart();if(Z.keyCode!=tinymce.VK.BACKSPACE||V.tagName!=="IMG"){return}function W(ag){var ah=ag.firstChild;var af=null;do{if(!ah){break}if(ah.tagName==="LI"){af=ah}}while(ah=ah.nextSibling);return af}function ae(ag,af){while(ag.childNodes.length>0){af.appendChild(ag.childNodes[0])}}ac=V.parentNode.previousSibling;if(!ac){return}var aa;if(ac.tagName==="UL"||ac.tagName==="OL"){aa=ac}else{if(ac.previousSibling&&(ac.previousSibling.tagName==="UL"||ac.previousSibling.tagName==="OL")){aa=ac.previousSibling}else{return}}var ad=W(aa);var U=X.dom.createRng();U.setStart(ad,1);U.setEnd(ad,1);X.selection.setRng(U);X.selection.collapse(true);var Y=X.selection.getBookmark();var ab=V.parentNode.cloneNode(true);if(ab.tagName==="P"||ab.tagName==="DIV"){ae(ab,ad)}else{ad.appendChild(ab)}V.parentNode.parentNode.removeChild(V.parentNode);X.selection.moveToBookmark(Y)}function G(U){var V=y.dom.getParent(U,"ol,ul");if(V!=null){var W=V.lastChild;y.selection.setCursorLocation(W,0)}}this.ed=y;y.addCommand("Indent",this.indent,this);y.addCommand("Outdent",this.outdent,this);y.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);y.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);y.onInit.add(function(){y.editorCommands.addCommands({outdent:function(){var V=y.selection,W=y.dom;function U(X){X=W.getParent(X,W.isBlock);return X&&(parseInt(y.dom.getStyle(X,"margin-left")||0,10)+parseInt(y.dom.getStyle(X,"padding-left")||0,10))>0}return U(V.getStart())||U(V.getEnd())||y.queryCommandState("InsertOrderedList")||y.queryCommandState("InsertUnorderedList")}},"state")});y.onKeyUp.add(function(V,W){if(x==v){V.execCommand(W.shiftKey?"Outdent":"Indent",true,null);x=N;return r.cancel(W)}else{if(x==s){var U=B();var Y=V.settings.list_outdent_on_enter===true||W.shiftKey;V.execCommand(Y?"Outdent":"Indent",true,null);if(tinymce.isIE){G(U)}return r.cancel(W)}else{if(x==J){if(tinymce.isIE6||tinymce.isIE7||tinymce.isIE8){var X=V.getDoc().createTextNode("\uFEFF");V.selection.getNode().appendChild(X)}else{if(tinymce.isIE9||tinymce.isGecko){V.execCommand("Outdent");return r.cancel(W)}}}}}});function L(V,U){var W=y.getDoc().createTextNode("\uFEFF");V.insertBefore(W,U);y.selection.setCursorLocation(W,0);y.execCommand("mceRepaint")}function R(V,X){if(T(X)){var U=B();if(U){var W=U.parentNode;var Y=W&&W.parentNode;if(Y&&Y.nodeName=="LI"&&Y.firstChild==W&&U==W.firstChild){L(Y,W)}}}}function S(V,X){if(T(X)){var U=B();if(V.dom.select("ul li",U).length===1){var W=U.firstChild;L(U,W)}}}function Q(W,aa){function X(ab){var ad=[];var ae=new tinymce.dom.TreeWalker(ab.firstChild,ab);for(var ac=ae.current();ac;ac=ae.next()){if(W.dom.is(ac,"ol,ul,li")){ad.push(ac)}}return ad}if(aa.keyCode==tinymce.VK.BACKSPACE){var U=B();if(U){var Z=W.dom.getParent(U,"ol,ul"),V=W.selection.getRng();if(Z&&Z.firstChild===U&&V.startOffset==0){var Y=X(U);Y.unshift(U);W.execCommand("Outdent",false,Y);W.undoManager.add();return r.cancel(aa)}}}}function O(V,X){var U=B();if(X.keyCode===tinymce.VK.BACKSPACE&&V.dom.is(U,"li")&&U.parentNode.firstChild!==U){if(V.dom.select("ul,ol",U).length===1){var Z=U.previousSibling;V.dom.remove(V.dom.select("br",U));V.dom.remove(U,true);var W=tinymce.grep(Z.childNodes,function(aa){return aa.nodeType===3});if(W.length===1){var Y=W[0];V.selection.setCursorLocation(Y,Y.length)}V.undoManager.add();return r.cancel(X)}}}y.onKeyDown.add(function(U,V){x=M(V)});y.onKeyDown.add(D);y.onKeyDown.add(u);y.onKeyDown.add(K);if(tinymce.isGecko){y.onKeyUp.add(R)}if(tinymce.isIE8){y.onKeyUp.add(S)}if(tinymce.isGecko||tinymce.isWebKit){y.onKeyDown.add(Q)}if(tinymce.isWebKit){y.onKeyDown.add(O)}},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(t){if(t.tagName==="LI"&&(M.tagName==="P"||G.length>1)){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true)}return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(P,L,N){var t,O=P,M;while(!I.isBlock(P.parentNode)&&P.parentNode!==I.getRoot()){P=I.split(P.parentNode,P.previousSibling);P=P.nextSibling;O=P}if(N){t=N.cloneNode(true);P.parentNode.insertBefore(t,P);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");P.parentNode.insertBefore(t,P)}while(O&&O!=L){M=O.nextSibling;t.appendChild(O);O=M}if(t.childNodes.length===0){t.innerHTML='
            '}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(U){if(U.hasAttribute&&U.hasAttribute("_mce_bogus")){return true}if(P(N,U)){I.addClass(U,"_mce_tagged_br");N=S(U)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w&&!H||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D,elements:this.selectedBlocks()}}else{B={defaultAction:x,elements:this.selectedBlocks(),processEvenIfEmpty:true}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true),elements:this.selectedBlocks()})},outdent:function(y,x){var w=this,u=w.ed,z=u.dom,s=[];function A(t){var C,B,D;if(!d(u,t,s)){if(z.getStyle(t,"margin-left")!==""||z.getStyle(t,"padding-left")!==""){return w.adjustPaddingFunction(false)(t)}D=z.getStyle(t,"text-align",true);if(D==="center"||D==="right"){z.setStyle(t,"text-align","left");return}t=c(t,z);C=t.parentNode;B=t.parentNode.parentNode;if(B.tagName==="P"){z.split(B,t.parentNode)}else{z.split(C,t);if(B.tagName==="LI"){z.split(B,t)}else{if(!z.is(B,"ol,ul")){z.rename(t,"p")}}}s.push(t)}}var v=x&&tinymce.is(x,"array")?x:this.selectedBlocks();this.process({LI:A,defaultAction:this.adjustPaddingFunction(false),elements:v});e(s,m)},process:function(y){var F=this,w=F.ed.selection,z=F.ed.dom,E,u;function B(t){var s=tinymce.grep(t.childNodes,function(H){return !(H.nodeName==="BR"||H.nodeName==="SPAN"&&z.getAttrib(H,"data-mce-type")=="bookmark"||H.nodeType==3&&(H.nodeValue==String.fromCharCode(160)||H.nodeValue==""))});return s.length===0}function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1||!y.processEvenIfEmpty&&E.length>1&&B(s)){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){F.splitSafeEach(s.childNodes,x,true)}function C(s,t){return t>=0&&s.hasChildNodes()&&t0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},selectedBlocks:function(){var s=this.ed,t=s.selection.getSelectedBlocks();return t.length==0?[s.dom.getRoot()]:t},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}()); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js new file mode 100644 index 00000000..1000ef74 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js @@ -0,0 +1,955 @@ +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Event = tinymce.dom.Event, bookmark; + + // Skips text nodes that only contain whitespace since they aren't semantically important. + function skipWhitespaceNodes(e, next) { + while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) { + e = next(e); + } + return e; + } + + function skipWhitespaceNodesBackwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.previousSibling; + }); + } + + function skipWhitespaceNodesForwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.nextSibling; + }); + } + + function hasParentInList(ed, e, list) { + return ed.dom.getParent(e, function(p) { + return tinymce.inArray(list, p) !== -1; + }); + } + + function isList(e) { + return e && (e.tagName === 'OL' || e.tagName === 'UL'); + } + + function splitNestedLists(element, dom) { + var tmp, nested, wrapItem; + tmp = skipWhitespaceNodesBackwards(element.lastChild); + while (isList(tmp)) { + nested = tmp; + tmp = skipWhitespaceNodesBackwards(nested.previousSibling); + } + if (nested) { + wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.split(element, nested); + dom.insertAfter(wrapItem, nested); + wrapItem.appendChild(nested); + wrapItem.appendChild(nested); + element = wrapItem.previousSibling; + } + return element; + } + + function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) { + e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs); + return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs); + } + + function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) { + var prev = skipWhitespaceNodesBackwards(e.previousSibling); + if (prev) { + return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) { + var next = skipWhitespaceNodesForwards(e.nextSibling); + if (next) { + return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) { + if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) { + return merge(e1, e2, differentStylesMasterElement); + } else if (e1 && e1.tagName === 'LI' && isList(e2)) { + // Fix invalidly nested lists. + e1.appendChild(e2); + } + return e2; + } + + function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) { + if (!e1 || !e2) { + return false; + } else if (e1.tagName === 'LI' && e2.tagName === 'LI') { + return e2.style.listStyleType === 'none' || containsOnlyAList(e2); + } else if (isList(e1)) { + return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2); + } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P'; + } + + function isListForIndent(e) { + var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild); + return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI)); + } + + function containsOnlyAList(e) { + var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild); + return firstChild && lastChild && firstChild === lastChild && isList(firstChild); + } + + function merge(e1, e2, masterElement) { + var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild); + if (e1.tagName === 'P') { + e1.appendChild(e1.ownerDocument.createElement('br')); + } + while (e2.firstChild) { + e1.appendChild(e2.firstChild); + } + if (masterElement) { + e1.style.listStyleType = masterElement.style.listStyleType; + } + e2.parentNode.removeChild(e2); + attemptMerge(lastOriginal, firstNew, false); + return e1; + } + + function findItemToOperateOn(e, dom) { + var item; + if (!dom.is(e, 'li,ol,ul')) { + item = dom.getParent(e, 'li'); + if (item) { + e = item; + } + } + return e; + } + + tinymce.create('tinymce.plugins.Lists', { + init: function(ed) { + var LIST_TABBING = 'TABBING'; + var LIST_EMPTY_ITEM = 'EMPTY'; + var LIST_ESCAPE = 'ESCAPE'; + var LIST_PARAGRAPH = 'PARAGRAPH'; + var LIST_UNKNOWN = 'UNKNOWN'; + var state = LIST_UNKNOWN; + + function isTabInList(e) { + // Don't indent on Ctrl+Tab or Alt+Tab + return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) && + (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList')); + } + + function isOnLastListItem() { + var li = getLi(); + var grandParent = li.parentNode.parentNode; + var isLastItem = li.parentNode.lastChild === li; + return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li); + } + + function isNestedList(grandParent) { + if (isList(grandParent)) { + return grandParent.parentNode && grandParent.parentNode.tagName === 'LI'; + } else { + return grandParent.tagName === 'LI'; + } + } + + function isInEmptyListItem() { + return ed.selection.isCollapsed() && isEmptyListItem(getLi()); + } + + function getLi() { + var n = ed.selection.getStart(); + // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position + return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n; + } + + function isEmptyListItem(li) { + var numChildren = li.childNodes.length; + if (li.tagName === 'LI') { + return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li)); + } + return false; + } + + function isEmptyIE9Li(li) { + // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these + var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'}); + var isLastLi = li == lis[lis.length - 1]; + var child = li.firstChild; + return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32)); + } + + function isEnter(e) { + return e.keyCode === tinymce.VK.ENTER; + } + + function isEnterWithoutShift(e) { + return isEnter(e) && !e.shiftKey; + } + + function getListKeyState(e) { + if (isTabInList(e)) { + return LIST_TABBING; + } else if (isEnterWithoutShift(e) && isOnLastListItem()) { + // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now + //return LIST_ESCAPE; + return LIST_UNKNOWN; + } else if (isEnterWithoutShift(e) && isInEmptyListItem()) { + return LIST_EMPTY_ITEM; + } else { + return LIST_UNKNOWN; + } + } + + function cancelDefaultEvents(ed, e) { + // list escape is done manually using outdent as it does not create paragraphs correctly in td's + if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) { + Event.cancel(e); + } + } + + function isCursorAtEndOfContainer() { + var range = ed.selection.getRng(true); + var startContainer = range.startContainer; + if (startContainer.nodeType == 3) { + var value = startContainer.nodeValue; + if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) { + // IE9 places a space on the end of the text in some cases so ignore last char + return (range.endOffset == value.length-1); + } else { + return (range.endOffset == value.length); + } + } else if (startContainer.nodeType == 1) { + return range.endOffset == startContainer.childNodes.length; + } + return false; + } + + /* + If we are at the end of a list item surrounded with an element, pressing enter should create a + new list item instead without splitting the element e.g. don't want to create new P or H1 tag + */ + function isEndOfListItem() { + var node = ed.selection.getNode(); + var validElements = 'h1,h2,h3,h4,h5,h6,p,div'; + var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node; + return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer(); + } + + // Creates a new list item after the current selection's list item parent + function createNewLi(ed, e) { + if (isEnterWithoutShift(e) && isEndOfListItem()) { + var node = ed.selection.getNode(); + var li = ed.dom.create("li"); + var parentLi = ed.dom.getParent(node, 'li'); + ed.dom.insertAfter(li, parentLi); + + // Move caret to new list element. + if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) { + // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic + //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point + ed.selection.setCursorLocation(li, 1); + } else { + ed.selection.setCursorLocation(li, 0); + } + e.preventDefault(); + } + } + + function imageJoiningListItem(ed, e) { + var prevSibling; + + if (!tinymce.isGecko) + return; + + var n = ed.selection.getStart(); + if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG') + return; + + function lastLI(node) { + var child = node.firstChild; + var li = null; + do { + if (!child) + break; + + if (child.tagName === 'LI') + li = child; + } while (child = child.nextSibling); + + return li; + } + + function addChildren(parentNode, destination) { + while (parentNode.childNodes.length > 0) + destination.appendChild(parentNode.childNodes[0]); + } + + // Check if there is a previous sibling + prevSibling = n.parentNode.previousSibling; + if (!prevSibling) + return; + + var ul; + if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL') + ul = prevSibling; + else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL')) + ul = prevSibling.previousSibling; + else + return; + + var li = lastLI(ul); + + // move the caret to the end of the list item + var rng = ed.dom.createRng(); + rng.setStart(li, 1); + rng.setEnd(li, 1); + ed.selection.setRng(rng); + ed.selection.collapse(true); + + // save a bookmark at the end of the list item + var bookmark = ed.selection.getBookmark(); + + // copy the image an its text to the list item + var clone = n.parentNode.cloneNode(true); + if (clone.tagName === 'P' || clone.tagName === 'DIV') + addChildren(clone, li); + else + li.appendChild(clone); + + // remove the old copy of the image + n.parentNode.parentNode.removeChild(n.parentNode); + + // move the caret where we saved the bookmark + ed.selection.moveToBookmark(bookmark); + } + + // fix the cursor position to ensure it is correct in IE + function setCursorPositionToOriginalLi(li) { + var list = ed.dom.getParent(li, 'ol,ul'); + if (list != null) { + var lastLi = list.lastChild; + // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic + //lastLi.appendChild(ed.getDoc().createElement('')); + ed.selection.setCursorLocation(lastLi, 0); + } + } + + this.ed = ed; + ed.addCommand('Indent', this.indent, this); + ed.addCommand('Outdent', this.outdent, this); + ed.addCommand('InsertUnorderedList', function() { + this.applyList('UL', 'OL'); + }, this); + ed.addCommand('InsertOrderedList', function() { + this.applyList('OL', 'UL'); + }, this); + + ed.onInit.add(function() { + ed.editorCommands.addCommands({ + 'outdent': function() { + var sel = ed.selection, dom = ed.dom; + + function hasStyleIndent(n) { + n = dom.getParent(n, dom.isBlock); + return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0; + } + + return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList'); + } + }, 'state'); + }); + + ed.onKeyUp.add(function(ed, e) { + if (state == LIST_TABBING) { + ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null); + state = LIST_UNKNOWN; + return Event.cancel(e); + } else if (state == LIST_EMPTY_ITEM) { + var li = getLi(); + var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey; + ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null); + if (tinymce.isIE) { + setCursorPositionToOriginalLi(li); + } + + return Event.cancel(e); + } else if (state == LIST_ESCAPE) { + if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) { + // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting. + // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after + // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag. + var n = ed.getDoc().createTextNode('\uFEFF'); + ed.selection.getNode().appendChild(n); + } else if (tinymce.isIE9 || tinymce.isGecko) { + // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour + // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves + ed.execCommand('Outdent'); + return Event.cancel(e); + } + } + }); + + function fixListItem(parent, reference) { + // a zero-sized non-breaking space is placed in the empty list item so that the nested list is + // displayed on the below line instead of next to it + var n = ed.getDoc().createTextNode('\uFEFF'); + parent.insertBefore(n, reference); + ed.selection.setCursorLocation(n, 0); + // repaint to remove rendering artifact. only visible when creating new list + ed.execCommand('mceRepaint'); + } + + function fixIndentedListItemForGecko(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (li) { + var parent = li.parentNode; + var grandParent = parent && parent.parentNode; + if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) { + fixListItem(grandParent, parent); + } + } + } + } + + function fixIndentedListItemForIE8(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (ed.dom.select('ul li', li).length === 1) { + var list = li.firstChild; + fixListItem(li, list); + } + } + } + + function fixDeletingFirstCharOfList(ed, e) { + function listElements(li) { + var elements = []; + var walker = new tinymce.dom.TreeWalker(li.firstChild, li); + for (var node = walker.current(); node; node = walker.next()) { + if (ed.dom.is(node, 'ol,ul,li')) { + elements.push(node); + } + } + return elements; + } + + if (e.keyCode == tinymce.VK.BACKSPACE) { + var li = getLi(); + if (li) { + var list = ed.dom.getParent(li, 'ol,ul'), + rng = ed.selection.getRng(); + if (list && list.firstChild === li && rng.startOffset == 0) { + var elements = listElements(li); + elements.unshift(li); + ed.execCommand("Outdent", false, elements); + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + } + + function fixDeletingEmptyLiInWebkit(ed, e) { + var li = getLi(); + if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) { + if (ed.dom.select('ul,ol', li).length === 1) { + var prevLi = li.previousSibling; + ed.dom.remove(ed.dom.select('br', li)); + ed.dom.remove(li, true); + var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 }); + if (textNodes.length === 1) { + var textNode = textNodes[0]; + ed.selection.setCursorLocation(textNode, textNode.length); + } + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + + ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); }); + ed.onKeyDown.add(cancelDefaultEvents); + ed.onKeyDown.add(imageJoiningListItem); + ed.onKeyDown.add(createNewLi); + + if (tinymce.isGecko) { + ed.onKeyUp.add(fixIndentedListItemForGecko); + } + if (tinymce.isIE8) { + ed.onKeyUp.add(fixIndentedListItemForIE8); + } + if (tinymce.isGecko || tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingFirstCharOfList); + } + if (tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingEmptyLiInWebkit); + } + }, + + applyList: function(targetListType, oppositeListType) { + var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions, + selectedBlocks = ed.selection.getSelectedBlocks(); + + function cleanupBr(e) { + if (e && e.tagName === 'BR') { + dom.remove(e); + } + } + + function makeList(element) { + var list = dom.create(targetListType), li; + + function adjustIndentForNewList(element) { + // If there's a margin-left, outdent one level to account for the extra list margin. + if (element.style.marginLeft || element.style.paddingLeft) { + t.adjustPaddingFunction(false)(element); + } + } + + if (element.tagName === 'LI') { + // No change required. + } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') { + processBrs(element, function(startSection, br) { + doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode); + li = startSection.parentNode; + adjustIndentForNewList(li); + cleanupBr(br); + }); + if (li) { + if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) { + dom.split(li.parentNode.parentNode, li.parentNode); + } + attemptMergeWithAdjacent(li.parentNode, true); + } + return; + } else { + // Put the list around the element. + li = dom.create('li'); + dom.insertAfter(li, element); + li.appendChild(element); + adjustIndentForNewList(element); + element = li; + } + dom.insertAfter(list, element); + list.appendChild(element); + attemptMergeWithAdjacent(list, true); + applied.push(element); + } + + function doWrapList(start, end, template) { + var li, n = start, tmp; + while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) { + start = dom.split(start.parentNode, start.previousSibling); + start = start.nextSibling; + n = start; + } + if (template) { + li = template.cloneNode(true); + start.parentNode.insertBefore(li, start); + while (li.firstChild) dom.remove(li.firstChild); + li = dom.rename(li, 'li'); + } else { + li = dom.create('li'); + start.parentNode.insertBefore(li, start); + } + while (n && n != end) { + tmp = n.nextSibling; + li.appendChild(n); + n = tmp; + } + if (li.childNodes.length === 0) { + li.innerHTML = '
            '; + } + makeList(li); + } + + function processBrs(element, callback) { + var startSection, previousBR, END_TO_START = 3, START_TO_END = 1, + breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl'; + + function isAnyPartSelected(start, end) { + var r = dom.createRng(), sel; + bookmark.keep = true; + ed.selection.moveToBookmark(bookmark); + bookmark.keep = false; + sel = ed.selection.getRng(true); + if (!end) { + end = start.parentNode.lastChild; + } + r.setStartBefore(start); + r.setEndAfter(end); + return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0); + } + + function nextLeaf(br) { + if (br.nextSibling) + return br.nextSibling; + if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot()) + return nextLeaf(br.parentNode); + } + + // Split on BRs within the range and process those. + startSection = element.firstChild; + // First mark the BRs that have any part of the previous section selected. + var trailingContentSelected = false; + each(dom.select(breakElements, element), function(br) { + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (isAnyPartSelected(startSection, br)) { + dom.addClass(br, '_mce_tagged_br'); + startSection = nextLeaf(br); + } + }); + trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined)); + startSection = element.firstChild; + each(dom.select(breakElements, element), function(br) { + // Got a section from start to br. + var tmp = nextLeaf(br); + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (dom.hasClass(br, '_mce_tagged_br')) { + callback(startSection, br, previousBR); + previousBR = null; + } else { + previousBR = br; + } + startSection = tmp; + }); + if (trailingContentSelected) { + callback(startSection, undefined, previousBR); + } + } + + function wrapList(element) { + processBrs(element, function(startSection, br, previousBR) { + // Need to indent this part + doWrapList(startSection, br); + cleanupBr(br); + cleanupBr(previousBR); + }); + } + + function changeList(element) { + if (tinymce.inArray(applied, element) !== -1) { + return; + } + if (element.parentNode.tagName === oppositeListType) { + dom.split(element.parentNode, element); + makeList(element); + attemptMergeWithNext(element.parentNode, false); + } + applied.push(element); + } + + function convertListItemToParagraph(element) { + var child, nextChild, mergedElement, splitLast; + if (tinymce.inArray(applied, element) !== -1) { + return; + } + element = splitNestedLists(element, dom); + while (dom.is(element.parentNode, 'ol,ul,li')) { + dom.split(element.parentNode, element); + } + // Push the original element we have from the selection, not the renamed one. + applied.push(element); + element = dom.rename(element, 'p'); + mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines); + if (mergedElement === element) { + // Now split out any block elements that can't be contained within a P. + // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each) + child = element.firstChild; + while (child) { + if (dom.isBlock(child)) { + child = dom.split(child.parentNode, child); + splitLast = true; + nextChild = child.nextSibling && child.nextSibling.firstChild; + } else { + nextChild = child.nextSibling; + if (splitLast && child.tagName === 'BR') { + dom.remove(child); + } + splitLast = false; + } + child = nextChild; + } + } + } + + each(selectedBlocks, function(e) { + e = findItemToOperateOn(e, dom); + if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) { + hasOppositeType = true; + } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) { + hasSameType = true; + } else { + hasNonList = true; + } + }); + + if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) { + actions = { + 'LI': changeList, + 'H1': makeList, + 'H2': makeList, + 'H3': makeList, + 'H4': makeList, + 'H5': makeList, + 'H6': makeList, + 'P': makeList, + 'BODY': makeList, + 'DIV': selectedBlocks.length > 1 ? makeList : wrapList, + defaultAction: wrapList, + elements: this.selectedBlocks() + }; + } else { + actions = { + defaultAction: convertListItemToParagraph, + elements: this.selectedBlocks(), + processEvenIfEmpty: true + }; + } + this.process(actions); + }, + + indent: function() { + var ed = this.ed, dom = ed.dom, indented = []; + + function createWrapItem(element) { + var wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.insertAfter(wrapItem, element); + return wrapItem; + } + + function createWrapList(element) { + var wrapItem = createWrapItem(element), + list = dom.getParent(element, 'ol,ul'), + listType = list.tagName, + listStyle = dom.getStyle(list, 'list-style-type'), + attrs = {}, + wrapList; + if (listStyle !== '') { + attrs.style = 'list-style-type: ' + listStyle + ';'; + } + wrapList = dom.create(listType, attrs); + wrapItem.appendChild(wrapList); + return wrapList; + } + + function indentLI(element) { + if (!hasParentInList(ed, element, indented)) { + element = splitNestedLists(element, dom); + var wrapList = createWrapList(element); + wrapList.appendChild(element); + attemptMergeWithAdjacent(wrapList.parentNode, false); + attemptMergeWithAdjacent(wrapList, false); + indented.push(element); + } + } + + this.process({ + 'LI': indentLI, + defaultAction: this.adjustPaddingFunction(true), + elements: this.selectedBlocks() + }); + + }, + + outdent: function(ui, elements) { + var t = this, ed = t.ed, dom = ed.dom, outdented = []; + + function outdentLI(element) { + var listElement, targetParent, align; + if (!hasParentInList(ed, element, outdented)) { + if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') { + return t.adjustPaddingFunction(false)(element); + } + align = dom.getStyle(element, 'text-align', true); + if (align === 'center' || align === 'right') { + dom.setStyle(element, 'text-align', 'left'); + return; + } + element = splitNestedLists(element, dom); + listElement = element.parentNode; + targetParent = element.parentNode.parentNode; + if (targetParent.tagName === 'P') { + dom.split(targetParent, element.parentNode); + } else { + dom.split(listElement, element); + if (targetParent.tagName === 'LI') { + // Nested list, need to split the LI and go back out to the OL/UL element. + dom.split(targetParent, element); + } else if (!dom.is(targetParent, 'ol,ul')) { + dom.rename(element, 'p'); + } + } + outdented.push(element); + } + } + + var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks(); + this.process({ + 'LI': outdentLI, + defaultAction: this.adjustPaddingFunction(false), + elements: listElements + }); + + each(outdented, attemptMergeWithAdjacent); + }, + + process: function(actions) { + var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r; + + function isEmptyElement(element) { + var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) { + return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark' + || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == '')); + }); + return excludeBrsAndBookmarks.length === 0; + } + + function processElement(element) { + dom.removeClass(element, '_mce_act_on'); + if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) { + return; + } + element = findItemToOperateOn(element, dom); + var action = actions[element.tagName]; + if (!action) { + action = actions.defaultAction; + } + action(element); + } + + function recurse(element) { + t.splitSafeEach(element.childNodes, processElement, true); + } + + function brAtEdgeOfSelection(container, offset) { + return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length && + container.childNodes[offset].tagName === 'BR'; + } + + function isInTable() { + var n = sel.getNode(); + var p = dom.getParent(n, 'td'); + return p !== null; + } + + selectedBlocks = actions.elements; + + r = sel.getRng(true); + if (!r.collapsed) { + if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) { + r.setEnd(r.endContainer, r.endOffset - 1); + sel.setRng(r); + } + if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) { + r.setStart(r.startContainer, r.startOffset + 1); + sel.setRng(r); + } + } + + + if (tinymce.isIE8) { + // append a zero sized nbsp so that caret is restored correctly using bookmark + var s = t.ed.selection.getNode(); + if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) { + var i = t.ed.getDoc().createTextNode('\uFEFF'); + s.appendChild(i); + } + } + + bookmark = sel.getBookmark(); + actions.OL = actions.UL = recurse; + t.splitSafeEach(selectedBlocks, processElement); + sel.moveToBookmark(bookmark); + bookmark = null; + + // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6 + if (!isInTable()) { + // Avoids table or image handles being left behind in Firefox. + t.ed.execCommand('mceRepaint'); + } + }, + + splitSafeEach: function(elements, f, forceClassBase) { + if (forceClassBase || + (tinymce.isGecko && + (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) || + /Firefox\/3\.[0-4]/.test(navigator.userAgent)))) { + this.classBasedEach(elements, f); + } else { + each(elements, f); + } + }, + + classBasedEach: function(elements, f) { + var dom = this.ed.dom, nodes, element; + // Mark nodes + each(elements, function(element) { + dom.addClass(element, '_mce_act_on'); + }); + nodes = dom.select('._mce_act_on'); + while (nodes.length > 0) { + element = nodes.shift(); + dom.removeClass(element, '_mce_act_on'); + f(element); + nodes = dom.select('._mce_act_on'); + } + }, + + adjustPaddingFunction: function(isIndent) { + var indentAmount, indentUnits, ed = this.ed; + indentAmount = ed.settings.indentation; + indentUnits = /[a-z%]+/i.exec(indentAmount); + indentAmount = parseInt(indentAmount, 10); + return function(element) { + var currentIndent, newIndentAmount; + currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10); + if (isIndent) { + newIndentAmount = currentIndent + indentAmount; + } else { + newIndentAmount = currentIndent - indentAmount; + } + ed.dom.setStyle(element, 'padding-left', ''); + ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : ''); + }; + }, + + selectedBlocks: function() { + var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks(); + return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks; + }, + + getInfo: function() { + return { + longname : 'Lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + tinymce.PluginManager.add("lists", tinymce.plugins.Lists); +}()); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/css/media.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/css/media.css new file mode 100644 index 00000000..0c45c7ff --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/css/media.css @@ -0,0 +1,17 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js new file mode 100644 index 00000000..9ac42e0d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),a=tinymce.makeMap(b.join(",")),f=tinymce.html.Node,d,i,h=tinymce.util.JSON,g;d=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function e(j){return typeof(j)=="string"?j.replace(/[^0-9%]/g,""):j}function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(s){return s&&s.nodeName==="IMG"&&n.dom.hasClass(s,"mceItemMedia")}r.editor=n;r.url=j;i="";for(m=0;m0){O+=(O?"&":"")+P+"="+escape(Q)}});if(O.length){G.params.flashvars=O}L=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(L,function(Q,P){G.params[P]=""+Q})}}G=z.attr("data-mce-json");if(!G){return}G=h.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}G.width=z.attr("width")||G.width;G.height=z.attr("height")||G.height;if(q.name==="Iframe"){x=new f("iframe",1);tinymce.each(b,function(n){var J=z.attr(n);if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&J.length>0){x.attr(n,J)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new f("script",1).attr("type","text/javascript");y=new f("#text",3);y.value="write"+q.name+"("+h.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new f("video",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style'); + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Use node width/height to override the data width/height when the placeholder is resized + data.width = node.attr('width') || data.width; + data.height = node.attr('height') || data.height; + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } + + data.params.src = ''; + } + + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: node.attr('type') + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } + + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = normalizeSize(iframe.attr('width')); + height = normalizeSize(iframe.attr('height')); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } + + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; + + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + + function get(id) { + return document.getElementById(id); + } + + function clone(obj) { + var i, len, copy, attr; + + if (null == obj || "object" != typeof obj) + return obj; + + // Handle Array + if ('length' in obj) { + copy = []; + + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } + + return copy; + } + + // Handle Object + copy = {}; + for (attr in obj) { + if (obj.hasOwnProperty(attr)) + copy[attr] = clone(obj[attr]); + } + + return copy; + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value, name) { + if (typeof(value) != 'undefined' && value != null) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') { + value = value.toLowerCase(); + value = (!name && value === 'true') || (name && value === name.toLowerCase()); + } + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor, self = this; + + self.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media'); + + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube Embed + if (src.match(/youtube\.com\/embed\/\w+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + setVal('src', src); + setVal('media_type', data.type); + } else { + // YouTube *NEW* + if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube\.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + } + + // Google video + if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + // Vimeo + if (src.match(/vimeo\.com\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // stream.cz + if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google maps + if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed"; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + }, + + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } + + return '' + } + + var html = ""; + + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js new file mode 100644 index 00000000..6d0de767 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.media_dlg',{list:"Liste",file:"Datei/URL",advanced:"Erweitert",general:"Allgemein",title:"Multimedia-Inhalte einf\u00fcgen/bearbeiten","align_top_left":"Oben Links","align_center":"Zentriert","align_left":"Links","align_bottom":"Unten","align_right":"Rechts","align_top":"Oben","qt_stream_warn":"In den Erweiterten Einstellungen sollten im Feld \'QT Src\' gestreamte RTSP Resourcen hinzugef\u00fcgt werden.\nZus\u00e4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.",qtsrc:"Angabe zu QT Src",progress:"Fortschritt",sound:"Ton",swstretchvalign:"Stretch V-Ausrichtung",swstretchhalign:"Stretch H-Ausrichtung",swstretchstyle:"Stretch-Art",scriptcallbacks:"Script callbacks","align_top_right":"Oben Rechts",uimode:"UI Modus",rate:"Rate",playcount:"Z\u00e4hler",defaultframe:"Frame-Voreinstellung",currentposition:"Aktuelle Position",currentmarker:"Aktueller Marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Fensterloses Video",stretchtofit:"Anzeigefl\u00e4che an verf\u00fcgbaren Platz anpassen",mute:"Stumm",invokeurls:"Invoke URLs",fullscreen:"Vollbild",enabled:"Aktiviert",autostart:"Autostart",volume:"Lautst\u00e4rke",target:"Ziel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Endzeitpunkt",starttime:"Startzeitpunkt",enablejavascript:"JavaScript aktivieren",correction:"Ohne Korrektur",targetcache:"Ziel zwischenspeichern",playeveryframe:"Jeden Frame abspielen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Men\u00fc anzeigen",loop:"Wiederholung",play:"Automatisches Abspielen",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand","class_name":"CSS-Klasse",name:"Name",id:"Id",type:"Typ",size:"Abmessungen",preview:"Vorschau","constrain_proportions":"Proportionen erhalten",controls:"Steuerung",numloop:"Anzahl Wiederholungen",console:"Konsole",cache:"Zwischenspeicher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvariablen",base:"Base",bgcolor:"Hintergrund",wmode:"WMode",salign:"S-Ausrichtung",align:"Ausrichtung",scale:"Skalierung",quality:"Qualit\u00e4t",shuffle:"Zuf\u00e4llige Wiedergabe",prefetch:"Prefetch",nojava:"Kein Java",maintainaspect:"Bildverh\u00e4ltnis beibehalten",imagestatus:"Bildstatus",center:"Zentriert",autogotourl:"Auto goto URL","shockwave_options":"Shockwave-Optionen","rmp_options":"Optionen f\u00fcr Real Media Player","wmp_options":"Optionen f\u00fcr Windows Media Player","qt_options":"Quicktime-Optionen","flash_options":"Flash-Optionen",hidden:"Versteckt","align_bottom_left":"Unten Links","align_bottom_right":"Unten Rechts",flash:"Flash",quicktime:"QuickTime","embedded_audio_options":"Integrierte Audio Optionen",windowsmedia:"WindowsMedia",realmedia:"RealMedia",shockwave:"ShockWave",audio:"Audio",video:"Video","html5_video_options":"HTML5 Video Optionen",altsource1:"Alternative Quelle 1",altsource2:"Alternative Quelle 2",preload:"Preload",poster:"Poster",source:"Quelle","html5_audio_options":"Audio Optionen","preload_none":"Nicht vorladen","preload_metadata":"Video Metadaten vorladen","preload_auto":"Benutzer Browser entscheidet automatisch",iframe:"iFrame",embeddedaudio:"Audio (eingebunden)"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js new file mode 100644 index 00000000..ecef3a80 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" }); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/media.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/media.htm new file mode 100644 index 00000000..06a67f79 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/media.htm @@ -0,0 +1,819 @@ + + + + {#media_dlg.title} + + + + + + + + + +
            + +
            +
            +
            + {#media_dlg.general} +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + x + px +

            + + +

            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            + +
            +
            + {#media_dlg.advanced} +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            + +
            +
            +

            {#media_dlg.html5_video_options}

            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.embedded_audio_options}

            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.html5_audio_options}

            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.flash_options}

            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.qt_options}

            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
             
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.wmp_options}

            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.rmp_options}

            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            +
            + +
            +
            +

            {#media_dlg.shockwave_options}

            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +

            +
            +
            + +
            +
            + {#media_dlg.source} + +
            +
            + +
            +
            +
              +
            • +
            • +
            +



            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf new file mode 100644 index 00000000..585d772d Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css new file mode 100644 index 00000000..0c45c7ff --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css @@ -0,0 +1,17 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js new file mode 100644 index 00000000..9ac42e0d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),a=tinymce.makeMap(b.join(",")),f=tinymce.html.Node,d,i,h=tinymce.util.JSON,g;d=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function e(j){return typeof(j)=="string"?j.replace(/[^0-9%]/g,""):j}function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(s){return s&&s.nodeName==="IMG"&&n.dom.hasClass(s,"mceItemMedia")}r.editor=n;r.url=j;i="";for(m=0;m0){O+=(O?"&":"")+P+"="+escape(Q)}});if(O.length){G.params.flashvars=O}L=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(L,function(Q,P){G.params[P]=""+Q})}}G=z.attr("data-mce-json");if(!G){return}G=h.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}G.width=z.attr("width")||G.width;G.height=z.attr("height")||G.height;if(q.name==="Iframe"){x=new f("iframe",1);tinymce.each(b,function(n){var J=z.attr(n);if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&J.length>0){x.attr(n,J)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new f("script",1).attr("type","text/javascript");y=new f("#text",3);y.value="write"+q.name+"("+h.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new f("video",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style'); + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Use node width/height to override the data width/height when the placeholder is resized + data.width = node.attr('width') || data.width; + data.height = node.attr('height') || data.height; + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } + + data.params.src = ''; + } + + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: node.attr('type') + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: normalizeSize(node.attr('width')), + height: normalizeSize(node.attr('height')), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } + + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = normalizeSize(iframe.attr('width')); + height = normalizeSize(iframe.attr('height')); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } + + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; + + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + + function get(id) { + return document.getElementById(id); + } + + function clone(obj) { + var i, len, copy, attr; + + if (null == obj || "object" != typeof obj) + return obj; + + // Handle Array + if ('length' in obj) { + copy = []; + + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } + + return copy; + } + + // Handle Object + copy = {}; + for (attr in obj) { + if (obj.hasOwnProperty(attr)) + copy[attr] = clone(obj[attr]); + } + + return copy; + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value, name) { + if (typeof(value) != 'undefined' && value != null) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') { + value = value.toLowerCase(); + value = (!name && value === 'true') || (name && value === name.toLowerCase()); + } + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor, self = this; + + self.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media'); + + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube Embed + if (src.match(/youtube\.com\/embed\/\w+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + setVal('src', src); + setVal('media_type', data.type); + } else { + // YouTube *NEW* + if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube\.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + } + + // Google video + if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + // Vimeo + if (src.match(/vimeo\.com\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // stream.cz + if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google maps + if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed"; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + }, + + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } + + return '' + } + + var html = ""; + + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js new file mode 100644 index 00000000..6d0de767 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.media_dlg',{list:"Liste",file:"Datei/URL",advanced:"Erweitert",general:"Allgemein",title:"Multimedia-Inhalte einf\u00fcgen/bearbeiten","align_top_left":"Oben Links","align_center":"Zentriert","align_left":"Links","align_bottom":"Unten","align_right":"Rechts","align_top":"Oben","qt_stream_warn":"In den Erweiterten Einstellungen sollten im Feld \'QT Src\' gestreamte RTSP Resourcen hinzugef\u00fcgt werden.\nZus\u00e4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.",qtsrc:"Angabe zu QT Src",progress:"Fortschritt",sound:"Ton",swstretchvalign:"Stretch V-Ausrichtung",swstretchhalign:"Stretch H-Ausrichtung",swstretchstyle:"Stretch-Art",scriptcallbacks:"Script callbacks","align_top_right":"Oben Rechts",uimode:"UI Modus",rate:"Rate",playcount:"Z\u00e4hler",defaultframe:"Frame-Voreinstellung",currentposition:"Aktuelle Position",currentmarker:"Aktueller Marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Fensterloses Video",stretchtofit:"Anzeigefl\u00e4che an verf\u00fcgbaren Platz anpassen",mute:"Stumm",invokeurls:"Invoke URLs",fullscreen:"Vollbild",enabled:"Aktiviert",autostart:"Autostart",volume:"Lautst\u00e4rke",target:"Ziel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Endzeitpunkt",starttime:"Startzeitpunkt",enablejavascript:"JavaScript aktivieren",correction:"Ohne Korrektur",targetcache:"Ziel zwischenspeichern",playeveryframe:"Jeden Frame abspielen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Men\u00fc anzeigen",loop:"Wiederholung",play:"Automatisches Abspielen",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand","class_name":"CSS-Klasse",name:"Name",id:"Id",type:"Typ",size:"Abmessungen",preview:"Vorschau","constrain_proportions":"Proportionen erhalten",controls:"Steuerung",numloop:"Anzahl Wiederholungen",console:"Konsole",cache:"Zwischenspeicher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvariablen",base:"Base",bgcolor:"Hintergrund",wmode:"WMode",salign:"S-Ausrichtung",align:"Ausrichtung",scale:"Skalierung",quality:"Qualit\u00e4t",shuffle:"Zuf\u00e4llige Wiedergabe",prefetch:"Prefetch",nojava:"Kein Java",maintainaspect:"Bildverh\u00e4ltnis beibehalten",imagestatus:"Bildstatus",center:"Zentriert",autogotourl:"Auto goto URL","shockwave_options":"Shockwave-Optionen","rmp_options":"Optionen f\u00fcr Real Media Player","wmp_options":"Optionen f\u00fcr Windows Media Player","qt_options":"Quicktime-Optionen","flash_options":"Flash-Optionen",hidden:"Versteckt","align_bottom_left":"Unten Links","align_bottom_right":"Unten Rechts",flash:"Flash",quicktime:"QuickTime","embedded_audio_options":"Integrierte Audio Optionen",windowsmedia:"WindowsMedia",realmedia:"RealMedia",shockwave:"ShockWave",audio:"Audio",video:"Video","html5_video_options":"HTML5 Video Optionen",altsource1:"Alternative Quelle 1",altsource2:"Alternative Quelle 2",preload:"Preload",poster:"Poster",source:"Quelle","html5_audio_options":"Audio Optionen","preload_none":"Nicht vorladen","preload_metadata":"Video Metadaten vorladen","preload_auto":"Benutzer Browser entscheidet automatisch",iframe:"iFrame",embeddedaudio:"Audio (eingebunden)"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js new file mode 100644 index 00000000..ecef3a80 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" }); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm new file mode 100644 index 00000000..957d83a6 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm @@ -0,0 +1,922 @@ + + + + {#media_dlg.title} + + + + + + + + + +
            + + +
            +
            +
            + {#media_dlg.general} + + + + + + + + + + + + + + + + + + +
            + +
            + + + + + +
             
            +
            + + + + + + +
            x   
            +
            +
            + +
            + {#media_dlg.preview} + +
            +
            + +
            +
            + {#media_dlg.advanced} + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + + + +
             
            +
            +
            + +
            + {#media_dlg.html5_video_options} + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + +
            + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.embedded_audio_options} + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.html5_audio_options} + + + + + + + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + +
            + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + +
            + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + + + + + + + +
            +
            + +
            + {#media_dlg.qt_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +  
            + + + + + +
             
            +
            +
            + +
            + {#media_dlg.wmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            + +
            + {#media_dlg.rmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +   +
            +
            + +
            + {#media_dlg.shockwave_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + + + +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            + + + + + +
            +
            +
            +
            + +
            +
            + {#media_dlg.source} + +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf new file mode 100644 index 00000000..585d772d Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js new file mode 100644 index 00000000..687f5486 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js new file mode 100644 index 00000000..d492fbef --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Nonbreaking', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceNonBreaking', function() { + ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); + }); + + // Register buttons + ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); + + if (ed.getParam('nonbreaking_force_tab')) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode == 9) { + e.preventDefault(); + + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + } + }); + } + }, + + getInfo : function() { + return { + longname : 'Nonbreaking space', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + + // Private methods + }); + + // Register plugin + tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js new file mode 100644 index 00000000..da411ebc --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret",r="\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return !D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(z,B){var F=B.keyCode,x,C,D,v;function u(H,G){while(H=H[G?"previousSibling":"nextSibling"]){if(H.nodeType!==3||H.nodeValue.length>0){return H}}}function y(G,H){p.select(G);p.collapse(H)}function t(K){var J,I,M,H;function G(O){var N=I;while(N){if(N===O){return}N=N.parentNode}j.remove(O);q()}function L(){var O,P,N=z.schema.getNonEmptyElements();P=new tinymce.dom.TreeWalker(I,z.getBody());while(O=(K?P.prev():P.next())){if(N[O.nodeName.toLowerCase()]){break}if(O.nodeType===3&&tinymce.trim(O.nodeValue).length>0){break}if(m(O)==="false"){G(O);return true}}if(g(O)){return true}return false}if(p.isCollapsed()){J=p.getRng(true);I=J.startContainer;M=J.startOffset;I=l(I)||I;if(H=g(I)){G(H);return false}if(I.nodeType==3&&(K?M>0:M124)&&F!=e.DELETE&&F!=e.BACKSPACE){if((tinymce.isMac?B.metaKey:B.ctrlKey)&&(F==67||F==88||F==86)){return}B.preventDefault();if(F==e.LEFT||F==e.RIGHT){var w=F==e.LEFT;if(z.dom.isBlock(x)){var A=w?x.previousSibling:x.nextSibling;var s=new c(A,A);var E=w?s.prev():s.next();y(E,!w)}else{y(x,w)}}}else{if(F==e.LEFT||F==e.RIGHT||F==e.BACKSPACE||F==e.DELETE){C=l(D);if(C){if(F==e.LEFT||F==e.BACKSPACE){x=u(C,true);if(x&&m(x)==="false"){B.preventDefault();if(F==e.LEFT){y(x,true)}else{j.remove(x);return}}else{i(C)}}if(F==e.RIGHT||F==e.DELETE){x=u(C);if(x&&m(x)==="false"){B.preventDefault();if(F==e.RIGHT){y(x,false)}else{j.remove(x);return}}else{i(C)}}}if((F==e.BACKSPACE||F==e.DELETE)&&!t(F==e.BACKSPACE)){B.preventDefault();return false}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){q()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(i,k){var h,g,j;function f(m,n){var o=j.length,p=n.content,l=tinymce.trim(g);if(n.format=="raw"){return}while(o--){p=p.replace(j[o],function(s){var r=arguments,q=r[r.length-2];if(q>0&&p.charAt(q-1)=='"'){return s}return''+m.dom.encode(typeof(r[1])==="string"?r[1]:r[0])+""})}n.content=p}h=" "+tinymce.trim(i.getParam("noneditable_editable_class","mceEditable"))+" ";g=" "+tinymce.trim(i.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";j=i.getParam("noneditable_regexp");if(j&&!j.length){j=[j]}i.onPreInit.add(function(){b(i);if(j){i.selection.onBeforeSetContent.add(f);i.onBeforeSetContent.add(f)}i.parser.addAttributeFilter("class",function(l){var m=l.length,n,o;while(m--){o=l[m];n=" "+o.attr("class")+" ";if(n.indexOf(h)!==-1){o.attr(d,"true")}else{if(n.indexOf(g)!==-1){o.attr(d,"false")}}}});i.serializer.addAttributeFilter(d,function(l,m){var n=l.length,o;while(n--){o=l[n];if(j&&o.attr("data-mce-content")){o.name="#text";o.type=3;o.raw=true;o.value=o.attr("data-mce-content")}else{o.attr(a,null);o.attr(d,null)}}});i.parser.addAttributeFilter(a,function(l,m){var n=l.length,o;while(n--){o=l[n];o.attr(d,o.attr(a));o.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js new file mode 100644 index 00000000..a18bcd78 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js @@ -0,0 +1,537 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var TreeWalker = tinymce.dom.TreeWalker; + var externalName = 'contenteditable', internalName = 'data-mce-' + externalName; + var VK = tinymce.VK; + + function handleContentEditableSelection(ed) { + var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF'; + + // Returns the content editable state of a node "true/false" or null + function getContentEditable(node) { + var contentEditable; + + // Ignore non elements + if (node.nodeType === 1) { + // Check for fake content editable + contentEditable = node.getAttribute(internalName); + if (contentEditable && contentEditable !== "inherit") { + return contentEditable; + } + + // Check for real content editable + contentEditable = node.contentEditable; + if (contentEditable !== "inherit") { + return contentEditable; + } + } + + return null; + }; + + // Returns the noneditable parent or null if there is a editable before it or if it wasn't found + function getNonEditableParent(node) { + var state; + + while (node) { + state = getContentEditable(node); + if (state) { + return state === "false" ? node : null; + } + + node = node.parentNode; + } + }; + + // Get caret container parent for the specified node + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } + + node = node.parentNode; + } + }; + + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; + + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Insert caret container before/after target or expand selection to include block + function insertCaretContainerOrExpandToBlock(target, before) { + var caretContainer, rng; + + // Select block + if (getContentEditable(target) === "false") { + if (dom.isBlock(target)) { + selection.select(target); + return; + } + } + + rng = dom.createRng(); + + if (getContentEditable(target) === "true") { + if (!target.firstChild) { + target.appendChild(ed.getDoc().createTextNode('\u00a0')); + } + + target = target.firstChild; + before = true; + } + + //caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar); + caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar); + + if (before) { + target.parentNode.insertBefore(caretContainer, target); + } else { + dom.insertAfter(caretContainer, target); + } + + rng.setStart(caretContainer.firstChild, 1); + rng.collapse(true); + selection.setRng(rng); + + return caretContainer; + }; + + // Removes any caret container except the one we might be in + function removeCaretContainer(caretContainer) { + var child, currentCaretContainer, lastContainer; + + if (caretContainer) { + rng = selection.getRng(true); + rng.setStartBefore(caretContainer); + rng.setEndBefore(caretContainer); + + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + + selection.setRng(rng); + } else { + currentCaretContainer = getParentCaretContainer(selection.getStart()); + while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) { + if (currentCaretContainer !== caretContainer) { + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + } + + lastContainer = caretContainer; + } + } + }; + + // Modifies the selection to include contentEditable false elements or insert caret containers + function moveSelection() { + var nonEditableStart, nonEditableEnd, isCollapsed, rng, element; + + // Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside + function hasSideContent(element, left) { + var container, offset, walker, node, len; + + container = rng.startContainer; + offset = rng.startOffset; + + // If endpoint is in middle of text node then expand to beginning/end of element + if (container.nodeType == 3) { + len = container.nodeValue.length; + if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) { + return; + } + } else { + // Can we resolve the node by index + if (offset < container.childNodes.length) { + // Browser represents caret position as the offset at the start of an element. When moving right + // this is the element we are moving into so we consider our container to be child node at offset-1 + var pos = !left && offset > 0 ? offset-1 : offset; + container = container.childNodes[pos]; + if (container.hasChildNodes()) { + container = container.firstChild; + } + } else { + // If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element + return !left ? element : null; + } + } + + // Walk left/right to look for contents + walker = new TreeWalker(container, element); + while (node = walker[left ? 'prev' : 'next']()) { + if (node.nodeType === 3 && node.nodeValue.length > 0) { + return; + } else if (getContentEditable(node) === "true") { + // Found contentEditable=true element return this one to we can move the caret inside it + return node; + } + } + + return element; + }; + + // Remove any existing caret containers + removeCaretContainer(); + + // Get noneditable start/end elements + isCollapsed = selection.isCollapsed(); + nonEditableStart = getNonEditableParent(selection.getStart()); + nonEditableEnd = getNonEditableParent(selection.getEnd()); + + // Is any fo the range endpoints noneditable + if (nonEditableStart || nonEditableEnd) { + rng = selection.getRng(true); + + // If it's a caret selection then look left/right to see if we need to move the caret out side or expand + if (isCollapsed) { + nonEditableStart = nonEditableStart || nonEditableEnd; + var start = selection.getStart(); + if (element = hasSideContent(nonEditableStart, true)) { + // We have no contents to the left of the caret then insert a caret container before the noneditable element + insertCaretContainerOrExpandToBlock(element, true); + } else if (element = hasSideContent(nonEditableStart, false)) { + // We have no contents to the right of the caret then insert a caret container after the noneditable element + insertCaretContainerOrExpandToBlock(element, false); + } else { + // We are in the middle of a noneditable so expand to select it + selection.select(nonEditableStart); + } + } else { + rng = selection.getRng(true); + + // Expand selection to include start non editable element + if (nonEditableStart) { + rng.setStartBefore(nonEditableStart); + } + + // Expand selection to include end non editable element + if (nonEditableEnd) { + rng.setEndAfter(nonEditableEnd); + } + + selection.setRng(rng); + } + } + }; + + function handleKey(ed, e) { + var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement; + + function getNonEmptyTextNodeSibling(node, prev) { + while (node = node[prev ? 'previousSibling' : 'nextSibling']) { + if (node.nodeType !== 3 || node.nodeValue.length > 0) { + return node; + } + } + }; + + function positionCaretOnElement(element, start) { + selection.select(element); + selection.collapse(start); + } + + function canDelete(backspace) { + var rng, container, offset, nonEditableParent; + + function removeNodeIfNotParent(node) { + var parent = container; + + while (parent) { + if (parent === node) { + return; + } + + parent = parent.parentNode; + } + + dom.remove(node); + moveSelection(); + } + + function isNextPrevTreeNodeNonEditable() { + var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements(); + + walker = new tinymce.dom.TreeWalker(container, ed.getBody()); + while (node = (backspace ? walker.prev() : walker.next())) { + // Found IMG/INPUT etc + if (nonEmptyElements[node.nodeName.toLowerCase()]) { + break; + } + + // Found text node with contents + if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) { + break; + } + + // Found non editable node + if (getContentEditable(node) === "false") { + removeNodeIfNotParent(node); + return true; + } + } + + // Check if the content node is within a non editable parent + if (getNonEditableParent(node)) { + return true; + } + + return false; + } + + if (selection.isCollapsed()) { + rng = selection.getRng(true); + container = rng.startContainer; + offset = rng.startOffset; + container = getParentCaretContainer(container) || container; + + // Is in noneditable parent + if (nonEditableParent = getNonEditableParent(container)) { + removeNodeIfNotParent(nonEditableParent); + return false; + } + + // Check if the caret is in the middle of a text node + if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) { + return true; + } + + // Resolve container index + if (container.nodeType == 1) { + container = container.childNodes[offset] || container; + } + + // Check if previous or next tree node is non editable then block the event + if (isNextPrevTreeNodeNonEditable()) { + return false; + } + } + + return true; + } + + startElement = selection.getStart() + endElement = selection.getEnd(); + + // Disable all key presses in contentEditable=false except delete or backspace + nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement); + if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) { + // Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior + if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) { + return; + } + + e.preventDefault(); + + // Arrow left/right select the element and collapse left/right + if (keyCode == VK.LEFT || keyCode == VK.RIGHT) { + var left = keyCode == VK.LEFT; + // If a block element find previous or next element to position the caret + if (ed.dom.isBlock(nonEditableParent)) { + var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling; + var walker = new TreeWalker(targetElement, targetElement); + var caretElement = left ? walker.prev() : walker.next(); + positionCaretOnElement(caretElement, !left); + } else { + positionCaretOnElement(nonEditableParent, left); + } + } + } else { + // Is arrow left/right, backspace or delete + if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) { + caretContainer = getParentCaretContainer(startElement); + if (caretContainer) { + // Arrow left or backspace + if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.LEFT) { + positionCaretOnElement(nonEditableParent, true); + } else { + dom.remove(nonEditableParent); + return; + } + } else { + removeCaretContainer(caretContainer); + } + } + + // Arrow right or delete + if (keyCode == VK.RIGHT || keyCode == VK.DELETE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.RIGHT) { + positionCaretOnElement(nonEditableParent, false); + } else { + dom.remove(nonEditableParent); + return; + } + } else { + removeCaretContainer(caretContainer); + } + } + } + + if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) { + e.preventDefault(); + return false; + } + } + } + }; + + ed.onMouseDown.addToTop(function(ed, e) { + var node = ed.selection.getNode(); + + if (getContentEditable(node) === "false" && node == e.target) { + // Expand selection on mouse down we can't block the default event since it's used for drag/drop + moveSelection(); + } + }); + + ed.onMouseUp.addToTop(moveSelection); + ed.onKeyDown.addToTop(handleKey); + ed.onKeyUp.addToTop(moveSelection); + }; + + tinymce.create('tinymce.plugins.NonEditablePlugin', { + init : function(ed, url) { + var editClass, nonEditClass, nonEditableRegExps; + + // Converts configured regexps to noneditable span items + function convertRegExpsToNonEditable(ed, args) { + var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass); + + // Don't replace the variables when raw is used for example on undo/redo + if (args.format == "raw") { + return; + } + + while (i--) { + content = content.replace(nonEditableRegExps[i], function(match) { + var args = arguments, index = args[args.length - 2]; + + // Is value inside an attribute then don't replace + if (index > 0 && content.charAt(index - 1) == '"') { + return match; + } + + return '' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + ''; + }); + } + + args.content = content; + }; + + editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " "; + nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " "; + + // Setup noneditable regexps array + nonEditableRegExps = ed.getParam("noneditable_regexp"); + if (nonEditableRegExps && !nonEditableRegExps.length) { + nonEditableRegExps = [nonEditableRegExps]; + } + + ed.onPreInit.add(function() { + handleContentEditableSelection(ed); + + if (nonEditableRegExps) { + ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable); + ed.onBeforeSetContent.add(convertRegExpsToNonEditable); + } + + // Apply contentEditable true/false on elements with the noneditable/editable classes + ed.parser.addAttributeFilter('class', function(nodes) { + var i = nodes.length, className, node; + + while (i--) { + node = nodes[i]; + className = " " + node.attr("class") + " "; + + if (className.indexOf(editClass) !== -1) { + node.attr(internalName, "true"); + } else if (className.indexOf(nonEditClass) !== -1) { + node.attr(internalName, "false"); + } + } + }); + + // Remove internal name + ed.serializer.addAttributeFilter(internalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (nonEditableRegExps && node.attr('data-mce-content')) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = node.attr('data-mce-content'); + } else { + node.attr(externalName, null); + node.attr(internalName, null); + } + } + }); + + // Convert external name into internal name + ed.parser.addAttributeFilter(externalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr(internalName, node.attr(externalName)); + node.attr(externalName, null); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'Non editable elements', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js new file mode 100644 index 00000000..35085e8a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js new file mode 100644 index 00000000..a094c191 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -0,0 +1,74 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.PageBreakPlugin', { + init : function(ed, url) { + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + + pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); + + // Register commands + ed.addCommand('mcePageBreak', function() { + ed.execCommand('mceInsertContent', 0, pb); + }); + + // Register buttons + ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); + + ed.onInit.add(function() { + if (ed.theme.onResolveName) { + ed.theme.onResolveName.add(function(th, o) { + if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) + o.name = 'pagebreak'; + }); + } + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) + ed.selection.select(e); + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(pbRE, pb); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = o.content.replace(/]+>/g, function(im) { + if (im.indexOf('class="mcePageBreak') !== -1) + im = sep; + + return im; + }); + }); + }, + + getInfo : function() { + return { + longname : 'PageBreak', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css new file mode 100644 index 00000000..fca2dce9 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css @@ -0,0 +1,3 @@ +iframe { + border: none !important; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js new file mode 100644 index 00000000..0ab05ebb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"
            ")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

            "+o.encode(r).replace(/\r?\n\r?\n/g,"

            ").replace(/\r?\n/g,"
            ")+"

            "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g,"$1"]]);d([[/

            /g,"

            "],[/
            /g," "],[/

            /g,"
            "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

            $1

            ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

            "],[/<\/h[1-6][^>]*>/gi,"

            "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length"]])}else{if(f=="p"){e([[/\n+/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"]])}else{e([[/\n\n/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"],[/\n/g,"
            "]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js new file mode 100644 index 00000000..0154eceb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js @@ -0,0 +1,885 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, + defs = { + paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, + paste_block_drop : false, + paste_retain_style_properties : "none", + paste_strip_class_attributes : "mso", + paste_remove_spans : false, + paste_remove_styles : false, + paste_remove_styles_if_webkit : true, + paste_convert_middot_lists : true, + paste_convert_headers_to_strong : false, + paste_dialog_width : "450", + paste_dialog_height : "400", + paste_max_consecutive_linebreaks: 2, + paste_text_use_dialog : false, + paste_text_sticky : false, + paste_text_sticky_default : false, + paste_text_notifyalways : false, + paste_text_linebreaktype : "combined", + paste_text_replacements : [ + [/\u2026/g, "..."], + [/[\x93\x94\u201c\u201d]/g, '"'], + [/[\x60\x91\x92\u2018\u2019]/g, "'"] + ] + }; + + function getParam(ed, name) { + return ed.getParam(name, defs[name]); + } + + tinymce.create('tinymce.plugins.PastePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Setup plugin events + t.onPreProcess = new tinymce.util.Dispatcher(t); + t.onPostProcess = new tinymce.util.Dispatcher(t); + + // Register default handlers + t.onPreProcess.add(t._preProcess); + t.onPostProcess.add(t._postProcess); + + // Register optional preprocess handler + t.onPreProcess.add(function(pl, o) { + ed.execCallback('paste_preprocess', pl, o); + }); + + // Register optional postprocess + t.onPostProcess.add(function(pl, o) { + ed.execCallback('paste_postprocess', pl, o); + }); + + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + + // Initialize plain text flag + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); + + // This function executes the process handlers and inserts the contents + // force_rich overrides plain text mode set by user, important for pasting with execCommand + function process(o, force_rich) { + var dom = ed.dom, rng; + + // Execute pre process handlers + t.onPreProcess.dispatch(t, o); + + // Create DOM structure + o.node = dom.create('div', 0, o.content); + + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + + // Execute post process handlers + t.onPostProcess.dispatch(t, o); + + // Serialize content + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); + + // Plain text option active? + if ((!force_rich) && (ed.pasteAsPlainText)) { + t._insertPlainText(o.content); + + if (!getParam(ed, "paste_text_sticky")) { + ed.pasteAsPlainText = false; + ed.controlManager.setActive("pastetext", false); + } + } else { + t._insert(o.content); + } + } + + // Add command for external usage + ed.addCommand('mceInsertClipboardContent', function(u, o) { + process(o, true); + }); + + if (!getParam(ed, "paste_text_use_dialog")) { + ed.addCommand('mcePasteText', function(u, v) { + var cookie = tinymce.util.Cookie; + + ed.pasteAsPlainText = !ed.pasteAsPlainText; + ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); + + if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { + if (getParam(ed, "paste_text_sticky")) { + ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + } else { + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); + } + + if (!getParam(ed, "paste_text_notifyalways")) { + cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) + } + } + }); + } + + ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); + ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); + + // This function grabs the contents from the clipboard by adding a + // hidden div and placing the caret inside it and after the browser paste + // is done it grabs that contents and processes that + function grabContent(e) { + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; + + // Check if browser supports direct plaintext access + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
            ')}); + return; + } + } + + if (dom.get('_mcePaste')) + return; + + // Create container to paste into + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); + + // If contentEditable mode we need to find out the position of the closest element + if (body != ed.getDoc().body) + posY = dom.getPos(ed.selection.getStart(), body).y; + else + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; + + // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail + dom.setStyles(n, { + position : 'absolute', + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, + width : 1, + height : 1, + overflow : 'hidden' + }); + + if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + + // Select the container + rng = dom.doc.body.createTextRange(); + rng.moveToElementText(n); + rng.execCommand('Paste'); + + // Remove container + dom.remove(n); + + // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due + // to IE security settings so we pass the junk though better than nothing right + if (n.innerHTML === '\uFEFF\uFEFF') { + ed.execCommand('mcePasteWord'); + e.preventDefault(); + return; + } + + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); + + // Block the real paste event + return tinymce.dom.Event.cancel(e); + } else { + function block(e) { + e.preventDefault(); + }; + + // Block mousedown and click to prevent selection change + dom.bind(ed.getDoc(), 'mousedown', block); + dom.bind(ed.getDoc(), 'keydown', block); + + or = ed.selection.getRng(); + + // Move select contents inside DIV + n = n.firstChild; + rng = ed.getDoc().createRange(); + rng.setStart(n, 0); + rng.setEnd(n, 2); + sel.setRng(rng); + + // Wait a while and grab the pasted contents + window.setTimeout(function() { + var h = '', nl; + + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); + + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; + + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

            ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

            ').replace(/\r?\n/g, '
            ') + '

            '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + } + }); + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

            /g, '

            '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
            /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

            /g, '
            '] // Replace back the double brs but into a single BR + ]); + } + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

            $1

            "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

            "], + [/<\/h[1-6][^>]*>/gi, "

            "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(content) { + var ed = this.editor, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + content = content.replace(v, ""); + else + content = content.replace(v[0], v[1]); + }); + }; + + if ((typeof(content) === "string") && (content.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
            tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars. + ]); + + var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks")); + if (maxLinebreaks > -1) { + var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g"); + var linebreakReplacement = ""; + + while (linebreakReplacement.length < maxLinebreaks) { + linebreakReplacement += "\n"; + } + + process([ + [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks + ]); + } + + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); + + // Perform default or custom replacements + if (is(rl, "array")) { + process(rl); + } else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + // Convert all line breaks to space + process([ + [/\n+/g, " "] + ]); + } else if (linebr == "br") { + // Convert all line breaks to
            + process([ + [/\n/g, "
            "] + ]); + } else if (linebr == "p") { + // Convert all line breaks to

            ...

            + process([ + [/\n+/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
            and double line breaks to

            ...

            + process([ + [/\n\n/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'], + [/\n/g, "
            "] + ]); + } + + ed.execCommand('mceInsertContent', false, content); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js new file mode 100644 index 00000000..c524f9eb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

            ' + row + '

            '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js new file mode 100644 index 00000000..151f459f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js @@ -0,0 +1,51 @@ +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 44) + 'px'; + el.style.height = (vp.h - 190) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js new file mode 100644 index 00000000..84b9bc62 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.paste_dlg',{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js new file mode 100644 index 00000000..bc74daf8 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm new file mode 100644 index 00000000..88989da6 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm @@ -0,0 +1,33 @@ + + + {#paste.paste_text_desc} + + + + + +
            +
            {#paste.paste_text_desc}
            + +
            + +
            + +
            + +
            {#paste_dlg.text_title}
            + + + +
            +
            + +
            + +
            + +
            +
            +
            + + \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm new file mode 100644 index 00000000..4d497a98 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm @@ -0,0 +1,21 @@ + + + {#paste.paste_word_desc} + + + + + +
            +
            {#paste.paste_word_desc}
            +

            {#paste_dlg.word_title}

            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js new file mode 100644 index 00000000..0ab05ebb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"
            ")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

            "+o.encode(r).replace(/\r?\n\r?\n/g,"

            ").replace(/\r?\n/g,"
            ")+"

            "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g,"$1"]]);d([[/

            /g,"

            "],[/
            /g," "],[/

            /g,"
            "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

            $1

            ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

            "],[/<\/h[1-6][^>]*>/gi,"

            "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length"]])}else{if(f=="p"){e([[/\n+/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"]])}else{e([[/\n\n/g,"

            "],[/^(.*<\/p>)(

            )$/,"

            $1"],[/\n/g,"
            "]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js new file mode 100644 index 00000000..0154eceb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js @@ -0,0 +1,885 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, + defs = { + paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, + paste_block_drop : false, + paste_retain_style_properties : "none", + paste_strip_class_attributes : "mso", + paste_remove_spans : false, + paste_remove_styles : false, + paste_remove_styles_if_webkit : true, + paste_convert_middot_lists : true, + paste_convert_headers_to_strong : false, + paste_dialog_width : "450", + paste_dialog_height : "400", + paste_max_consecutive_linebreaks: 2, + paste_text_use_dialog : false, + paste_text_sticky : false, + paste_text_sticky_default : false, + paste_text_notifyalways : false, + paste_text_linebreaktype : "combined", + paste_text_replacements : [ + [/\u2026/g, "..."], + [/[\x93\x94\u201c\u201d]/g, '"'], + [/[\x60\x91\x92\u2018\u2019]/g, "'"] + ] + }; + + function getParam(ed, name) { + return ed.getParam(name, defs[name]); + } + + tinymce.create('tinymce.plugins.PastePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Setup plugin events + t.onPreProcess = new tinymce.util.Dispatcher(t); + t.onPostProcess = new tinymce.util.Dispatcher(t); + + // Register default handlers + t.onPreProcess.add(t._preProcess); + t.onPostProcess.add(t._postProcess); + + // Register optional preprocess handler + t.onPreProcess.add(function(pl, o) { + ed.execCallback('paste_preprocess', pl, o); + }); + + // Register optional postprocess + t.onPostProcess.add(function(pl, o) { + ed.execCallback('paste_postprocess', pl, o); + }); + + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + + // Initialize plain text flag + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); + + // This function executes the process handlers and inserts the contents + // force_rich overrides plain text mode set by user, important for pasting with execCommand + function process(o, force_rich) { + var dom = ed.dom, rng; + + // Execute pre process handlers + t.onPreProcess.dispatch(t, o); + + // Create DOM structure + o.node = dom.create('div', 0, o.content); + + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + + // Execute post process handlers + t.onPostProcess.dispatch(t, o); + + // Serialize content + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); + + // Plain text option active? + if ((!force_rich) && (ed.pasteAsPlainText)) { + t._insertPlainText(o.content); + + if (!getParam(ed, "paste_text_sticky")) { + ed.pasteAsPlainText = false; + ed.controlManager.setActive("pastetext", false); + } + } else { + t._insert(o.content); + } + } + + // Add command for external usage + ed.addCommand('mceInsertClipboardContent', function(u, o) { + process(o, true); + }); + + if (!getParam(ed, "paste_text_use_dialog")) { + ed.addCommand('mcePasteText', function(u, v) { + var cookie = tinymce.util.Cookie; + + ed.pasteAsPlainText = !ed.pasteAsPlainText; + ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); + + if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { + if (getParam(ed, "paste_text_sticky")) { + ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + } else { + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); + } + + if (!getParam(ed, "paste_text_notifyalways")) { + cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) + } + } + }); + } + + ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); + ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); + + // This function grabs the contents from the clipboard by adding a + // hidden div and placing the caret inside it and after the browser paste + // is done it grabs that contents and processes that + function grabContent(e) { + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; + + // Check if browser supports direct plaintext access + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
            ')}); + return; + } + } + + if (dom.get('_mcePaste')) + return; + + // Create container to paste into + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); + + // If contentEditable mode we need to find out the position of the closest element + if (body != ed.getDoc().body) + posY = dom.getPos(ed.selection.getStart(), body).y; + else + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; + + // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail + dom.setStyles(n, { + position : 'absolute', + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, + width : 1, + height : 1, + overflow : 'hidden' + }); + + if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + + // Select the container + rng = dom.doc.body.createTextRange(); + rng.moveToElementText(n); + rng.execCommand('Paste'); + + // Remove container + dom.remove(n); + + // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due + // to IE security settings so we pass the junk though better than nothing right + if (n.innerHTML === '\uFEFF\uFEFF') { + ed.execCommand('mcePasteWord'); + e.preventDefault(); + return; + } + + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); + + // Block the real paste event + return tinymce.dom.Event.cancel(e); + } else { + function block(e) { + e.preventDefault(); + }; + + // Block mousedown and click to prevent selection change + dom.bind(ed.getDoc(), 'mousedown', block); + dom.bind(ed.getDoc(), 'keydown', block); + + or = ed.selection.getRng(); + + // Move select contents inside DIV + n = n.firstChild; + rng = ed.getDoc().createRange(); + rng.setStart(n, 0); + rng.setEnd(n, 2); + sel.setRng(rng); + + // Wait a while and grab the pasted contents + window.setTimeout(function() { + var h = '', nl; + + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); + + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; + + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

            ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

            ').replace(/\r?\n/g, '
            ') + '

            '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + } + }); + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
             [\s\r\n]+|
            )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
             [\s\r\n]+|
            )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

            /g, '

            '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
            /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

            /g, '
            '] // Replace back the double brs but into a single BR + ]); + } + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

            ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

            $1

            "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

            "], + [/<\/h[1-6][^>]*>/gi, "

            "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(content) { + var ed = this.editor, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + content = content.replace(v, ""); + else + content = content.replace(v[0], v[1]); + }); + }; + + if ((typeof(content) === "string") && (content.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
            tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars. + ]); + + var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks")); + if (maxLinebreaks > -1) { + var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g"); + var linebreakReplacement = ""; + + while (linebreakReplacement.length < maxLinebreaks) { + linebreakReplacement += "\n"; + } + + process([ + [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks + ]); + } + + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); + + // Perform default or custom replacements + if (is(rl, "array")) { + process(rl); + } else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + // Convert all line breaks to space + process([ + [/\n+/g, " "] + ]); + } else if (linebr == "br") { + // Convert all line breaks to
            + process([ + [/\n/g, "
            "] + ]); + } else if (linebr == "p") { + // Convert all line breaks to

            ...

            + process([ + [/\n+/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
            and double line breaks to

            ...

            + process([ + [/\n\n/g, "

            "], + [/^(.*<\/p>)(

            )$/, '

            $1'], + [/\n/g, "
            "] + ]); + } + + ed.execCommand('mceInsertContent', false, content); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js new file mode 100644 index 00000000..c524f9eb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

            ' + row + '

            '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js new file mode 100644 index 00000000..a52731c3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js @@ -0,0 +1,51 @@ +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js new file mode 100644 index 00000000..84b9bc62 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.paste_dlg',{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js new file mode 100644 index 00000000..bc74daf8 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm new file mode 100644 index 00000000..b6559454 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm @@ -0,0 +1,27 @@ + + + {#paste.paste_text_desc} + + + + +
            +
            {#paste.paste_text_desc}
            + +
            + +
            + +
            + +
            {#paste_dlg.text_title}
            + + + +
            + + +
            +
            + + \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm new file mode 100644 index 00000000..0f6bb412 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm @@ -0,0 +1,21 @@ + + + {#paste.paste_word_desc} + + + + +
            +
            {#paste.paste_word_desc}
            + +
            {#paste_dlg.word_title}
            + +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js new file mode 100644 index 00000000..507909c5 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js new file mode 100644 index 00000000..80f00f0d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js @@ -0,0 +1,53 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Preview', { + init : function(ed, url) { + var t = this, css = tinymce.explode(ed.settings.content_css); + + t.editor = ed; + + // Force absolute CSS urls + tinymce.each(css, function(u, k) { + css[k] = ed.documentBaseURI.toAbsolute(u); + }); + + ed.addCommand('mcePreview', function() { + ed.windowManager.open({ + file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), + width : parseInt(ed.getParam("plugin_preview_width", "550")), + height : parseInt(ed.getParam("plugin_preview_height", "600")), + resizable : "yes", + scrollbars : "yes", + popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), + inline : ed.getParam("plugin_preview_inline", 1) + }, { + base : ed.documentBaseURI.getURI() + }); + }); + + ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); + }, + + getInfo : function() { + return { + longname : 'Preview', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('preview', tinymce.plugins.Preview); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/example.html b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/example.html new file mode 100644 index 00000000..b2c3d90c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/example.html @@ -0,0 +1,28 @@ + + + + + +Example of a custom preview page + + + +Editor contents:
            +
            + +
            + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ' + + + + + +{#preview.preview_desc} + + + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js new file mode 100644 index 00000000..b5b3a55e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js new file mode 100644 index 00000000..3933fe65 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js @@ -0,0 +1,34 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Print', { + init : function(ed, url) { + ed.addCommand('mcePrint', function() { + ed.getWin().print(); + }); + + ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); + }, + + getInfo : function() { + return { + longname : 'Print', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('print', tinymce.plugins.Print); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js new file mode 100644 index 00000000..8e939966 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js new file mode 100644 index 00000000..f5a3de8f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js @@ -0,0 +1,101 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Save', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceSave', t._save, t); + ed.addCommand('mceCancel', t._cancel, t); + + // Register buttons + ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); + ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); + + ed.onNodeChange.add(t._nodeChange, t); + ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); + }, + + getInfo : function() { + return { + longname : 'Save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var ed = this.editor; + + if (ed.getParam('save_enablewhendirty')) { + cm.setDisabled('save', !ed.isDirty()); + cm.setDisabled('cancel', !ed.isDirty()); + } + }, + + // Private methods + + _save : function() { + var ed = this.editor, formObj, os, i, elementId; + + formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); + + if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) + return; + + tinyMCE.triggerSave(); + + // Use callback instead + if (os = ed.getParam("save_onsavecallback")) { + if (ed.execCallback('save_onsavecallback', ed)) { + ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); + ed.nodeChanged(); + } + + return; + } + + if (formObj) { + ed.isNotDirty = true; + + if (formObj.onsubmit == null || formObj.onsubmit() != false) + formObj.submit(); + + ed.nodeChanged(); + } else + ed.windowManager.alert("Error: No form element found."); + }, + + _cancel : function() { + var ed = this.editor, os, h = tinymce.trim(ed.startContent); + + // Use callback instead + if (os = ed.getParam("save_oncancelcallback")) { + ed.execCallback('save_oncancelcallback', ed); + return; + } + + ed.setContent(h); + ed.undoManager.clear(); + ed.nodeChanged(); + } + }); + + // Register plugin + tinymce.PluginManager.add('save', tinymce.plugins.Save); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css new file mode 100644 index 00000000..ecdf58c7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js new file mode 100644 index 00000000..165bc12d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js new file mode 100644 index 00000000..4c87e8fa --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js new file mode 100644 index 00000000..80284b9f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -0,0 +1,142 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js new file mode 100644 index 00000000..7c40acd9 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{findwhat:"Zu suchender Text",replacewith:"Ersetzen durch",direction:"Suchrichtung",up:"Aufw\u00e4rts",down:"Abw\u00e4rts",mcase:"Gro\u00df-/Kleinschreibung beachten",findnext:"Weitersuchen",allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.","searchnext_desc":"Weitersuchen",notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.","search_title":"Suchen","replace_title":"Suchen/Ersetzen",replaceall:"Alle ersetzen",replace:"Ersetzen"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js new file mode 100644 index 00000000..8a659009 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm new file mode 100644 index 00000000..d37ed8a0 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -0,0 +1,101 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
            + + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + + + + +
            +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            + + + + +
            +
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            + +
            +
            +
              +
            • +
            • +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css new file mode 100644 index 00000000..ecdf58c7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js new file mode 100644 index 00000000..165bc12d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js new file mode 100644 index 00000000..4c87e8fa --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js new file mode 100644 index 00000000..80284b9f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js @@ -0,0 +1,142 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js new file mode 100644 index 00000000..7c40acd9 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{findwhat:"Zu suchender Text",replacewith:"Ersetzen durch",direction:"Suchrichtung",up:"Aufw\u00e4rts",down:"Abw\u00e4rts",mcase:"Gro\u00df-/Kleinschreibung beachten",findnext:"Weitersuchen",allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.","searchnext_desc":"Weitersuchen",notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.","search_title":"Suchen","replace_title":"Suchen/Ersetzen",replaceall:"Alle ersetzen",replace:"Ersetzen"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js new file mode 100644 index 00000000..8a659009 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm new file mode 100644 index 00000000..2443a918 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm @@ -0,0 +1,100 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
            + + +
            +
            + + + + + + + + + + + +
            + + + + + + + + + +
            + + + + + +
            +
            +
            + +
            + + + + + + + + + + + + + + + +
            + + + + + + + + + +
            + + + + + +
            +
            +
            + +
            + +
            + + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css new file mode 100644 index 00000000..24efa021 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css @@ -0,0 +1 @@ +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js new file mode 100644 index 00000000..48549c92 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}\u201d\u201c');for(d=0;d$2");while((s=p.indexOf(""))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(g.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(g.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(g.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(f,'$1$2')}g.replace(q,t)}});i.setRng(d)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js new file mode 100644 index 00000000..86fdfceb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js @@ -0,0 +1,436 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.SpellcheckerPlugin', { + getInfo : function() { + return { + longname : 'Spellchecker', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + init : function(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); + + if (t.rpcUrl == '{backend}') { + // Sniff if the browser supports native spellchecking (Don't know of a better way) + if (tinymce.isIE) + return; + + t.hasSupport = true; + + // Disable the context menu when spellchecking is active + ed.onContextMenu.addToTop(function(ed, e) { + if (t.active) + return false; + }); + } + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (t.rpcUrl == '{backend}') { + // Enable/disable native spellchecker + t.editor.getBody().spellcheck = t.active = !t.active; + return; + } + + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + + if (ed.getParam('spellchecker_report_no_misspellings', true)) + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + if (ed.settings.content_css !== false) + ed.contentCSS.push(url + '/css/content.css'); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + // Use basic button if we use the native spellchecker + if (t.rpcUrl == '{backend}') { + // Create simple toggle button if we have native support + if (t.hasSupport) + c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + return c; + } + + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + if (v == t.selectedLang) { + return; + } + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); + + // Build word separator regexp + for (i=0; i elements content is broken after spellchecking. + // Bug #1408: Preceding whitespace characters are removed + // @TODO: I'm not sure that both are still issues on IE9. + if (tinymce.isIE) { + // Enclose mispelled words with temporal tag + v = v.replace(rx, '$1$2'); + // Loop over the content finding mispelled words + while ((pos = v.indexOf('')) != -1) { + // Add text node for the content before the word + txt = v.substring(0, pos); + if (txt.length) { + node = doc.createTextNode(dom.decode(txt)); + elem.appendChild(node); + } + v = v.substring(pos+10); + pos = v.indexOf(''); + txt = v.substring(0, pos); + v = v.substring(pos+11); + // Add span element for the word + elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); + } + // Add text node for the rest of the content + if (v.length) { + node = doc.createTextNode(dom.decode(v)); + elem.appendChild(node); + } + } else { + // Other browsers preserve whitespace characters on innerHTML usage + elem.innerHTML = v.replace(rx, '$1$2'); + } + + // Finally, replace the node with the container + dom.replace(elem, n); + } + }); + + se.setRng(r); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; + + e = 0; // Fixes IE memory leak + + if (!m) { + m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); + t._menu = m; + } + + if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { + var ignoreRpc; + + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), wordSpan); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + if (ed.getParam('show_ignore_words', true)) { + ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + var word = wordSpan.innerHTML; + + t._removeWords(dom.decode(word)); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + } + + if (t.editor.getParam("spellchecker_enable_learn_rpc")) { + m.add({ + title : 'spellchecker.learn_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + ed.setProgressState(1); + t._sendRPC('learnWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + }); + } + + m.update(); + }); + + p1 = DOM.getPos(ed.getContentAreaContainer()); + m.settings.offset_x = p1.x; + m.settings.offset_y = p1.y; + + ed.selection.select(wordSpan); + p1 = dom.getPos(wordSpan); + m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this; + + JSONRequest.sendRPC({ + url : t.rpcUrl, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif new file mode 100644 index 00000000..7d0a4dbc Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/css/props.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/css/props.css new file mode 100644 index 00000000..3b8f0ee7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/css/props.css @@ -0,0 +1,14 @@ +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_toggle_insert_span {padding-top:10px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js new file mode 100644 index 00000000..dda9f928 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){var c=false;var f=a.selection.getSelectedBlocks();var d=[];if(f.length===1){d.push(a.selection.getNode().style.cssText)}else{tinymce.each(f,function(g){d.push(a.dom.getAttrib(g,"style"))});c=true}a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:340+parseInt(a.getLang("style.delta_height",0)),inline:1},{applyStyleToBlocks:c,plugin_url:b,styles:d})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js new file mode 100644 index 00000000..eaa7c771 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js @@ -0,0 +1,71 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + + var applyStyleToBlocks = false; + var blocks = ed.selection.getSelectedBlocks(); + var styles = []; + + if (blocks.length === 1) { + styles.push(ed.selection.getNode().style.cssText); + } + else { + tinymce.each(blocks, function(block) { + styles.push(ed.dom.getAttrib(block, 'style')); + }); + applyStyleToBlocks = true; + } + + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 340 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + applyStyleToBlocks : applyStyleToBlocks, + plugin_url : url, + styles : styles + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); + }, + + getInfo : function() { + return { + longname : 'Style', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/js/props.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/js/props.js new file mode 100644 index 00000000..0a8a8ec3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/js/props.js @@ -0,0 +1,709 @@ +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function aggregateStyles(allStyles) { + var mergedStyles = {}; + + tinymce.each(allStyles, function(style) { + if (style !== '') { + var parsedStyles = tinyMCEPopup.editor.dom.parseStyle(style); + for (var name in parsedStyles) { + if (parsedStyles.hasOwnProperty(name)) { + if (mergedStyles[name] === undefined) { + mergedStyles[name] = parsedStyles[name]; + } + else if (name === 'text-decoration') { + if (mergedStyles[name].indexOf(parsedStyles[name]) === -1) { + mergedStyles[name] = mergedStyles[name] +' '+ parsedStyles[name]; + } + } + } + } + } + }); + + return mergedStyles; +} + +var applyActionIsInsert; +var existingStyles; + +function init(ed) { + var ce = document.getElementById('container'), h; + + existingStyles = aggregateStyles(tinyMCEPopup.getWindowArg('styles')); + ce.style.cssText = tinyMCEPopup.editor.dom.serializeStyle(existingStyles); + + applyActionIsInsert = ed.getParam("edit_css_style_insert_span", false); + document.getElementById('toggle_insert_span').checked = applyActionIsInsert; + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + f.text_none.checked = inStr(ce.style.textDecoration, 'none'); + updateTextDecorations(); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9.]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) + return s.replace(/[^0-9.]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +function updateTextDecorations(){ + var el = document.forms[0].elements; + + var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"]; + var noneChecked = el["text_none"].checked; + tinymce.each(textDecorations, function(id) { + el[id].disabled = noneChecked; + if (noneChecked) { + el[id].checked = false; + } + }); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js new file mode 100644 index 00000000..ad04664e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.style_dlg',{"text_lineheight":"Zeilenh\u00f6he","text_variant":"Variante","text_style":"Stil","text_weight":"Dicke","text_size":"Gr\u00f6\u00dfe","text_font":"Schriftart","text_props":"Text","positioning_tab":"Positionierung","list_tab":"Liste","border_tab":"Rahmen","box_tab":"Box","block_tab":"Block","background_tab":"Hintergrund","text_tab":"Text",apply:"\u00dcbernehmen",title:"CSS-Styles bearbeiten",clip:"Ausschnitt",placement:"Platzierung",overflow:"Verhalten bei \u00dcbergr\u00f6\u00dfe",zindex:"Z-Wert",visibility:"Sichtbar","positioning_type":"Art der Positionierung",position:"Positionierung","bullet_image":"Listenpunkt-Grafik","list_type":"Listenpunkt-Art",color:"Textfarbe",height:"H\u00f6he",width:"Breite",style:"Format",margin:"\u00c4u\u00dferer Abstand",left:"Links",bottom:"Unten",right:"Rechts",top:"Oben",same:"Alle gleich",padding:"Innerer Abstand","box_clear":"Umflie\u00dfung verhindern","box_float":"Umflie\u00dfung","box_height":"H\u00f6he","box_width":"Breite","block_display":"Umbruchverhalten","block_whitespace":"Automatischer Umbruch","block_text_indent":"Einr\u00fcckung","block_text_align":"Ausrichtung","block_vertical_alignment":"Vertikale Ausrichtung","block_letterspacing":"Buchstabenabstand","block_wordspacing":"Wortabstand","background_vpos":"Position Y","background_hpos":"Position X","background_attachment":"Wasserzeicheneffekt","background_repeat":"Wiederholung","background_image":"Hintergrundbild","background_color":"Hintergrundfarbe","text_none":"keine","text_blink":"blinkend","text_case":"Schreibung","text_striketrough":"durchgestrichen","text_underline":"unterstrichen","text_overline":"\u00fcberstrichen","text_decoration":"Gestaltung","text_color":"Farbe",text:"Text",background:"Hintergrund",block:"Block",box:"Box",border:"Rahmen",list:"Liste"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js new file mode 100644 index 00000000..35881b3a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/props.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/props.htm new file mode 100644 index 00000000..7dc087a3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/props.htm @@ -0,0 +1,845 @@ + + + + {#style_dlg.title} + + + + + + + + + + +
            + + +
            +
            +
            + {#style_dlg.text} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + + + + + + +
              + + +
            +
            + +
            + + + +
            + + + + + + +
            + +   + + +
            +
            + +
            + + + + + +
             
            +
            {#style_dlg.text_decoration} + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.background} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + +
             
            +
            + + + + +
             
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.block} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.box} + + + + + + + + + + + + + + +
            + + + + + + +
              + + +
            +
               
            + + + + + + +
              + + +
            +
               
            +
            + +
            +
            + {#style_dlg.padding} + + + + + + + + + + + + + + + + + + + + + + +
             
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.margin} + + + + + + + + + + + + + + + + + + + + + + +
             
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            + + + + + + +
              + + +
            +
            +
            +
            +
            +
            + +
            +
            + {#style_dlg.border} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
                  
            {#style_dlg.top}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            {#style_dlg.right}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            {#style_dlg.bottom}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            {#style_dlg.left}   + + + + + + +
              + + +
            +
              + + + + + +
             
            +
            +
            +
            + +
            +
            + {#style_dlg.list} + + + + + + + + + + + + + + + +
            +
            +
            + +
            +
            + {#style_dlg.position} + + + + + + + + + + + + + + + + + + + + + +
               
            + + + + + + +
              + + +
            +
               
            + + + + + + +
              + + +
            +
               
            +
            + +
            +
            + {#style_dlg.placement} + + + + + + + + + + + + + + + + + + + + + + +
             
            {#style_dlg.top} + + + + + + +
              + + +
            +
            {#style_dlg.right} + + + + + + +
              + + +
            +
            {#style_dlg.bottom} + + + + + + +
              + + +
            +
            {#style_dlg.left} + + + + + + +
              + + +
            +
            +
            +
            + +
            +
            + {#style_dlg.clip} + + + + + + + + + + + + + + + + + + + + + + +
             
            {#style_dlg.top} + + + + + + +
              + + +
            +
            {#style_dlg.right} + + + + + + +
              + + +
            +
            {#style_dlg.bottom} + + + + + + +
              + + +
            +
            {#style_dlg.left} + + + + + + +
              + + +
            +
            +
            +
            +
            +
            +
            + +
            + + +
            + +
            + + + +
            +
            + +
            +
            +
            + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/readme.txt b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/readme.txt new file mode 100644 index 00000000..5bac3020 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/style/readme.txt @@ -0,0 +1,19 @@ +Edit CSS Style plug-in notes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Unlike WYSIWYG editor functionality that operates only on the selected text, +typically by inserting new HTML elements with the specified styles. +This plug-in operates on the HTML blocks surrounding the selected text. +No new HTML elements are created. + +This plug-in only operates on the surrounding blocks and not the nearest +parent node. This means that if a block encapsulates a node, +e.g

            text

            , then only the styles in the block are +recognized, not those in the span. + +When selecting text that includes multiple blocks at the same level (peers), +this plug-in accumulates the specified styles in all of the surrounding blocks +and populates the dialogue checkboxes accordingly. There is no differentiation +between styles set in all the blocks versus styles set in some of the blocks. + +When the [Update] or [Apply] buttons are pressed, the styles selected in the +checkboxes are applied to all blocks that surround the selected text. diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js new file mode 100644 index 00000000..2c512916 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]:not(iframe)");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js new file mode 100644 index 00000000..94f45320 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js @@ -0,0 +1,122 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; + + tinymce.create('tinymce.plugins.TabFocusPlugin', { + init : function(ed, url) { + function tabCancel(ed, e) { + if (e.keyCode === 9) + return Event.cancel(e); + } + + function tabHandler(ed, e) { + var x, i, f, el, v; + + function find(d) { + el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); + + function canSelectRecursive(e) { + return e.nodeName==="BODY" || (e.type != 'hidden' && + !(e.style.display == "none") && + !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); + } + function canSelectInOldIe(el) { + return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; + } + function isOldIe() { + return tinymce.isIE6 || tinymce.isIE7; + } + function canSelect(el) { + return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); + } + + each(el, function(e, i) { + if (e.id == ed.id) { + x = i; + return false; + } + }); + if (d > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) + return el[i]; + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) + return el[i]; + } + } + + return null; + } + + if (e.keyCode === 9) { + v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); + + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') + el = find(-1); + else + el = DOM.get(v[0]); + } else { + if (v[1] == ':next') + el = find(1); + else + el = DOM.get(v[1]); + } + + if (el) { + if (el.id && (ed = tinymce.get(el.id || el.name))) + ed.focus(); + else + window.setTimeout(function() { + if (!tinymce.isWebKit) + window.focus(); + el.focus(); + }, 10); + + return Event.cancel(e); + } + } + } + + ed.onKeyUp.add(tabCancel); + + if (tinymce.isGecko) { + ed.onKeyPress.add(tabHandler); + ed.onKeyDown.add(tabCancel); + } else + ed.onKeyDown.add(tabHandler); + + }, + + getInfo : function() { + return { + longname : 'Tabfocus', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/cell.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/cell.htm new file mode 100644 index 00000000..a72a8d69 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/cell.htm @@ -0,0 +1,180 @@ + + + + {#table_dlg.cell_title} + + + + + + + + + +
            + + +
            +
            +
            + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + +
            + + + +
            + +
            +
            +
            + +
            +
            + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            + + + + + +
             
            +
            +
            +
            +
            + +
            +
            + +
            + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css new file mode 100644 index 00000000..a067ecdf --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css @@ -0,0 +1,17 @@ +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; +} \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/row.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/row.css new file mode 100644 index 00000000..1f7755da --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/row.css @@ -0,0 +1,25 @@ +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/table.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/table.css new file mode 100644 index 00000000..d11c3f69 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/css/table.css @@ -0,0 +1,13 @@ +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js new file mode 100644 index 00000000..4a35a5ef --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js @@ -0,0 +1 @@ +(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='
            '}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){if(!O){return}var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE?" ":'
            ')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js new file mode 100644 index 00000000..532b79c6 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js @@ -0,0 +1,1456 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var each = tinymce.each; + + // Checks if the selection/caret is at the start of the specified block element + function isAtStart(rng, par) { + var doc = par.ownerDocument, rng2 = doc.createRange(), elm; + + rng2.setStartBefore(par); + rng2.setEnd(rng.endContainer, rng.endOffset); + + elm = doc.createElement('body'); + elm.appendChild(rng2.cloneContents()); + + // Check for text characters of other elements that should be treated as content + return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; + }; + + function getSpanVal(td, name) { + return parseInt(td.getAttribute(name) || 1); + } + + /** + * Table Grid class. + */ + function TableGrid(table, dom, selection) { + var grid, startPos, endPos, selectedCell; + + buildGrid(); + selectedCell = dom.getParent(selection.getStart(), 'th,td'); + if (selectedCell) { + startPos = getPos(selectedCell); + endPos = findEndPos(); + selectedCell = getCell(startPos.x, startPos.y); + } + + function cloneNode(node, children) { + node = node.cloneNode(children); + node.removeAttribute('id'); + + return node; + } + + function buildGrid() { + var startY = 0; + + grid = []; + + each(['thead', 'tbody', 'tfoot'], function(part) { + var rows = dom.select('> ' + part + ' tr', table); + + each(rows, function(tr, y) { + y += startY; + + each(dom.select('> td, > th', tr), function(td, x) { + var x2, y2, rowspan, colspan; + + // Skip over existing cells produced by rowspan + if (grid[y]) { + while (grid[y][x]) + x++; + } + + // Get col/rowspan from cell + rowspan = getSpanVal(td, 'rowspan'); + colspan = getSpanVal(td, 'colspan'); + + // Fill out rowspan/colspan right and down + for (y2 = y; y2 < y + rowspan; y2++) { + if (!grid[y2]) + grid[y2] = []; + + for (x2 = x; x2 < x + colspan; x2++) { + grid[y2][x2] = { + part : part, + real : y2 == y && x2 == x, + elm : td, + rowspan : rowspan, + colspan : colspan + }; + } + } + }); + }); + + startY += rows.length; + }); + }; + + function getCell(x, y) { + var row; + + row = grid[y]; + if (row) + return row[x]; + }; + + function setSpanVal(td, name, val) { + if (td) { + val = parseInt(val); + + if (val === 1) + td.removeAttribute(name, 1); + else + td.setAttribute(name, val, 1); + } + } + + function isCellSelected(cell) { + return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); + }; + + function getSelectedRows() { + var rows = []; + + each(table.rows, function(row) { + each(row.cells, function(cell) { + if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { + rows.push(row); + return false; + } + }); + }); + + return rows; + }; + + function deleteTable() { + var rng = dom.createRng(); + + rng.setStartAfter(table); + rng.setEndAfter(table); + + selection.setRng(rng); + + dom.remove(table); + }; + + function cloneCell(cell) { + var formatNode; + + // Clone formats + tinymce.walk(cell, function(node) { + var curNode; + + if (node.nodeType == 3) { + each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { + node = cloneNode(node, false); + + if (!formatNode) + formatNode = curNode = node; + else if (curNode) + curNode.appendChild(node); + + curNode = node; + }); + + // Add something to the inner node + if (curNode) + curNode.innerHTML = tinymce.isIE ? ' ' : '
            '; + + return false; + } + }, 'childNodes'); + + cell = cloneNode(cell, false); + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + if (formatNode) { + cell.appendChild(formatNode); + } else { + if (!tinymce.isIE) + cell.innerHTML = '
            '; + } + + return cell; + }; + + function cleanup() { + var rng = dom.createRng(); + + // Empty rows + each(dom.select('tr', table), function(tr) { + if (tr.cells.length == 0) + dom.remove(tr); + }); + + // Empty table + if (dom.select('tr', table).length == 0) { + rng.setStartAfter(table); + rng.setEndAfter(table); + selection.setRng(rng); + dom.remove(table); + return; + } + + // Empty header/body/footer + each(dom.select('thead,tbody,tfoot', table), function(part) { + if (part.rows.length == 0) + dom.remove(part); + }); + + // Restore selection to start position if it still exists + buildGrid(); + + // Restore the selection to the closest table position + row = grid[Math.min(grid.length - 1, startPos.y)]; + if (row) { + selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); + selection.collapse(true); + } + }; + + function fillLeftDown(x, y, rows, cols) { + var tr, x2, r, c, cell; + + tr = grid[y][x].elm.parentNode; + for (r = 1; r <= rows; r++) { + tr = dom.getNext(tr, 'tr'); + + if (tr) { + // Loop left to find real cell + for (x2 = x; x2 >= 0; x2--) { + cell = grid[y + r][x2].elm; + + if (cell.parentNode == tr) { + // Append clones after + for (c = 1; c <= cols; c++) + dom.insertAfter(cloneCell(cell), cell); + + break; + } + } + + if (x2 == -1) { + // Insert nodes before first cell + for (c = 1; c <= cols; c++) + tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); + } + } + } + }; + + function split() { + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan, newCell, i; + + if (isCellSelected(cell)) { + cell = cell.elm; + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan > 1 || rowSpan > 1) { + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + // Insert cells right + for (i = 0; i < colSpan - 1; i++) + dom.insertAfter(cloneCell(cell), cell); + + fillLeftDown(x, y, rowSpan - 1, colSpan); + } + } + }); + }); + }; + + function merge(cell, cols, rows) { + var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; + + // Use specified cell and cols/rows + if (cell) { + pos = getPos(cell); + startX = pos.x; + startY = pos.y; + endX = startX + (cols - 1); + endY = startY + (rows - 1); + } else { + startPos = endPos = null; + + // Calculate start/end pos by checking for selected cells in grid works better with context menu + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + if (!startPos) { + startPos = {x: x, y: y}; + } + + endPos = {x: x, y: y}; + } + }); + }); + + // Use selection + startX = startPos.x; + startY = startPos.y; + endX = endPos.x; + endY = endPos.y; + } + + // Find start/end cells + startCell = getCell(startX, startY); + endCell = getCell(endX, endY); + + // Check if the cells exists and if they are of the same part for example tbody = tbody + if (startCell && endCell && startCell.part == endCell.part) { + // Split and rebuild grid + split(); + buildGrid(); + + // Set row/col span to start cell + startCell = getCell(startX, startY).elm; + setSpanVal(startCell, 'colSpan', (endX - startX) + 1); + setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); + + // Remove other cells and add it's contents to the start cell + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + if (!grid[y] || !grid[y][x]) + continue; + + cell = grid[y][x].elm; + + if (cell != startCell) { + // Move children to startCell + children = tinymce.grep(cell.childNodes); + each(children, function(node) { + startCell.appendChild(node); + }); + + // Remove bogus nodes if there is children in the target cell + if (children.length) { + children = tinymce.grep(startCell.childNodes); + count = 0; + each(children, function(node) { + if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) + startCell.removeChild(node); + }); + } + + // Remove cell + dom.remove(cell); + } + } + } + + // Remove empty rows etc and restore caret location + cleanup(); + } + }; + + function insertRow(before) { + var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; + + // Find first/last row + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + cell = cell.elm; + rowElm = cell.parentNode; + newRow = cloneNode(rowElm, false); + posY = y; + + if (before) + return false; + } + }); + + if (before) + return !posY; + }); + + for (x = 0; x < grid[0].length; x++) { + // Cell not found could be because of an invalid table structure + if (!grid[posY][x]) + continue; + + cell = grid[posY][x].elm; + + if (cell != lastCell) { + if (!before) { + rowSpan = getSpanVal(cell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan + 1); + continue; + } + } else { + // Check if cell above can be expanded + if (posY > 0 && grid[posY - 1][x]) { + otherCell = grid[posY - 1][x].elm; + rowSpan = getSpanVal(otherCell, 'rowSpan'); + if (rowSpan > 1) { + setSpanVal(otherCell, 'rowSpan', rowSpan + 1); + continue; + } + } + } + + // Insert new cell into new row + newCell = cloneCell(cell); + setSpanVal(newCell, 'colSpan', cell.colSpan); + + newRow.appendChild(newCell); + + lastCell = cell; + } + } + + if (newRow.hasChildNodes()) { + if (!before) + dom.insertAfter(newRow, rowElm); + else + rowElm.parentNode.insertBefore(newRow, rowElm); + } + }; + + function insertCol(before) { + var posX, lastCell; + + // Find first/last column + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + posX = x; + + if (before) + return false; + } + }); + + if (before) + return !posX; + }); + + each(grid, function(row, y) { + var cell, rowSpan, colSpan; + + if (!row[posX]) + return; + + cell = row[posX].elm; + if (cell != lastCell) { + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan == 1) { + if (!before) { + dom.insertAfter(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } else { + cell.parentNode.insertBefore(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } + } else + setSpanVal(cell, 'colSpan', cell.colSpan + 1); + + lastCell = cell; + } + }); + }; + + function deleteCols() { + var cols = []; + + // Get selected column indexes + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { + each(grid, function(row) { + var cell = row[x].elm, colSpan; + + colSpan = getSpanVal(cell, 'colSpan'); + + if (colSpan > 1) + setSpanVal(cell, 'colSpan', colSpan - 1); + else + dom.remove(cell); + }); + + cols.push(x); + } + }); + }); + + cleanup(); + }; + + function deleteRows() { + var rows; + + function deleteRow(tr) { + var nextTr, pos, lastCell; + + nextTr = dom.getNext(tr, 'tr'); + + // Move down row spanned cells + each(tr.cells, function(cell) { + var rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan - 1); + pos = getPos(cell); + fillLeftDown(pos.x, pos.y, 1, 1); + } + }); + + // Delete cells + pos = getPos(tr.cells[0]); + each(grid[pos.y], function(cell) { + var rowSpan; + + cell = cell.elm; + + if (cell != lastCell) { + rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan <= 1) + dom.remove(cell); + else + setSpanVal(cell, 'rowSpan', rowSpan - 1); + + lastCell = cell; + } + }); + }; + + // Get selected rows and move selection out of scope + rows = getSelectedRows(); + + // Delete all selected rows + each(rows.reverse(), function(tr) { + deleteRow(tr); + }); + + cleanup(); + }; + + function cutRows() { + var rows = getSelectedRows(); + + dom.remove(rows); + cleanup(); + + return rows; + }; + + function copyRows() { + var rows = getSelectedRows(); + + each(rows, function(row, i) { + rows[i] = cloneNode(row, true); + }); + + return rows; + }; + + function pasteRows(rows, before) { + // If we don't have any rows in the clipboard, return immediately + if(!rows) + return; + + var selectedRows = getSelectedRows(), + targetRow = selectedRows[before ? 0 : selectedRows.length - 1], + targetCellCount = targetRow.cells.length; + + // Calc target cell count + each(grid, function(row) { + var match; + + targetCellCount = 0; + each(row, function(cell, x) { + if (cell.real) + targetCellCount += cell.colspan; + + if (cell.elm.parentNode == targetRow) + match = 1; + }); + + if (match) + return false; + }); + + if (!before) + rows.reverse(); + + each(rows, function(row) { + var cellCount = row.cells.length, cell; + + // Remove col/rowspans + for (i = 0; i < cellCount; i++) { + cell = row.cells[i]; + setSpanVal(cell, 'colSpan', 1); + setSpanVal(cell, 'rowSpan', 1); + } + + // Needs more cells + for (i = cellCount; i < targetCellCount; i++) + row.appendChild(cloneCell(row.cells[cellCount - 1])); + + // Needs less cells + for (i = targetCellCount; i < cellCount; i++) + dom.remove(row.cells[i]); + + // Add before/after + if (before) + targetRow.parentNode.insertBefore(row, targetRow); + else + dom.insertAfter(row, targetRow); + }); + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + }; + + function getPos(target) { + var pos; + + each(grid, function(row, y) { + each(row, function(cell, x) { + if (cell.elm == target) { + pos = {x : x, y : y}; + return false; + } + }); + + return !pos; + }); + + return pos; + }; + + function setStartCell(cell) { + startPos = getPos(cell); + }; + + function findEndPos() { + var pos, maxX, maxY; + + maxX = maxY = 0; + + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan; + + if (isCellSelected(cell)) { + cell = grid[y][x]; + + if (x > maxX) + maxX = x; + + if (y > maxY) + maxY = y; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + }); + }); + + return {x : maxX, y : maxY}; + }; + + function setEndCell(cell) { + var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; + + endPos = getPos(cell); + + if (startPos && endPos) { + // Get start/end positions + startX = Math.min(startPos.x, endPos.x); + startY = Math.min(startPos.y, endPos.y); + endX = Math.max(startPos.x, endPos.x); + endY = Math.max(startPos.y, endPos.y); + + // Expand end positon to include spans + maxX = endX; + maxY = endY; + + // Expand startX + for (y = startY; y <= maxY; y++) { + cell = grid[y][startX]; + + if (!cell.real) { + if (startX - (cell.colspan - 1) < startX) + startX -= cell.colspan - 1; + } + } + + // Expand startY + for (x = startX; x <= maxX; x++) { + cell = grid[startY][x]; + + if (!cell.real) { + if (startY - (cell.rowspan - 1) < startY) + startY -= cell.rowspan - 1; + } + } + + // Find max X, Y + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + cell = grid[y][x]; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + } + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + + // Add new selection + for (y = startY; y <= maxY; y++) { + for (x = startX; x <= maxX; x++) { + if (grid[y][x]) + dom.addClass(grid[y][x].elm, 'mceSelected'); + } + } + } + }; + + // Expose to public + tinymce.extend(this, { + deleteTable : deleteTable, + split : split, + merge : merge, + insertRow : insertRow, + insertCol : insertCol, + deleteCols : deleteCols, + deleteRows : deleteRows, + cutRows : cutRows, + copyRows : copyRows, + pasteRows : pasteRows, + getPos : getPos, + setStartCell : setStartCell, + setEndCell : setEndCell + }); + }; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload + + function createTableGrid(node) { + var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); + + if (tblElm) + return new TableGrid(tblElm, ed.dom, selection); + }; + + function cleanup() { + // Restore selection possibilities + ed.getBody().style.webkitUserSelect = ''; + + if (hasCellSelection) { + ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + hasCellSelection = false; + } + }; + + // Register buttons + each([ + ['table', 'table.desc', 'mceInsertTable', true], + ['delete_table', 'table.del', 'mceTableDelete'], + ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table.row_desc', 'mceTableRowProps', true], + ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] + ], function(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') { + ed.selection.select(e); + ed.nodeChanged(); + } + }); + } + + ed.onPreProcess.add(function(ed, args) { + var nodes, i, node, dom = ed.dom, value; + + nodes = dom.select('table', args.node); + i = nodes.length; + while (i--) { + node = nodes[i]; + dom.setAttrib(node, 'data-mce-style', ''); + + if ((value = dom.getAttrib(node, 'width'))) { + dom.setStyle(node, 'width', value); + dom.setAttrib(node, 'width', ''); + } + + if ((value = dom.getAttrib(node, 'height'))) { + dom.setStyle(node, 'height', value); + dom.setAttrib(node, 'height', ''); + } + } + }); + + // Handle node change updates + ed.onNodeChange.add(function(ed, cm, n) { + var p; + + n = ed.selection.getStart(); + p = ed.dom.getParent(n, 'td,th,caption'); + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + + // Disable table tools if we are in caption + if (p && p.nodeName === 'CAPTION') + p = 0; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p); + cm.setDisabled('merge_cells', !p); + }); + + ed.onInit.add(function(ed) { + var startTable, startCell, dom = ed.dom, tableGrid; + + winMan = ed.windowManager; + + // Add cell selection logic + ed.onMouseDown.add(function(ed, e) { + if (e.button != 2) { + cleanup(); + + startCell = dom.getParent(e.target, 'td,th'); + startTable = dom.getParent(startCell, 'table'); + } + }); + + dom.bind(ed.getDoc(), 'mouseover', function(e) { + var sel, table, target = e.target; + + if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { + table = dom.getParent(target, 'table'); + if (table == startTable) { + if (!tableGrid) { + tableGrid = createTableGrid(table); + tableGrid.setStartCell(startCell); + + ed.getBody().style.webkitUserSelect = 'none'; + } + + tableGrid.setEndCell(target); + hasCellSelection = true; + } + + // Remove current selection + sel = ed.selection.getSel(); + + try { + if (sel.removeAllRanges) + sel.removeAllRanges(); + else + sel.empty(); + } catch (ex) { + // IE9 might throw errors here + } + + e.preventDefault(); + } + }); + + ed.onMouseUp.add(function(ed, e) { + var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; + + // Move selection to startCell + if (startCell) { + if (tableGrid) + ed.getBody().style.webkitUserSelect = ''; + + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + } + + // Try to expand text selection as much as we can only Gecko supports cell selection + selectedCells = dom.select('td.mceSelected,th.mceSelected'); + if (selectedCells.length > 0) { + rng = dom.createRng(); + node = selectedCells[0]; + endNode = selectedCells[selectedCells.length - 1]; + rng.setStartBefore(node); + rng.setEndAfter(node); + + setPoint(node, 1); + walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); + + do { + if (node.nodeName == 'TD' || node.nodeName == 'TH') { + if (!dom.hasClass(node, 'mceSelected')) + break; + + lastNode = node; + } + } while (node = walker.next()); + + setPoint(lastNode); + + sel.setRng(rng); + } + + ed.nodeChanged(); + startCell = tableGrid = startTable = null; + } + }); + + ed.onKeyUp.add(function(ed, e) { + cleanup(); + }); + + ed.onKeyDown.add(function (ed, e) { + fixTableCellSelection(ed); + }); + + ed.onMouseDown.add(function (ed, e) { + if (e.button != 2) { + fixTableCellSelection(ed); + } + }); + function tableCellSelected(ed, rng, n, currentCell) { + // The decision of when a table cell is selected is somewhat involved. The fact that this code is + // required is actually a pointer to the root cause of this bug. A cell is selected when the start + // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) + // or the parent of the table (in the case of the selection containing the last cell of a table). + var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), + tableParent, allOfCellSelected, tableCellSelection; + if (table) + tableParent = table.parentNode; + allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && + rng.startOffset == 0 && + rng.endOffset == 0 && + currentCell && + (n.nodeName=="TR" || n==tableParent); + tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; + return allOfCellSelected || tableCellSelection; + // return false; + } + + // this nasty hack is here to work around some WebKit selection bugs. + function fixTableCellSelection(ed) { + if (!tinymce.isWebKit) + return; + + var rng = ed.selection.getRng(); + var n = ed.selection.getNode(); + var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); + + if (!tableCellSelected(ed, rng, n, currentCell)) + return; + if (!currentCell) { + currentCell=n; + } + + // Get the very last node inside the table cell + var end = currentCell.lastChild; + while (end.lastChild) + end = end.lastChild; + + // Select the entire table cell. Nothing outside of the table cell should be selected. + rng.setEnd(end, end.nodeValue.length); + ed.selection.setRng(rng); + } + ed.plugins.table.fixTableCellSelection=fixTableCellSelection; + + // Add context menu + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); + }); + } + + // Fix to allow navigating up and down in a table in WebKit browsers. + if (tinymce.isWebKit) { + function moveSelection(ed, e) { + var VK = tinymce.VK; + var key = e.keyCode; + + function handle(upBool, sourceNode, event) { + var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; + var currentRow = ed.dom.getParent(sourceNode, 'tr'); + var siblingRow = currentRow[siblingDirection]; + + if (siblingRow) { + moveCursorToRow(ed, sourceNode, siblingRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } else { + var tableNode = ed.dom.getParent(currentRow, 'table'); + var middleNode = currentRow.parentNode; + var parentNodeName = middleNode.nodeName.toLowerCase(); + if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { + var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); + if (targetParent !== null) { + return moveToRowInTarget(upBool, targetParent, sourceNode, event); + } + } + return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); + } + } + + function getTargetParent(upBool, topNode, secondNode, nodeName) { + var tbodies = ed.dom.select('>' + nodeName, topNode); + var position = tbodies.indexOf(secondNode); + if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { + return getFirstHeadOrFoot(upBool, topNode); + } else if (position === -1) { + var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; + return tbodies[topOrBottom]; + } else { + return tbodies[position + (upBool ? -1 : 1)]; + } + } + + function getFirstHeadOrFoot(upBool, parent) { + var tagName = upBool ? 'thead' : 'tfoot'; + var headOrFoot = ed.dom.select('>' + tagName, parent); + return headOrFoot.length !== 0 ? headOrFoot[0] : null; + } + + function moveToRowInTarget(upBool, targetParent, sourceNode, event) { + var targetRow = getChildForDirection(targetParent, upBool); + targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } + + function escapeTable(upBool, currentRow, siblingDirection, table, event) { + var tableSibling = table[siblingDirection]; + if (tableSibling) { + moveCursorToStartOfElement(tableSibling); + return true; + } else { + var parentCell = ed.dom.getParent(table, 'td,th'); + if (parentCell) { + return handle(upBool, parentCell, event); + } else { + var backUpSibling = getChildForDirection(currentRow, !upBool); + moveCursorToStartOfElement(backUpSibling); + return tinymce.dom.Event.cancel(event); + } + } + } + + function getChildForDirection(parent, up) { + var child = parent && parent[up ? 'lastChild' : 'firstChild']; + // BR is not a valid table child to return in this case we return the table cell + return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child; + } + + function moveCursorToStartOfElement(n) { + ed.selection.setCursorLocation(n, 0); + } + + function isVerticalMovement() { + return key == VK.UP || key == VK.DOWN; + } + + function isInTable(ed) { + var node = ed.selection.getNode(); + var currentRow = ed.dom.getParent(node, 'tr'); + return currentRow !== null; + } + + function columnIndex(column) { + var colIndex = 0; + var c = column; + while (c.previousSibling) { + c = c.previousSibling; + colIndex = colIndex + getSpanVal(c, "colspan"); + } + return colIndex; + } + + function findColumn(rowElement, columnIndex) { + var c = 0; + var r = 0; + each(rowElement.children, function(cell, i) { + c = c + getSpanVal(cell, "colspan"); + r = i; + if (c > columnIndex) + return false; + }); + return r; + } + + function moveCursorToRow(ed, node, row, upBool) { + var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); + var tgtColumnIndex = findColumn(row, srcColumnIndex); + var tgtNode = row.childNodes[tgtColumnIndex]; + var rowCellTarget = getChildForDirection(tgtNode, upBool); + moveCursorToStartOfElement(rowCellTarget || tgtNode); + } + + function shouldFixCaret(preBrowserNode) { + var newNode = ed.selection.getNode(); + var newParent = ed.dom.getParent(newNode, 'td,th'); + var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); + return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) + } + + function checkSameParentTable(nodeOne, NodeTwo) { + return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); + } + + if (isVerticalMovement() && isInTable(ed)) { + var preBrowserNode = ed.selection.getNode(); + setTimeout(function() { + if (shouldFixCaret(preBrowserNode)) { + handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); + } + }, 0); + } + } + + ed.onKeyDown.add(moveSelection); + } + + // Fixes an issue on Gecko where it's impossible to place the caret behind a table + // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled + function fixTableCaretPos() { + var last; + + // Skip empty text nodes form the end + for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; + + if (last && last.nodeName == 'TABLE') { + if (ed.settings.forced_root_block) + ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '
            '); + else + ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'}); + } + }; + + // Fixes an bug where it's impossible to place the caret before a table in Gecko + // this fix solves it by detecting when the caret is at the beginning of such a table + // and then manually moves the caret infront of the table + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + var rng, table, dom = ed.dom; + + // On gecko it's not possible to place the caret before a table + if (e.keyCode == 37 || e.keyCode == 38) { + rng = ed.selection.getRng(); + table = dom.getParent(rng.startContainer, 'table'); + + if (table && ed.getBody().firstChild == table) { + if (isAtStart(rng, table)) { + rng = dom.createRng(); + + rng.setStartBefore(table); + rng.setEndBefore(table); + + ed.selection.setRng(rng); + + e.preventDefault(); + } + } + } + }); + } + + ed.onKeyUp.add(fixTableCaretPos); + ed.onSetContent.add(fixTableCaretPos); + ed.onVisualAid.add(fixTableCaretPos); + + ed.onPreProcess.add(function(ed, o) { + var last = o.node.lastChild; + + if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") { + ed.dom.remove(last); + } + }); + + + /** + * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line + * + * Removed: Since the new enter logic seems to fix this one. + */ + /* + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) { + var node = ed.selection.getRng().startContainer; + var tableCell = dom.getParent(node, 'td,th'); + if (tableCell) { + var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF"); + dom.insertAfter(zeroSizedNbsp, node); + } + } + }); + } + */ + + fixTableCaretPos(); + ed.startContent = ed.getContent({format : 'raw'}); + }); + + // Register action commands + each({ + mceTableSplitCells : function(grid) { + grid.split(); + }, + + mceTableMergeCells : function(grid) { + var rowSpan, colSpan, cell; + + cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); + if (cell) { + rowSpan = cell.rowSpan; + colSpan = cell.colSpan; + } + + if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { + winMan.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + rows : rowSpan, + cols : colSpan, + onaction : function(data) { + grid.merge(cell, data.cols, data.rows); + }, + plugin_url : url + }); + } else + grid.merge(); + }, + + mceTableInsertRowBefore : function(grid) { + grid.insertRow(true); + }, + + mceTableInsertRowAfter : function(grid) { + grid.insertRow(); + }, + + mceTableInsertColBefore : function(grid) { + grid.insertCol(true); + }, + + mceTableInsertColAfter : function(grid) { + grid.insertCol(); + }, + + mceTableDeleteCol : function(grid) { + grid.deleteCols(); + }, + + mceTableDeleteRow : function(grid) { + grid.deleteRows(); + }, + + mceTableCutRow : function(grid) { + clipboardRows = grid.cutRows(); + }, + + mceTableCopyRow : function(grid) { + clipboardRows = grid.copyRows(); + }, + + mceTablePasteRowBefore : function(grid) { + grid.pasteRows(clipboardRows, true); + }, + + mceTablePasteRowAfter : function(grid) { + grid.pasteRows(clipboardRows); + }, + + mceTableDelete : function(grid) { + grid.deleteTable(); + } + }, function(func, name) { + ed.addCommand(name, function() { + var grid = createTableGrid(); + + if (grid) { + func(grid); + ed.execCommand('mceRepaint'); + cleanup(); + } + }); + }); + + // Register dialog commands + each({ + mceInsertTable : function(val) { + winMan.open({ + url : url + '/table.htm', + width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), + height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + action : val ? val.action : 0 + }); + }, + + mceTableRowProps : function() { + winMan.open({ + url : url + '/row.htm', + width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }, + + mceTableCellProps : function() { + winMan.open({ + url : url + '/cell.htm', + width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + } + }, function(func, name) { + ed.addCommand(name, function(ui, val) { + func(val); + }); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(tinymce); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js new file mode 100644 index 00000000..02ecf22c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js @@ -0,0 +1,319 @@ +tinyMCEPopup.requireLangPack(); + +var ed; + +function init() { + ed = tinyMCEPopup.editor; + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + + var inst = ed; + var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); + var formObj = document.forms[0]; + var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); + + // Get table cell data + var celltype = tdElm.nodeName.toLowerCase(); + var align = ed.dom.getAttrib(tdElm, 'align'); + var valign = ed.dom.getAttrib(tdElm, 'valign'); + var width = trimSize(getStyle(tdElm, 'width', 'width')); + var height = trimSize(getStyle(tdElm, 'height', 'height')); + var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); + var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); + var className = ed.dom.getAttrib(tdElm, 'class'); + var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + var id = ed.dom.getAttrib(tdElm, 'id'); + var lang = ed.dom.getAttrib(tdElm, 'lang'); + var dir = ed.dom.getAttrib(tdElm, 'dir'); + var scope = ed.dom.getAttrib(tdElm, 'scope'); + + // Setup form + addClassesToList('class', 'table_cell_styles'); + TinyMCE_EditableSelects.init(); + + if (!ed.dom.hasClass(tdElm, 'mceSelected')) { + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.backgroundimage.value = backgroundimage; + formObj.width.value = width; + formObj.height.value = height; + formObj.id.value = id; + formObj.lang.value = lang; + formObj.style.value = ed.dom.serializeStyle(st); + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'valign', valign); + selectByValue(formObj, 'class', className, true, true); + selectByValue(formObj, 'celltype', celltype); + selectByValue(formObj, 'dir', dir); + selectByValue(formObj, 'scope', scope); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + } else + tinyMCEPopup.dom.hide('action'); +} + +function updateAction() { + var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getStart(); + tdElm = ed.dom.getParent(el, "td,th"); + trElm = ed.dom.getParent(el, "tr"); + tableElm = ed.dom.getParent(el, "table"); + + // Cell is selected + if (ed.dom.hasClass(tdElm, 'mceSelected')) { + // Update all selected sells + tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { + updateCell(td); + }); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (getSelectValue(formObj, 'action')) { + case "cell": + var celltype = getSelectValue(formObj, 'celltype'); + var scope = getSelectValue(formObj, 'scope'); + + function doUpdate(s) { + if (s) { + updateCell(tdElm); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + } + }; + + if (ed.getParam("accessibility_warnings", 1)) { + if (celltype == "th" && scope == "") + tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); + else + doUpdate(1); + + return; + } + + updateCell(tdElm); + break; + + case "row": + var cell = trElm.firstChild; + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + cell = updateCell(cell, true); + } while ((cell = nextCell(cell)) != null); + + break; + + case "col": + var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + if (cell == tdElm) + break; + col += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1; + } while ((cell = nextCell(cell)) != null); + + for (var i=0; i 0) { + tinymce.each(tableElm.rows, function(tr) { + var i; + + for (i = 0; i < tr.cells.length; i++) { + if (dom.hasClass(tr.cells[i], 'mceSelected')) { + updateRow(tr, true); + return; + } + } + }); + + inst.addVisual(); + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (action) { + case "row": + updateRow(trElm); + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + + if (!isCssSize(border)) { + dom.setAttrib(elm, 'border', border); + } else { + dom.setAttrib(elm, 'border', ''); + } + + if (border == '') { + dom.setStyle(elm, 'border-width', ''); + dom.setStyle(elm, 'border', ''); + dom.setAttrib(elm, 'border', ''); + } + + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
            '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = cssSize(border); + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); + } else + inst.execCommand('mceInsertContent', false, html); + + tinymce.each(dom.select('table[data-mce-new]'), function(node) { + var tdorth = dom.select('td,th', node); + + // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document + if (tinymce.isIE && node.nextSibling == null) { + if (inst.settings.forced_root_block) + dom.insertAfter(dom.create(inst.settings.forced_root_block), node); + else + dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node); + } + + try { + // IE9 might fail to do this selection + inst.selection.setCursorLocation(tdorth[0], 0); + } catch (ex) { + // Ignore + } + + dom.setAttrib(node, 'data-mce-new', ''); + }); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + // Hide advanced fields that isn't available in the schema + tinymce.each("summary id rules dir style frame".split(" "), function(name) { + var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr"); + + if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) { + tr.style.display = 'none'; + } + }); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function isCssSize(value) { + return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); +} + +function cssSize(value, def) { + value = tinymce.trim(value || def); + + if (!isCssSize(value)) { + return parseInt(value, 10) + 'px'; + } + + return value; +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) + st['border-width'] = cssSize(formObj.border.value); + else { + if (!formObj.border.value) { + st['border'] = ''; + st['border-width'] = ''; + } + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = cssSize(formObj.border.value, 1); + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js new file mode 100644 index 00000000..5a64ebd7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.table_dlg',{"rules_border":"alle 4 Seiten (Border)","rules_box":"alle 4 Seiten (Box)","rules_vsides":"links und rechts","rules_rhs":"nur rechts","rules_lhs":"nur links","rules_hsides":"oben und unten","rules_below":"nur unten","rules_above":"nur oben","rules_void":"keins",rules:"Gitter","frame_all":"zwischen allen Zellen","frame_cols":"zwischen Spalten","frame_rows":"zwischen Zeilen","frame_groups":"zwischen Gruppen","frame_none":"keine",frame:"Rahmen",caption:"Beschriftung der Tabelle","missing_scope":"Wollen Sie wirklich keine Beziehung f\u00fcr diese \u00dcberschrift angeben? Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.","cell_limit":"Sie haben die maximale Zellenzahl von {$cells} \u00fcberschritten.","row_limit":"Sie haben die maximale Zeilenzahl von {$rows} \u00fcberschritten.","col_limit":"Sie haben die maximale Spaltenzahl von {$cols} \u00fcberschritten.",colgroup:"Horizontal gruppieren",rowgroup:"Vertikal gruppieren",scope:"Bezug",tfoot:"Tabellenfu\u00df",tbody:"Tabelleninhalt",thead:"Tabellenkopf","row_all":"Alle Zeilen ver\u00e4ndern","row_even":"Gerade Zeilen ver\u00e4ndern","row_odd":"Ungerade Zeilen ver\u00e4ndern","row_row":"Diese Zeile ver\u00e4ndern","cell_all":"Alle Zellen der Tabelle ver\u00e4ndern","cell_row":"Alle Zellen in dieser Zeile ver\u00e4ndern","cell_cell":"Diese Zelle ver\u00e4ndern",th:"\u00dcberschrift",td:"Textzelle",summary:"Zusammenfassung",bgimage:"Hintergrundbild",rtl:"Rechts nach links",ltr:"Links nach rechts",mime:"MIME-Type des Inhalts",langcode:"Sprachcode",langdir:"Schriftrichtung",style:"Format",id:"ID","merge_cells_title":"Zellen vereinen",bgcolor:"Hintergrundfarbe",bordercolor:"Rahmenfarbe","align_bottom":"Unten","align_top":"Oben",valign:"Vertikale Ausrichtung","cell_type":"Zellentyp","cell_title":"Eigenschaften der Zelle","row_title":"Eigenschaften der Zeile","align_middle":"Mittig","align_right":"Rechts","align_left":"Links","align_default":"Standard",align:"Ausrichtung",border:"Rahmen",cellpadding:"Abstand innerhalb der Zellen",cellspacing:"Zellenabstand",rows:"Zeilen",cols:"Spalten",height:"H\u00f6he",width:"Breite",title:"Tabelle einf\u00fcgen/bearbeiten",rowtype:"Gruppierung","advanced_props":"Erweiterte Einstellungen","general_props":"Allgemeine Einstellungen","advanced_tab":"Erweitert","general_tab":"Allgemein","cell_col":"Alle Zellen in dieser Spalte aktualisieren"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js new file mode 100644 index 00000000..463e09ee --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm new file mode 100644 index 00000000..d231090e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm @@ -0,0 +1,32 @@ + + + + {#table_dlg.merge_cells_title} + + + + + + +
            +
            + {#table_dlg.merge_cells_title} + + + + + + + + + +
            :
            :
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/row.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/row.htm new file mode 100644 index 00000000..6ebef284 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/row.htm @@ -0,0 +1,158 @@ + + + + {#table_dlg.row_title} + + + + + + + + + +
            + + +
            +
            +
            + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + +
            + +
            +
            +
            + +
            +
            + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + +
            + + + + + +
             
            +
            + + + + + + +
             
            +
            +
            +
            +
            +
            + +
            +
            + +
            + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/table.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/table.htm new file mode 100644 index 00000000..4b5dc318 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/table/table.htm @@ -0,0 +1,194 @@ + + + + {#table_dlg.title} + + + + + + + + + + +
            + + +
            +
            +
            + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            +
            + +
            +
            + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            + + + + + +
             
            +
            + +
            + +
            + +
            + + + + + +
             
            +
            + + + + + +
             
            +
            +
            +
            +
            + +
            +
              +
            • + +
            • +
            • + +
            • +
            +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/blank.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/blank.htm new file mode 100644 index 00000000..ecde53fa --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/blank.htm @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/css/template.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/css/template.css new file mode 100644 index 00000000..2d23a493 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/css/template.css @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js new file mode 100644 index 00000000..ebe3c27d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/js/template.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/js/template.js new file mode 100644 index 00000000..bc3045d2 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template/js/template.js @@ -0,0 +1,106 @@ +tinyMCEPopup.requireLangPack(); + +var TemplateDialog = { + preInit : function() { + var url = tinyMCEPopup.getParam("template_external_list_url"); + + if (url != null) + document.write(''); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x + + {#template_dlg.title} + + + + + +
            +
            +
            {#template_dlg.desc}
            +
            +
            +
            +
            +
            + + +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            + +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm new file mode 100644 index 00000000..ecde53fa --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css new file mode 100644 index 00000000..2d23a493 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js new file mode 100644 index 00000000..ebe3c27d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js new file mode 100644 index 00000000..bc3045d2 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js @@ -0,0 +1,106 @@ +tinyMCEPopup.requireLangPack(); + +var TemplateDialog = { + preInit : function() { + var url = tinyMCEPopup.getParam("template_external_list_url"); + + if (url != null) + document.write(''); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x + + {#template_dlg.title} + + + + + +
            +
            +
            {#template_dlg.desc}
            +
            + +
            +
            +
            +
            + {#template_dlg.preview} + +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css new file mode 100644 index 00000000..76bc92b5 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css @@ -0,0 +1,21 @@ +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre, figure {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat} +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre, figure {margin-left: 3px} +section, article, address, hgroup, aside, figure {margin: 0 0 1em 3px} + +p {background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)} +h1 {background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)} +h2 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)} +h3 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)} +h4 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)} +h5 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)} +h6 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)} +div {background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)} +section {background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)} +article {background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)} +blockquote {background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)} +address {background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)} +pre {background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)} +hgroup {background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)} +aside {background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)} +figure {background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)} +figcaption {border: 1px dashed #BBB} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js new file mode 100644 index 00000000..c65eaf2b --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.VisualBlocks",{init:function(a,b){var c;if(!window.NodeList){return}a.addCommand("mceVisualBlocks",function(){var e=a.dom,d;if(!c){c=e.uniqueId();d=e.create("link",{id:c,rel:"stylesheet",href:b+"/css/visualblocks.css"});a.getDoc().getElementsByTagName("head")[0].appendChild(d)}else{d=e.get(c);d.disabled=!d.disabled}a.controlManager.setActive("visualblocks",!d.disabled)});a.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"});a.onInit.add(function(){if(a.settings.visualblocks_default_state){a.execCommand("mceVisualBlocks",false,null,{skip_focus:true})}})},getInfo:function(){return{longname:"Visual blocks",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("visualblocks",tinymce.plugins.VisualBlocks)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js new file mode 100644 index 00000000..b9d2ab2e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js @@ -0,0 +1,63 @@ +/** + * editor_plugin_src.js + * + * Copyright 2012, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualBlocks', { + init : function(ed, url) { + var cssId; + + // We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects + if (!window.NodeList) { + return; + } + + ed.addCommand('mceVisualBlocks', function() { + var dom = ed.dom, linkElm; + + if (!cssId) { + cssId = dom.uniqueId(); + linkElm = dom.create('link', { + id: cssId, + rel : 'stylesheet', + href : url + '/css/visualblocks.css' + }); + + ed.getDoc().getElementsByTagName('head')[0].appendChild(linkElm); + } else { + linkElm = dom.get(cssId); + linkElm.disabled = !linkElm.disabled; + } + + ed.controlManager.setActive('visualblocks', !linkElm.disabled); + }); + + ed.addButton('visualblocks', {title : 'visualblocks.desc', cmd : 'mceVisualBlocks'}); + + ed.onInit.add(function() { + if (ed.settings.visualblocks_default_state) { + ed.execCommand('mceVisualBlocks', false, null, {skip_focus : true}); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual blocks', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('visualblocks', tinymce.plugins.VisualBlocks); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js new file mode 100644 index 00000000..1a148e8b --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!="raw"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive("visualchars",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(g=0;g$1');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js new file mode 100644 index 00000000..df985905 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js @@ -0,0 +1,83 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualChars', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceVisualChars', t._toggleVisualChars, t); + + // Register buttons + ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); + + ed.onBeforeGetContent.add(function(ed, o) { + if (t.state && o.format != 'raw' && !o.draft) { + t.state = true; + t._toggleVisualChars(false); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual characters', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _toggleVisualChars : function(bookmark) { + var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; + + t.state = !t.state; + ed.controlManager.setActive('visualchars', t.state); + + if (bookmark) + bm = s.getBookmark(); + + if (t.state) { + nl = []; + tinymce.walk(b, function(n) { + if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) + nl.push(n); + }, 'childNodes'); + + for (i = 0; i < nl.length; i++) { + nv = nl[i].nodeValue; + nv = nv.replace(/(\u00a0)/g, '$1'); + + div = ed.dom.create('div', null, nv); + while (node = div.lastChild) + ed.dom.insertAfter(node, nl[i]); + + ed.dom.remove(nl[i]); + } + } else { + nl = ed.dom.select('span.mceItemNbsp', b); + + for (i = nl.length - 1; i >= 0; i--) + ed.dom.remove(nl[i], 1); + } + + s.moveToBookmark(bm); + } + }); + + // Register plugin + tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js new file mode 100644 index 00000000..42ece209 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(k,"span",{},'0')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js new file mode 100644 index 00000000..34b26555 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js @@ -0,0 +1,122 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.WordCount', { + block : 0, + id : null, + countre : null, + cleanre : null, + + init : function(ed, url) { + var t = this, last = 0, VK = tinymce.VK; + + t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ + t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); + t.update_rate = ed.getParam('wordcount_update_rate', 2000); + t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); + t.id = ed.id + '-word-count'; + + ed.onPostRender.add(function(ed, cm) { + var row, id; + + // Add it to the specified id or the theme advanced path + id = ed.getParam('wordcount_target_id'); + if (!id) { + row = tinymce.DOM.get(ed.id + '_path_row'); + + if (row) + tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); + } else { + tinymce.DOM.add(id, 'span', {}, '0'); + } + }); + + ed.onInit.add(function(ed) { + ed.selection.onSetContent.add(function() { + t._count(ed); + }); + + t._count(ed); + }); + + ed.onSetContent.add(function(ed) { + t._count(ed); + }); + + function checkKeys(key) { + return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); + } + + function checkDelOrBksp(key) { + return key === VK.DELETE || key === VK.BACKSPACE; + } + + ed.onKeyUp.add(function(ed, e) { + if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { + t._count(ed); + } + + last = e.keyCode; + }); + }, + + _getCount : function(ed) { + var tc = 0; + var tx = ed.getContent({ format: 'raw' }); + + if (tx) { + tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces + tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + + // deal with html entities + tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); + tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation + + var wordArray = tx.match(this.countre); + if (wordArray) { + tc = wordArray.length; + } + } + + return tc; + }, + + _count : function(ed) { + var t = this; + + // Keep multiple calls from happening at the same time + if (t.block) + return; + + t.block = 1; + + setTimeout(function() { + if (!ed.destroyed) { + var tc = t._getCount(ed); + tinymce.DOM.setHTML(t.id, tc.toString()); + setTimeout(function() {t.block = 0;}, t.update_rate); + } + }, 1); + }, + + getInfo: function() { + return { + longname : 'Word Count plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); +})(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm new file mode 100644 index 00000000..30a894f7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm new file mode 100644 index 00000000..c1093459 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm new file mode 100644 index 00000000..e8d606a3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm new file mode 100644 index 00000000..0ac6bdb6 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css new file mode 100644 index 00000000..9a6a235c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css @@ -0,0 +1,11 @@ +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css new file mode 100644 index 00000000..e67114db --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css @@ -0,0 +1,9 @@ +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm new file mode 100644 index 00000000..5f667510 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
            : + + + + + +
            +
            :
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js new file mode 100644 index 00000000..9b98a515 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js new file mode 100644 index 00000000..f2405721 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -0,0 +1,132 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), + height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + + ed.onPreInit.add(function() { + // Fixed IE issue where it can't handle these elements correctly + ed.dom.create('abbr'); + }); + }, + + getInfo : function() { + return { + longname : 'XHTML Xtras Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm new file mode 100644 index 00000000..d001ac7c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + + +
            + + +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
            : + + + + + +
            +
            :
            +
            +
            + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            : + +
            :
            : + +
            : + +
            +
            +
            +
            +
            + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            :
            +
            +
            +
            +
            + + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js new file mode 100644 index 00000000..4b51a257 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js @@ -0,0 +1,28 @@ +/** + * abbr.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement('abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js new file mode 100644 index 00000000..6ec2f887 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js @@ -0,0 +1,28 @@ +/** + * acronym.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js new file mode 100644 index 00000000..9c99995a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js @@ -0,0 +1,111 @@ +/** + * attributes.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + dom.setAttrib(elm, attrib.toLowerCase(), value); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + setAttrib(elm, 'onfocus'); + setAttrib(elm, 'onblur'); + setAttrib(elm, 'onclick'); + setAttrib(elm, 'ondblclick'); + setAttrib(elm, 'onmousedown'); + setAttrib(elm, 'onmouseup'); + setAttrib(elm, 'onmouseover'); + setAttrib(elm, 'onmousemove'); + setAttrib(elm, 'onmouseout'); + setAttrib(elm, 'onkeypress'); + setAttrib(elm, 'onkeydown'); + setAttrib(elm, 'onkeyup'); + + // Refresh in old MSIE +// if (tinyMCE.isMSIE5) +// elm.outerHTML = elm.outerHTML; +} + +function insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js new file mode 100644 index 00000000..009b7154 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js @@ -0,0 +1,28 @@ +/** + * cite.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js new file mode 100644 index 00000000..1f957dc7 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -0,0 +1,53 @@ +/** + * del.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('del'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertDel() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('del'); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); + for (var i=0; i 0) { + tagName = element_name; + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select('span,font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); + }); +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js new file mode 100644 index 00000000..c4addfb0 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js @@ -0,0 +1,53 @@ +/** + * ins.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('ins'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertIns() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); + for (var i=0; i + + + {#advanced_dlg.about_title} + + + + + + + +
            +
            +

            {#advanced_dlg.about_title}

            +

            Version: ()

            +

            TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

            +

            Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

            +

            For more information about this software visit the TinyMCE website.

            + +
            + Got Moxie? +
            +
            + +
            +
            +

            {#advanced_dlg.about_loaded}

            + +
            +
            + +

             

            +
            +
            + +
            +
            +
            +
            + +
            + +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm new file mode 100644 index 00000000..75c93b79 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm @@ -0,0 +1,26 @@ + + + + {#advanced_dlg.anchor_title} + + + + +
            + + + + + + + + +
            {#advanced_dlg.anchor_title}
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm new file mode 100644 index 00000000..00ab086f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm @@ -0,0 +1,55 @@ + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + + + + + +
            + + + + + + + + + +
             
             
            +
            + + + + + + + + + + + + + + + + +
             
             
             
            +
            {#advanced_dlg.charmap_usage}
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm new file mode 100644 index 00000000..b625531a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm @@ -0,0 +1,70 @@ + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
            + + +
            +
            +
            + {#advanced_dlg.colorpicker_picker_title} +
            + + +
            + +
            + +
            +
            +
            +
            + +
            +
            + {#advanced_dlg.colorpicker_palette_title} +
            + +
            + +
            +
            +
            + +
            +
            + {#advanced_dlg.colorpicker_named_title} +
            + +
            + +
            + +
            + {#advanced_dlg.colorpicker_name} +
            +
            +
            +
            + +
            + + +
            +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js new file mode 100644 index 00000000..4b8d5637 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js @@ -0,0 +1 @@ +(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(p,m){var k,l,o=p.dom,j="",n,r;previewStyles=p.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function q(s){return s.replace(/%(\w+)/g,"")}k=m.block||m.inline||"span";l=o.create(k);f(m.styles,function(t,s){t=q(t);if(t){o.setStyle(l,s,t)}});f(m.attributes,function(t,s){t=q(t);if(t){o.setAttrib(l,s,t)}});f(m.classes,function(s){s=q(s);if(!o.hasClass(l,s)){o.addClass(l,s)}});o.setStyles(l,{position:"absolute",left:-65535});p.getBody().appendChild(l);n=o.getStyle(p.getBody(),"fontSize",true);n=/px$/.test(n)?parseInt(n,10):0;f(previewStyles.split(" "),function(s){var t=o.getStyle(l,s,true);if(s=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)){t=o.getStyle(p.getBody(),s,true);if(o.toHex(t).toLowerCase()=="#ffffff"){return}}if(s=="font-size"){if(/em|%$/.test(t)){if(n===0){return}t=parseFloat(t,10)/(/%$/.test(t)?100:1);t=(t*n)+"px"}}j+=s+":"+t+";"});o.remove(l);return j}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);n=k.settings;k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;if(!n.theme_advanced_buttons1){n=c({theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap"},n)}m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"top",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},n);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},""),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true);q.nodeChanged()}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js new file mode 100644 index 00000000..82166dcb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js @@ -0,0 +1,1490 @@ +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Generates a preview for a format + function getPreviewCss(ed, fmt) { + var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName; + + previewStyles = ed.settings.preview_styles; + + // No preview forced + if (previewStyles === false) + return ''; + + // Default preview + if (!previewStyles) + previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color'; + + // Removes any variables since these can't be previewed + function removeVars(val) { + return val.replace(/%(\w+)/g, ''); + }; + + // Create block/inline element to use for preview + name = fmt.block || fmt.inline || 'span'; + previewElm = dom.create(name); + + // Add format styles to preview element + each(fmt.styles, function(value, name) { + value = removeVars(value); + + if (value) + dom.setStyle(previewElm, name, value); + }); + + // Add attributes to preview element + each(fmt.attributes, function(value, name) { + value = removeVars(value); + + if (value) + dom.setAttrib(previewElm, name, value); + }); + + // Add classes to preview element + each(fmt.classes, function(value) { + value = removeVars(value); + + if (!dom.hasClass(previewElm, value)) + dom.addClass(previewElm, value); + }); + + // Add the previewElm outside the visual area + dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); + ed.getBody().appendChild(previewElm); + + // Get parent container font size so we can compute px values out of em/% for older IE:s + parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true); + parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; + + each(previewStyles.split(' '), function(name) { + var value = dom.getStyle(previewElm, name, true); + + // If background is transparent then check if the body has a background color we can use + if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { + value = dom.getStyle(ed.getBody(), name, true); + + // Ignore white since it's the default color, not the nicest fix + if (dom.toHex(value).toLowerCase() == '#ffffff') { + return; + } + } + + // Old IE won't calculate the font size so we need to do that manually + if (name == 'font-size') { + if (/em|%$/.test(value)) { + if (parentFontSize === 0) { + return; + } + + // Convert font size from em/% to px + value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); + value = (value * parentFontSize) + 'px'; + } + } + + previewCss += name + ':' + value + ';'; + }); + + dom.remove(previewElm); + + return previewCss; + }; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + controls : { + bold : ['bold_desc', 'Bold'], + italic : ['italic_desc', 'Italic'], + underline : ['underline_desc', 'Underline'], + strikethrough : ['striketrough_desc', 'Strikethrough'], + justifyleft : ['justifyleft_desc', 'JustifyLeft'], + justifycenter : ['justifycenter_desc', 'JustifyCenter'], + justifyright : ['justifyright_desc', 'JustifyRight'], + justifyfull : ['justifyfull_desc', 'JustifyFull'], + bullist : ['bullist_desc', 'InsertUnorderedList'], + numlist : ['numlist_desc', 'InsertOrderedList'], + outdent : ['outdent_desc', 'Outdent'], + indent : ['indent_desc', 'Indent'], + cut : ['cut_desc', 'Cut'], + copy : ['copy_desc', 'Copy'], + paste : ['paste_desc', 'Paste'], + undo : ['undo_desc', 'Undo'], + redo : ['redo_desc', 'Redo'], + link : ['link_desc', 'mceLink'], + unlink : ['unlink_desc', 'unlink'], + image : ['image_desc', 'mceImage'], + cleanup : ['cleanup_desc', 'mceCleanup'], + help : ['help_desc', 'mceHelp'], + code : ['code_desc', 'mceCodeEditor'], + hr : ['hr_desc', 'InsertHorizontalRule'], + removeformat : ['removeformat_desc', 'RemoveFormat'], + sub : ['sub_desc', 'subscript'], + sup : ['sup_desc', 'superscript'], + forecolor : ['forecolor_desc', 'ForeColor'], + forecolorpicker : ['forecolor_desc', 'mceForeColor'], + backcolor : ['backcolor_desc', 'HiliteColor'], + backcolorpicker : ['backcolor_desc', 'mceBackColor'], + charmap : ['charmap_desc', 'mceCharMap'], + visualaid : ['visualaid_desc', 'mceToggleVisualAid'], + anchor : ['anchor_desc', 'mceInsertAnchor'], + newdocument : ['newdocument_desc', 'mceNewDocument'], + blockquote : ['blockquote_desc', 'mceBlockQuote'] + }, + + stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], + + init : function(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + s = ed.settings; + + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + + // Setup default buttons + if (!s.theme_advanced_buttons1) { + s = extend({ + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap" + }, s); + } + + // Default settings + t.settings = s = extend({ + theme_advanced_path : true, + theme_advanced_toolbar_location : 'top', + theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "bottom", + theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", + theme_advanced_more_colors : 1, + theme_advanced_row_height : 23, + theme_advanced_resize_horizontal : 1, + theme_advanced_resizing_use_cookie : 1, + theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, + readonly : ed.settings.readonly + }, s); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + + if (/^\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + + // Init editor + ed.onInit.add(function() { + if (!ed.settings.readonly) { + ed.onNodeChange.add(t._nodeChanged, t); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + case "styleselect": + return this._createStyleSelect(); + + case "formatselect": + return this._createBlockFormats(); + + case "fontselect": + return this._createFontSelect(); + + case "fontsizeselect": + return this._createFontSizeSelect(); + + case "forecolor": + return this._createForeColorMenu(); + + case "backcolor": + return this._createBackColorMenu(); + } + + if ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); + + if (ctrl.getLength() == 0) { + each(ed.dom.getClasses(), function(o, idx) { + var name = 'style_' + idx, fmt; + + fmt = { + inline : 'span', + attributes : {'class' : o['class']}, + selector : '*' + }; + + ed.formatter.register(name, fmt); + + ctrl.add(o['class'], name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; + + // Setup style select box + ctrl = ctrlMan.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(name) { + var matches, formatNames = [], removedFormat; + + each(ctrl.items, function(item) { + formatNames.push(item.value); + }); + + ed.focus(); + ed.undoManager.add(); + + // Toggle off the current format(s) + matches = ed.formatter.matchAll(formatNames); + tinymce.each(matches, function(match) { + if (!name || match == name) { + if (match) + ed.formatter.remove(match); + + removedFormat = true; + } + }); + + if (!removedFormat) + ed.formatter.apply(name); + + ed.undoManager.add(); + ed.nodeChanged(); + + return false; // No auto select + } + }); + + // Handle specified format + ed.onPreInit.add(function() { + var counter = 0, formats = ed.getParam('style_formats'); + + if (formats) { + each(formats, function(fmt) { + var name, keys = 0; + + each(fmt, function() {keys++;}); + + if (keys > 1) { + name = fmt.name = fmt.name || 'style_' + (counter++); + ed.formatter.register(name, fmt); + ctrl.add(fmt.title, name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } else + ctrl.add(fmt.title); + }); + } else { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { + var name, fmt; + + if (val) { + name = 'style_' + (counter++); + fmt = { + inline : 'span', + classes : val, + selector : '*' + }; + + ed.formatter.register(name, fmt); + ctrl.add(t.editor.translate(key), name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } + }); + } + }); + + // Auto import classes if the ctrl box is empty + if (ctrl.getLength() == 0) { + ctrl.onPostRender.add(function(ed, n) { + if (!ctrl.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return ctrl; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', { + title : 'advanced.fontdefault', + onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + + ed.execCommand('FontName', false, v); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && cur.value == v) { + c.select(null); + } + + return false; // No auto select + } + }); + + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + + if (v['class']) { + ed.focus(); + ed.undoManager.add(); + ed.formatter.toggle('fontsize_class', {value : v['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else + ed.execCommand('FontSize', false, v.fontSize); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { + c.select(null); + } + + return false; // No auto select + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + p : 'advanced.paragraph', + address : 'advanced.address', + pre : 'advanced.pre', + h1 : 'advanced.h1', + h2 : 'advanced.h2', + h3 : 'advanced.h3', + h4 : 'advanced.h4', + h5 : 'advanced.h5', + h6 : 'advanced.h6', + div : 'advanced.div', + blockquote : 'advanced.blockquote', + code : 'advanced.code', + dt : 'advanced.dt', + dd : 'advanced.dd', + samp : 'advanced.samp' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() { + return getPreviewCss(t.editor, {block: v}); + }}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = sc.rows; + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + return false; + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + // Make sure focus is given to toolbar in Safari. + // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame + if (tinymce.isWebKit) { + window.focus(); + } + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_ifr'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h, store) { + var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Resize iframe and container + DOM.setStyle(e, 'height', ''); + DOM.setStyle(ifr, 'height', h); + + if (s.theme_advanced_resize_horizontal) { + DOM.setStyle(e, 'width', ''); + DOM.setStyle(ifr, 'width', w); + + // Make sure that the size is never smaller than the over all ui + if (w < e.clientWidth) { + w = e.clientWidth; + DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); + } + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + return false; + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (c.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false; + + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); + + t.toolbarGroup = toolbarGroup; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"}); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + toolbarsExist = true; + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + toolbarGroup.add(tb); + + o.deltaHeight -= s.theme_advanced_row_height; + } + // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly + if (!toolbarsExist) + o.deltaHeight -= s.theme_advanced_row_height; + h.push(toolbarGroup.renderHTML()); + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + + + if (s.theme_advanced_resizing) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + t.resizeTo(o.cw, o.ch); + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var mouseMoveHandler1, mouseMoveHandler2, + mouseUpHandler1, mouseUpHandler2, + startX, startY, startWidth, startHeight, width, height, ifrElm; + + function resizeOnMove(e) { + e.preventDefault(); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + + t.resizeTo(width, height); + }; + + function endResize(e) { + // Stop listening + Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); + Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); + Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); + Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); + + ed.nodeChanged(); + }; + + e.preventDefault(); + + // Get the current rect size + startX = e.screenX; + startY = e.screenY; + ifrElm = DOM.get(t.editor.id + '_ifr'); + startWidth = width = ifrElm.clientWidth; + startHeight = height = ifrElm.clientHeight; + + // Register envent handlers + mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); + mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); + mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); + mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _updateUndoStatus : function(ed) { + var cm = ed.controlManager, um = ed.undoManager; + + cm.setDisabled('undo', !um.hasUndo() && !um.typing); + cm.setDisabled('redo', !um.hasRedo()); + }, + + _nodeChanged : function(ed, cm, n, co, ob) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + function getParent(name) { + var i, parents = ob.parents, func = name; + + if (typeof(name) == 'string') { + func = function(node) { + return node.nodeName == name; + }; + } + + for (i = 0; i < parents.length; i++) { + if (func(parents[i])) + return parents[i]; + } + }; + + cm.setActive('visualaid', ed.hasVisual); + t._updateUndoStatus(ed); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = getParent('A'); + if (c = cm.get('link')) { + c.setDisabled((!p && co) || (p && !p.href)); + c.setActive(!!p && (!p.name && !p.id)); + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name && !p.id); + } + + if (c = cm.get('anchor')) { + c.setActive(!co && !!p && (p.name || (p.id && !p.href))); + } + + p = getParent('IMG'); + if (c = cm.get('image')) + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + t._importClasses(); + + formatNames = []; + each(c.items, function(item) { + formatNames.push(item.value); + }); + + matches = ed.formatter.matchAll(formatNames); + c.select(matches[0]); + tinymce.each(matches, function(match, index) { + if (index > 0) { + c.mark(match); + } + }); + } + + if (c = cm.get('formatselect')) { + p = getParent(ed.dom.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + // Find out current fontSize, fontFamily and fontClass + getParent(function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + } + + if (ed.dom.is(n, s.theme_advanced_font_selector)) { + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + // Select font size + if (c = cm.get('fontsizeselect')) { + // Use computed style + if (s.theme_advanced_runtime_fontsize && !fz && !cl) + fz = ed.dom.getStyle(n, 'fontSize', true); + + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + + DOM.setHTML(p, ''); + + getParent(function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and bogus/hidden elements + if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) + return; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName) + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, ''); + + if (v) { + ti += 'class: ' + v + ' '; + + if (ed.dom.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : this.url + '/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : this.url + '/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}(tinymce)); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/image.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/image.htm new file mode 100644 index 00000000..b8ba729f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/image.htm @@ -0,0 +1,80 @@ + + + + {#advanced_dlg.image_title} + + + + + + +
            + + +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            + x +
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg new file mode 100644 index 00000000..b1a377ab Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif new file mode 100644 index 00000000..dec3f7c7 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif new file mode 100644 index 00000000..ca222490 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif new file mode 100644 index 00000000..410c7ad0 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif new file mode 100644 index 00000000..acdf4085 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif new file mode 100644 index 00000000..8f10e7aa Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif new file mode 100644 index 00000000..fdfe0b9a Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif new file mode 100644 index 00000000..9314d044 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif new file mode 100644 index 00000000..38848651 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif new file mode 100644 index 00000000..35701040 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif new file mode 100644 index 00000000..ab50f2d8 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js new file mode 100644 index 00000000..5b358457 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js @@ -0,0 +1,73 @@ +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
            ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
            ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
            '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js new file mode 100644 index 00000000..2909a3a4 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js @@ -0,0 +1,56 @@ +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName; + + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + var aRule = ed.schema.getElementRule('a'); + if (!aRule || aRule.attributes.name) { + attribName = 'name'; + } else { + attribName = 'id'; + } + + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + if (elm) { + elm.setAttribute(attribName, name); + elm[attribName] = name; + ed.undoManager.add(); + } else { + // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it + var attrs = {'class' : 'mceItemAnchor'}; + attrs[attribName] = name; + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF')); + ed.nodeChanged(); + } + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js new file mode 100644 index 00000000..bb186955 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js @@ -0,0 +1,363 @@ +/** + * charmap.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); +}); + +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = '
            '+ + ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
            '; + html = html.replace(/<\/tr>/g, ''); + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js new file mode 100644 index 00000000..cc891c17 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js @@ -0,0 +1,345 @@ +tinyMCEPopup.requireLangPack(); + +var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; + +var colors = [ + "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", + "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", + "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", + "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", + "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", + "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", + "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", + "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", + "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", + "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", + "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", + "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", + "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", + "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", + "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", + "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", + "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", + "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", + "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", + "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", + "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", + "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", + "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", + "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", + "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", + "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", + "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" +]; + +var named = { + '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', + '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', + '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', + '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', + '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', + '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', + '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', + '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', + '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', + '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', + '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', + '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', + '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', + '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', + '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', + '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', + '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', + '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', + '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', + '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', + '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', + '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', + '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' +}; + +var namedLookup = {}; + +function init() { + var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; + + tinyMCEPopup.resizeToInnerSize(); + + generatePicker(); + generateWebColors(); + generateNamedColors(); + + if (inputColor) { + changeFinalColor(inputColor); + + col = convertHexToRGB(inputColor); + + if (col) + updateLight(col.r, col.g, col.b); + } + + for (key in named) { + value = named[key]; + namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); + } +} + +function toHexColor(color) { + var matches, red, green, blue, toInt = parseInt; + + function hex(value) { + value = parseInt(value).toString(16); + + return value.length > 1 ? value : '0' + value; // Padd with leading zero + }; + + color = tinymce.trim(color); + color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' + color = namedLookup[color] || color; + + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); + + if (matches) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else { + matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); + + if (matches) { + red = toInt(matches[1], 16); + green = toInt(matches[2], 16); + blue = toInt(matches[3], 16); + } else { + matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); + + if (matches) { + red = toInt(matches[1] + matches[1], 16); + green = toInt(matches[2] + matches[2], 16); + blue = toInt(matches[3] + matches[3], 16); + } else { + return ''; + } + } + } + + return '#' + hex(red) + hex(green) + hex(blue); +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + var hexColor = toHexColor(color); + + if (hexColor === '') { + var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); + tinyMCEPopup.alert(text + ': ' + color); + } + else { + tinyMCEPopup.restoreSelection(); + + if (f) + f(hexColor); + + tinyMCEPopup.close(); + } +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
            '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
            ' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
            '; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value.replace(/ /g, '%20'), + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) { + st[key] = value; + }); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); + this.styleVal = dom.serializeStyle(st, 'img'); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js new file mode 100644 index 00000000..8c1d73c5 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js @@ -0,0 +1,159 @@ +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value + }); + + if (f.target_list) { + ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list")); + } + + if (f.class_list) { + ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list")); + } + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js new file mode 100644 index 00000000..dd5e366f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js @@ -0,0 +1,78 @@ +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + turnWrapOn(); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function setWhiteSpaceCss(value) { + var el = document.getElementById('htmlSource'); + tinymce.DOM.setStyle(el, 'white-space', value); +} + +function turnWrapOff() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre'); + } else { + setWrap('off'); + } +} + +function turnWrapOn() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre-wrap'); + } else { + setWrap('soft'); + } +} + +function toggleWordWrap(elm) { + if (elm.checked) { + turnWrapOn(); + } else { + turnWrapOff(); + } +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js new file mode 100644 index 00000000..034195ca --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advanced',{"underline_desc":"Unterstrichen (Strg+U)","italic_desc":"Kursiv (Strg+I)","bold_desc":"Fett (Strg+B)",dd:"Definitionsbeschreibung",dt:"Definitionsbegriff",samp:"Beispiel",code:"Code",blockquote:"Zitatblock",h6:"\u00dcberschrift 6",h5:"\u00dcberschrift 5",h4:"\u00dcberschrift 4",h3:"\u00dcberschrift 3",h2:"\u00dcberschrift 2",h1:"\u00dcberschrift 1",pre:"Rohdaten",address:"Adresse",div:"Zusammenh\u00e4ngender Bereich",paragraph:"Absatz",block:"Vorlage",fontdefault:"Schriftart","font_size":"Schriftgr\u00f6\u00dfe","style_select":"Format","anchor_delta_width":"13","more_colors":"Weitere Farben","toolbar_focus":"Zur Werkzeugleiste springen: Alt+Q; Zum Editor springen: Alt-Z; Zum Elementpfad springen: Alt-X",newdocument:"Wollen Sie wirklich den ganzen Inhalt l\u00f6schen?",path:"Pfad","clipboard_msg":"Kopieren, Ausschneiden und Einf\u00fcgen sind im Mozilla Firefox nicht m\u00f6glich.\nWollen Sie mehr \u00fcber dieses Problem erfahren?","blockquote_desc":"Zitatblock","help_desc":"Hilfe","newdocument_desc":"Neues Dokument","image_props_desc":"Bildeigenschaften","paste_desc":"Einf\u00fcgen","copy_desc":"Kopieren","cut_desc":"Ausschneiden","anchor_desc":"Anker einf\u00fcgen/ver\u00e4ndern","visualaid_desc":"Hilfslinien und unsichtbare Elemente ein-/ausblenden","charmap_desc":"Sonderzeichen einf\u00fcgen","backcolor_desc":"Hintergrundfarbe","forecolor_desc":"Textfarbe","custom1_desc":"Benutzerdefinierte Beschreibung","removeformat_desc":"Formatierungen zur\u00fccksetzen","hr_desc":"Trennlinie einf\u00fcgen","sup_desc":"Hochgestellt","sub_desc":"Tiefgestellt","code_desc":"HTML-Quellcode bearbeiten","cleanup_desc":"Quellcode aufr\u00e4umen","image_desc":"Bild einf\u00fcgen/ver\u00e4ndern","unlink_desc":"Link entfernen","link_desc":"Link einf\u00fcgen/ver\u00e4ndern","redo_desc":"Wiederholen (Strg+Y)","undo_desc":"R\u00fcckg\u00e4ngig (Strg+Z)","indent_desc":"Einr\u00fccken","outdent_desc":"Ausr\u00fccken","numlist_desc":"Sortierte Liste","bullist_desc":"Unsortierte Liste","justifyfull_desc":"Blocksatz","justifyright_desc":"Rechtsb\u00fcndig","justifycenter_desc":"Zentriert","justifyleft_desc":"Linksb\u00fcndig","striketrough_desc":"Durchgestrichen","help_shortcut":"Dr\u00fccken Sie ALT-F10 f\u00fcr die Toolbar. Dr\u00fccken Sie ALT-0 f\u00fcr Hilfe","rich_text_area":"Rich Text Feld","shortcuts_desc":"Eingabehilfe",toolbar:"Toolbar","anchor_delta_height":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js new file mode 100644 index 00000000..d33ca1dd --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advanced_dlg',{"link_list":"Linkliste","link_is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","link_is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?","link_titlefield":"Titel","link_target_blank":"Neues Fenster \u00f6ffnen","link_target_same":"Im selben Fenster \u00f6ffnen","link_target":"Fenster","link_url":"Adresse","link_title":"Link einf\u00fcgen/ver\u00e4ndern","image_align_right":"Rechts","image_align_left":"Links","image_align_textbottom":"Unten im Text","image_align_texttop":"Oben im Text","image_align_bottom":"Unten","image_align_middle":"Mittig","image_align_top":"Oben","image_align_baseline":"Zeile","image_align":"Ausrichtung","image_hspace":"Horizontaler Abstand","image_vspace":"Vertikaler Abstand","image_dimensions":"Abmessungen","image_alt":"Alternativtext","image_list":"Bilderliste","image_border":"Rahmen","image_src":"Adresse","image_title":"Bild einf\u00fcgen/ver\u00e4ndern","charmap_title":"Sonderzeichen","colorpicker_name":"Name:","colorpicker_color":"Farbe:","colorpicker_named_title":"Benannte Farben","colorpicker_named_tab":"Benannte Farben","colorpicker_palette_title":"Farbpalette","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Farbwahl","colorpicker_picker_tab":"Farbwahl","colorpicker_title":"Farbe","code_wordwrap":"Automatischer Zeilenumbruch","code_title":"HTML-Quellcode bearbeiten","anchor_name":"Name des Ankers","anchor_title":"Anker einf\u00fcgen/ver\u00e4ndern","about_loaded":"Geladene Plugins","about_version":"Version","about_author":"Urheber","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"Lizenzbedingungen","about_help":"Hilfe","about_general":"\u00dcber","about_title":"\u00dcber TinyMCE","charmap_usage":"Navigation mit linken und rechten Pfeilen.","anchor_invalid":"Bitte geben Sie einen g\u00fcltigen Namen f\u00fcr den Anker ein!","accessibility_help":"Eingabehilfe","accessibility_usage_title":"Allgemeine Verwendung","invalid_color_value":"Ung\u00fcltige Farbangabe"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js new file mode 100644 index 00000000..6e584818 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js new file mode 100644 index 00000000..50cd87e3 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""}); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/link.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/link.htm new file mode 100644 index 00000000..5d9dea9b --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/link.htm @@ -0,0 +1,57 @@ + + + + {#advanced_dlg.link_title} + + + + + + + +
            + + +
            +
            + + + + + + + + + + + + + + + + + + + + + +
            + + + + +
             
            +
            +
            + +
            + + +
            +
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm new file mode 100644 index 00000000..20ec2f5a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm @@ -0,0 +1,47 @@ + + + + {#advanced_dlg.accessibility_help} + + + + +

            {#advanced_dlg.accessibility_usage_title}

            +

            Toolbars

            +

            Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

            + +

            Status Bar

            +

            To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

            + +

            Context Menu

            +

            Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

            + +

            Keyboard Shortcuts

            + + + + + + + + + + + + + + + + + + + + + +
            KeystrokeFunction
            Control-BBold
            Control-IItalic
            Control-ZUndo
            Control-YRedo
            + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css new file mode 100644 index 00000000..2fd94a1f --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css @@ -0,0 +1,50 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css new file mode 100644 index 00000000..879786fc --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css @@ -0,0 +1,118 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png new file mode 100644 index 00000000..1e53560e Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif new file mode 100644 index 00000000..d2f93671 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif new file mode 100644 index 00000000..85e31dfb Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif new file mode 100644 index 00000000..adfdddcc Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif new file mode 100644 index 00000000..5bb90fd6 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif new file mode 100644 index 00000000..06812cb4 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css new file mode 100644 index 00000000..77083f31 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css @@ -0,0 +1,219 @@ +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr;background:transparent} +.defaultSkin iframe {display:block;} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} +.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} +.defaultSkin span.mce_visualblocks {background-position: -40px -40px} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css new file mode 100644 index 00000000..ee064842 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css @@ -0,0 +1,30 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ +/* You can extend this CSS by adding your own CSS file with the the content_css option */ + +/* Import other styles */ +@import url('content_base.css'); +@import url('content_typography.css'); +@import url('content_grid.css'); + +/* All other custom styles (everything else what Grappelli users might want to deploy) */ +@import url('customized.css'); diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css new file mode 100644 index 00000000..5d5ed2cb --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css @@ -0,0 +1,56 @@ +/* This file contains the CSS data for the editable area(iframe) of TinyMCE */ +/* You can extend this CSS by adding your own CSS file with the the content_css option */ + +* html body { + overflow-y: auto !important; overflow-x: auto !important; + font-size: 0; line-height: 0; +} + +body#tinymce, body#tinymce td, body#tinymce pre, body#tinymce ol, body#tinymce ul, body#tinymce li { + font-family: Arial, sans-serif; + font-size: 11px; line-height: 16px; font-weight: normal; color: #cc4343 !important; + white-space: normal; +} +body#tinymce { + margin: 0; padding: 10px 10px 10px 0 !important; + width: 620px; +} +body#tinymce.fullscreen { + width: 620px !important; /* Use this to apply the actual page-width and guarantee a wysiwyg content-structure */ +} + +a:link, a:visited, a:hover, a:active { + padding: 0; + color: #309bbf !important; + text-decoration: none !important; +} + +a.external:link, a.external:visited, a.external:hover, a.external:active { + padding: 0; + color: #309bbf !important; + text-decoration: underline !important; +} + +/* -- Absolute Break (Style=Umbruch) ---------- */ + +.clear { + clear: both !important; padding: 2px 0; + border-top-width: 2px !important; border-bottom-width: 2px !important; +} + +ol.clear, ul.clear { padding: 2px 0 2px 10px !important; } + +/* Clearing floats without extra markup + Based on How To Clear Floats Without Structural Markup by PiE + [http://www.positioniseverything.net/easyclearing.html] */ + +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clearfix {display: inline-block; border-top-width: 2px !important; border-bottom-width: 2px !important; } +* html .clearfix {height: 1%;} +.clearfix {display: block;} \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css new file mode 100644 index 00000000..e3ba36e0 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css @@ -0,0 +1,72 @@ +/* -- Basic Elements ---------- */ + +body#tinymce { + width: 630px; /* 10px more than body#tinymce in content_base.css to provide equal line-breaks */ +} +body#tinymce.fullscreen { + padding-left: 10px !important; + width: 630px !important; /* 10px more than body#tinymce.fullscreen in content_base.css to provide equal line-breaks */ + background: #eee; +} + +/* -- Typographic Elements ---------- */ + +body#tinymce h1, +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce ol, +body#tinymce ul, +body#tinymce code, +body#tinymce pre, +body#tinymce blockquote { + padding: 2px 5px 5px; + line-height: 16px !important; + background-color: #fff; +} +body#tinymce p.mce-grid-container { + padding: 2px 0 0; + line-height: 16px !important; + background-color: transparent; + border-top: 0px dashed #999 !important; + border-bottom: 0px solid #999 !important; +} +body#tinymce table.mceItemTable td { + border: 1px dashed #bbb !important; +} +body#tinymce div h1, +body#tinymce div h2, +body#tinymce div h3, +body#tinymce div h4, +body#tinymce div p, +body#tinymce div code, +body#tinymce div pre { + padding-left: 0; +} + +body#tinymce h1:before, +body#tinymce h2:before, +body#tinymce h3:before, +body#tinymce h4:before, +body#tinymce p:before, +body#tinymce ol:before, +body#tinymce ul:before, +body#tinymce code:before, +body#tinymce pre:before, +body#tinymce blockquote:before, +body#tinymce div:before { + position: relative; display: block; + font-family: "Andale Mono"; font-size: 9px; font-weight: normal; color: #999; +} +body#tinymce ol:before, +body#tinymce ul:before { + margin-left: -30px; +} +body#tinymce blockquote:before { + margin-left: -25px; +} +body#tinymce p.mce-grid-container:before { + margin-bottom: 3px; + color: #7c7c7c; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_cs.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_cs.css new file mode 100644 index 00000000..abfb8db0 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_cs.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h1:before { content: "Nadpis 1"; } +body#tinymce h2:before { content: "Nadpis 2"; } +body#tinymce h3:before { content: "Nadpis 3"; } +body#tinymce h4:before { content: "Nadpis 4"; } +body#tinymce ol:before { content: "Seřazený seznam"; } +body#tinymce ul:before { content: "Neseřazený seznam"; } +body#tinymce p:before { content: "Odstavec"; } +body#tinymce code:before { content: "Kód programu"; } +body#tinymce pre:before { content: "Předformátovaný text"; } +body#tinymce blockquote:before { content: "Citace"; } +body#tinymce div:before { content: "Div"; } diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css new file mode 100644 index 00000000..429dcac0 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h1:before { content: "Überschrift 1"; } +body#tinymce h2:before { content: "Überschrift 2"; } +body#tinymce h3:before { content: "Überschrift 3"; } +body#tinymce h4:before { content: "Überschrift 4"; } +body#tinymce ol:before { content: "Sortierte Liste"; } +body#tinymce ul:before { content: "Unsortierte Liste"; } +body#tinymce p:before { content: "Absatz"; } +body#tinymce p.mce-grid-container:before { content: "Template"; } +body#tinymce code:before { content: "Code"; } +body#tinymce pre:before { content: "Vorformatiert"; } +body#tinymce blockquote:before { content: "Zitatblock"; } \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css new file mode 100644 index 00000000..f6ce62b8 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h1:before { content: "Heading 1"; } +body#tinymce h2:before { content: "Heading 2"; } +body#tinymce h3:before { content: "Heading 3"; } +body#tinymce h4:before { content: "Heading 4"; } +body#tinymce ol:before { content: "Ordered List"; } +body#tinymce ul:before { content: "Unordered List"; } +body#tinymce p:before { content: "Paragraph"; } +body#tinymce code:before { content: "Code"; } +body#tinymce pre:before { content: "Preformatted"; } +body#tinymce blockquote:before { content: "Blockquote"; } +body#tinymce div:before { content: "Div"; } \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css new file mode 100644 index 00000000..306eb40c --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css @@ -0,0 +1,17 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h2:before { content: "Nagłówek 1"; } +body#tinymce h2:before { content: "Nagłówek 2"; } +body#tinymce h3:before { content: "Nagłówek 3"; } +body#tinymce h4:before { content: "Nagłówek 4"; } +body#tinymce ol:before { content: "Lista numerowana"; } +body#tinymce ul:before { content: "Lista nienumerowana"; } +body#tinymce p:before { content: "Paragraf"; } +body#tinymce code:before { content: "Kod"; } +body#tinymce pre:before { content: "Preformatowane"; } +body#tinymce blockquote:before { content: "Cytat"; } +body#tinymce div:before { content: "Blok"; } diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css new file mode 100644 index 00000000..c203794e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css @@ -0,0 +1,85 @@ +/* ----------------------------------------------------------------------- + + CSS for the display of grid-templates in the editor + Grid applies to tables & tabledesks instead of the originally used divs + + Grid based on BLUEPRINT CSS + http://code.google.com/p/blueprintcss/ + +----------------------------------------------------------------------- */ + + + +/* Basic Grid Properties +----------------------------------------------------------------------- */ + +.span-1, .span-2, .span-3, .span-4, +.span-5, .span-6, .span-7, .span-8, +.span-9, .span-10, .span-11, .span-12, +.span-13, .span-14, .span-15, .span-16, +.span-17, .span-18, .span-19, .span-20, +.span-21, .span-22, .span-23, .span-24 { + overflow: hidden !important; +} + +/* Use these classes to set the width of a column. */ +.span-1 { width: 30px; } +.span-2 { width: 70px; } +.span-3 { width: 110px; } +.span-4 { width: 150px; } +.span-5 { width: 190px; } +.span-6 { width: 230px; } +.span-7 { width: 270px; } +.span-8 { width: 310px; } +.span-9 { width: 350px; } +.span-10 { width: 390px; } +.span-11 { width: 430px; } +.span-12 { width: 470px; } +.span-13 { width: 510px; } +.span-14 { width: 550px; } +.span-15 { width: 590px; } +.span-16 { width: 630px; } +.span-17 { width: 670px; } +.span-18 { width: 710px; } +.span-19 { width: 750px; } +.span-20 { width: 790px; } +.span-21 { width: 830px; } +.span-22 { width: 870px; } +.span-23 { width: 910px; } +.span-24 { width: 950px; margin: 0; } + + + +/* Table - Grid Properties +----------------------------------------------------------------------- */ + +body#tinymce table.mceItemTable { + margin: 0 0 0 -1px; padding: 0; + border: 0 !important; + background: transparent; + table-layout: fixed; + border-collapse: collapse; + border-spacing: 0; +} +body#tinymce table.mceItemTable td { + margin: 0; padding: 0; + border: 1px dashed #ddd !important; + background: transparent; + vertical-align: top; +} +/* Simulates Blueprints class .last */ +body#tinymce table.mceItemTable td + td { + padding-left: 10px !important; +} +/* Nested Tables */ +table.mceItemTable td table.mceItemTable { + margin: -1px 0 -1px -1px !important; +} + + + +/* Append, Prepend, Push, Pull, Borders & Misc Classes/Elements: + Not implemented yet. +----------------------------------------------------------------------- */ + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css new file mode 100644 index 00000000..fd669346 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css @@ -0,0 +1,101 @@ +/* -- Typographic Elements ---------- */ + +body#tinymce h1, +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce li, +body#tinymce pre { + color: #666 !important; +} +body#tinymce h1, +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce ol, +body#tinymce ul, +body#tinymce code, +body#tinymce pre, +body#tinymce blockquote, +body#tinymce div { + margin: 0 0 10px; padding: 0; +} +body#tinymce h1 { + font-size: 19px; line-height: 23px; +} +body#tinymce h2 { + font-size: 17px; line-height: 21px; +} +body#tinymce h3 { + font-size: 15px; line-height: 19px; +} +body#tinymce h4 { + font-size: 12px; line-height: 16px; +} +body#tinymce ol, +body#tinymce ul { + padding-left: 35px !important; + list-style-position: outside; +} +body#tinymce ul { + list-style-type: disc; +} +body#tinymce ol li, +body#tinymce ul li { + margin-bottom: 5px; +} +body#tinymce ol li:last-child, +body#tinymce ul li:last-child { + margin-bottom: 0 !important; +} +body#tinymce pre, +body#tinymce code { + font-family: "Andale Mono"; +} +body#tinymce blockquote { + padding-left: 30px !important; +} + +/* -- Divs ---------- */ + +/*body#tinymce div { + min-height: 15px; + height: auto; + outline: 1px dashed #bbb; +}*/ + +/* -- Tables ---------- */ + +/*body#tinymce table.mceItemTable { + margin: 0; padding: 0; + border: 0 !important; + background: #ebe9e6 !important; + table-layout: auto; + border-collapse: collapse; + border-spacing: 0; +} +body#tinymce table.mceItemTable td { + border: 1px dashed #ccc !important; + background: #ebe9e6 !important; +} + +body#tinymce td { + vertical-align: top; +}*/ + +/* -- Images ---------- */ + +body#tinymce img { float: none; border: none !important; } + +body#tinymce img.img_left { float: left !important; margin: 14px 20px 14px 0; } +body#tinymce img.img_right { float: right !important; margin: 14px 0 14px 20px; border: none; } +body#tinymce img.img_block { display: block; float: none !important; clear: both !important; margin: 14px 0 !important; border: none; } + +body#tinymce img.img_left_nospacetop { float: left !important; margin: 2px 20px 14px 0; } +body#tinymce img.img_right_nospacetop { float: right !important; margin: 2px 0 14px 20px; border: none; } +body#tinymce img.img_block_nospacetop { display: block; float: none !important; clear: both !important; margin: 2px 0 14px 0 !important; border: none; } + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/customized.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/customized.css new file mode 100644 index 00000000..74eaecee --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/customized.css @@ -0,0 +1,22 @@ +/* ----------------------------------------------------------------------- + + Please use this file if you want to deploy any custom TinyMCE styles + which are not covered by the Grappelli skin. + + If you use background-images make sure to put them into the folder + "img/customized/" + +----------------------------------------------------------------------- */ + + + +/* Page Break +----------------------------------------------------------------------- */ + +body#tinymce img.mcePageBreak { + display: block; + width: 100%; + height: 16px; + margin-top: 12px; + background: #fff url(img/customized/pagebreak.png) 0 0 repeat-x; +} \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css new file mode 100644 index 00000000..facf6d60 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css @@ -0,0 +1,55 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ + + +/* Import & Modifications of Django/Grappelli styles +----------------------------------------------------------------------- */ +@import url('../../../../../../../stylesheets/screen.css'); +@import url('../../../../../../../stylesheets/partials/custom/tinymce.css'); +@import url('../../../../../../../stylesheets/mueller/grid/output.css'); + + + +/* Generic +----------------------------------------------------------------------- */ +body { + clear: both; + margin: 0; + padding: 0 20px 0; + height: 100%; + background: #fff !important; +} +body.filebrowser { + margin: 0 !important; +} +body > *:first-child { + margin-top: 20px; +} + +html { + height: 100%; +} +html, body { + background: transparent; + overflow-x: hidden !important; + overflow-y: auto !important; +} \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png new file mode 100644 index 00000000..a3758ef9 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png new file mode 100644 index 00000000..10a09f1e Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png new file mode 100644 index 00000000..81dc1a9b Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png new file mode 100644 index 00000000..56e0f051 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png new file mode 100644 index 00000000..497a5ad5 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png new file mode 100644 index 00000000..e36895f4 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png new file mode 100644 index 00000000..bc65403c Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png new file mode 100644 index 00000000..f4108807 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png new file mode 100644 index 00000000..07f0e0f7 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png new file mode 100644 index 00000000..4c569a2d Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png new file mode 100644 index 00000000..6fc421dd Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png new file mode 100644 index 00000000..267242e0 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png new file mode 100644 index 00000000..73408167 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png new file mode 100644 index 00000000..2f454441 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png new file mode 100644 index 00000000..539d2bb4 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png new file mode 100644 index 00000000..466d68a3 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png new file mode 100644 index 00000000..f36966cc Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_cell_props.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_cell_props.png new file mode 100644 index 00000000..1ff00045 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_cell_props.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_after.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_after.png new file mode 100644 index 00000000..229f59c0 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_after.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_before.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_before.png new file mode 100644 index 00000000..3a682a5e Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_col_before.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_col.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_col.png new file mode 100644 index 00000000..8f5abac3 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_col.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_row.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_row.png new file mode 100644 index 00000000..1eec2c00 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_delete_row.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_merge_cells.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_merge_cells.png new file mode 100644 index 00000000..85dc4345 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_merge_cells.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_after.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_after.png new file mode 100644 index 00000000..15311abd Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_after.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_before.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_before.png new file mode 100644 index 00000000..f04e317b Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_before.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_props.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_props.png new file mode 100644 index 00000000..eca608ba Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_row_props.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_split_cells.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_split_cells.png new file mode 100644 index 00000000..614fefdc Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table_split_cells.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png new file mode 100644 index 00000000..b7b613d4 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png new file mode 100644 index 00000000..9042cd3e Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png new file mode 100644 index 00000000..a5df8a4b Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png new file mode 100644 index 00000000..677b426d Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png new file mode 100644 index 00000000..c075fc1a Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/button_pagebreak.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/button_pagebreak.png new file mode 100644 index 00000000..bc9deadb Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/button_pagebreak.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/pagebreak.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/pagebreak.png new file mode 100644 index 00000000..b9f04bfd Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/customized/pagebreak.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png new file mode 100644 index 00000000..0b20b492 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png new file mode 100644 index 00000000..c5e796c0 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png new file mode 100644 index 00000000..22d4b0c8 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png new file mode 100644 index 00000000..9f5a976c Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css new file mode 100644 index 00000000..72e226c5 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css @@ -0,0 +1,528 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ + + + +/* Reset +----------------------------------------------------------------------- */ + +.grappelliSkin table, .grappelliSkin tbody, .grappelliSkin tr, .grappelliSkin td, +.grappelliSkin div, .grappelliSkin iframe, +.grappelliSkin a, .grappelliSkin img, .grappelliSkin span, +.grappelliSkin *, .grappelliSkin .text { + margin: 0; + padding: 0; + width: auto; + font-family: Arial, sans-serif; font-size: 11px; line-height: 15px; font-weight: normal; + text-decoration: none; text-align: left; white-space: nowrap; + border: none; + border-collapse: separate; + background: transparent; + vertical-align: baseline; + cursor: default; +} +.grappelliSkin table, .grappelliSkin tbody, .grappelliSkin tr, .grappelliSkin td { + margin: 0 !important; + border: 0 !important; + outline: 0 !important; +} +.grappelliSkin a { + text-decoration: none; + cursor: pointer; +} +.grappelliSkin table td { + padding: 0; + vertical-align: middle; +} +.grappelliSkin table td > a:first-child, +.grappelliSkin table th > a:first-child { + position: relative; + top: 0 !important; +} + +body.rtl .grappelliSkin table, body.rtl .grappelliSkin tbody, body.rtl .grappelliSkin tr, body.rtl .grappelliSkin td, +body.rtl .grappelliSkin div, body.rtl .grappelliSkin iframe, +body.rtl .grappelliSkin a, body.rtl .grappelliSkin img, body.rtl .grappelliSkin span, +body.rtl .grappelliSkin *, body.rtl .grappelliSkin .text { + text-align: right; +} + + + +/* Containers +----------------------------------------------------------------------- */ + +.grappelliSkin table { + background: transparent; +} +.grappelliSkin iframe { + display: block; + position: relative; top: 0; + margin: 0; padding-top: 0; + border-top: 1px solid #fff; + border-bottom: 1px solid #d4d4d4; +} +.predelete .grappelliSkin iframe { + border-top: 1px solid #ffe5e5; + border-bottom: 1px solid #e5caca; +} +.grappelliSkin td.mceToolbar { + padding-bottom: 5px; + border-bottom: 1px solid #d4d4d4!important; +} +.predelete .grappelliSkin td.mceToolbar { + border-bottom: 1px solid #e5caca !important; +} +.grappelliSkin td.mceToolbar.advanced_icons { + border-top: 1px solid #ccc !important; +} +.predelete .grappelliSkin td.mceToolbar.advanced_icons { + border-top: 1px solid #ffe5e5 !important; +} +.grappelliSkin td.mceIframeContainer { + margin-top: 0; padding-top: 0; + height: auto !important; + vertical-align: top !important; +} + + + +/* Layout +----------------------------------------------------------------------- */ + +#changelist span.mceEditor.grappelliSkin { + display: inline-block; + margin: -4px 0 -5px; +} +.grappelliSkin table.mceLayout { + height: auto !important; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: transparent; +} +.predelete .grappelliSkin table.mceLayout { + background: transparent !important; +} +#mce_fullscreen_container { +/* height: 100% !important;*/ + background: transparent; + background: #eee; +} +#mce_fullscreen_container table.mceLayout { + height: 100% !important; + border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; + background: #eee !important; +} + +#mce_fullscreen_container .grappelliSkin table.mceLayout tr.mceFirst > td { + padding: 8px 8px 5px; +} + +/* Additional Toolbar-Rows */ +#changelist .grappelliSkin table.mceToolbar { + margin: 0 !important; +} + +.grappelliSkin table.mceToolbar + table.mceToolbar, +#changelist .grappelliSkin table.mceToolbar + table.mceToolbar { + margin-top: 5px !important; + height: 28px; + background: transparent; +} +.grappelliSkin span.mceIcon, .grappelliSkin img.mceIcon { + display: block; + width: 20px; height: 20px; +} + +body.rtl .grappelliSkin span.mceIcon, body.rtl .grappelliSkin img.mceIcon { + width: 23px; +} + + + +/* Buttons +----------------------------------------------------------------------- */ + +.grappelliSkin .mceButton { + display: block; + margin-right: 2px; + width: 23px; height: 23px !important; + background: #fff; +} +.grappelliSkin .mceButton span, .grappelliSkin .mceListBox .mceOpen { + cursor: pointer; +} + +.grappelliSkin a.mceButtonEnabled { + border: 1px solid; + border-color: #d4d4d4 #c4c4c4 #c4c4c4 #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.grappelliSkin a.mceButtonEnabled:hover { + background: #e1f0f5; +} +.grappelliSkin a.mceButtonActive, .grappelliSkin a.mceButtonSelected { + border-color: #c0c0c0 #d2d2d2 #d2d2d2 #c0c0c0 !important; + background: #ddd; +} +.grappelliSkin .mceButtonDisabled { + border: 1px solid; + border-color: #d4d4d4 #fff #fff #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: transparent; +} +.predelete .grappelliSkin .mceButtonDisabled { + border-color: #e5caca #ffe5e5 #ffe5e5 #e5caca; +} +.grappelliSkin .mceButtonDisabled span { + opacity: 0.4; +} + +body.rtl .grappelliSkin .mceButton { + margin-left: 2px; + margin-right: 0; +} + + + +/* Separator +----------------------------------------------------------------------- */ + +.grappelliSkin .mceSeparator { + display: block; + width: 4px; height: 22px; +} + + + +/* Listbox +----------------------------------------------------------------------- */ + +.grappelliSkin table.mceListBox { + background: transparent; +} + +.grappelliSkin .mceListBox, .grappelliSkin .mceListBox a { + display: block; +} +.grappelliSkin .mceListBox .mceText { + position: relative; + padding: 2px 0 0 4px !important; + width: 90px; height: 21px; + border: 1px solid; + border-color: #c4c4c4 #d4d4d4 #d4d4d4 #c4c4c4; + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + background: #fafafa; + color: #666 !important; font-size: 11px !important; line-height: 20px; + overflow: hidden; +} + +.grappelliSkin .mceListBox .mceOpen { + margin-right: 4px; + width: 14px; height: 23px; + border: 1px solid; + border-color: #c4c4c4; + border-left: none; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; + background: #ddd url('img/menu/icon-mceOpen.png'); +} +.grappelliSkin table.mceListBoxEnabled:hover .mceText, +.grappelliSkin .mceListBoxHover .mceText, +.grappelliSkin .mceListBoxSelected .mceText { + background: #fff; +} +.grappelliSkin table.mceListBoxEnabled:hover .mceOpen, +.grappelliSkin .mceListBoxHover .mceOpen, +.grappelliSkin .mceListBoxSelected .mceOpen { + border-color: #c4c4c4 #d4d4d4 #d4d4d4 #c4c4c4; + background-color: #e1f0f5; +} +.grappelliSkin .mceListBoxSelected .mceText, +.grappelliSkin .mceListBoxSelected .mceOpen { + border-bottom-left-radius: 0 !important; -moz-border-radius-bottomleft: 0 !important; -webkit-border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; -moz-border-radius-bottomright: 0 !important; -webkit-border-bottom-right-radius: 0 !important; +} + +.grappelliSkin .mceListBoxMenu { + overflow: auto; + overflow-x: hidden; +} +.grappelliSkin .mceOldBoxModel .mceListBox .mceText { + height: 23px; +} + + + +/* SplitButton (not defined yet) +----------------------------------------------------------------------- */ +/* ColorSplitButton (not defined yet) +----------------------------------------------------------------------- */ + + + +/* Menu +----------------------------------------------------------------------- */ + +.grappelliSkin .mceMenu { + position: absolute; left: 0; top: -1px; z-index: 1000; + padding: 0; + min-width: 109px !important; + border: 1px solid #c4c4c4; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; + box-shadow: 0 5px 10px #999; -moz-box-shadow: 0 5px 10px #999; -webkit-box-shadow: 0 5px 10px #999; +} +.grappelliSkin .mceMenu table { + width: 100% !important; + border-top-right-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; + background: #fff; +} + +.grappelliSkin .mceMenu.mceDropDown { + border-radius: 5px !important; -moz-border-radius: 5px !important; -webkit-border-radius: 5px !important; + border: 2px solid #eee; +} +.grappelliSkin .mceMenu.mceDropDown table { + border-radius: 2px !important; -moz-border-radius: 2px !important; -webkit-border-radius: 2px !important; +} +.grappelliSkin .mceMenu a, .grappelliSkin .mceMenu span, .grappelliSkin .mceMenu { + display: block; + width: auto !important; + cursor: pointer; +} +.grappelliSkin .mceMenu td { + height: 18px; + border-bottom: 1px solid #d0d0d0; +} +.grappelliSkin .mceMenu tr.mceFirst td a { + border-top-right-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; +} +.grappelliSkin .mceMenu.mceDropDown tr.mceFirst td a { + border-top-left-radius: 3px; -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; +} +.grappelliSkin tr.mceMenuItemSeparator + tr.mceFirst td a { + border-top: none !important; + border-radius: 0 !important; -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; +} +.grappelliSkin .mceMenu tr.mceLast td { + border-bottom: none !important; +} +.grappelliSkin .mceMenu tr.mceLast td a { + border-bottom: none; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; +} + +.grappelliSkin .mceMenu a { + position: relative; + padding: 4px 0 3px; + color: #666 !important; +} +.grappelliSkin .mceMenu .mceText { + position: relative; display: block; + margin: 0; padding: 0 25px 0 4px; + background: transparent !important; +} +.grappelliSkin .mceMenu .mceIcon { + display: none; + width: 0; height: 0; + background: transparent !important; +} +.grappelliSkin .mceMenu .mceMenuItemEnabled a:hover, +.grappelliSkin .mceMenu .mceMenuItemEnabled a:active, +.grappelliSkin .mceMenu .mceMenuItemActive { + background-color: #e1f0f5 !important; +} +.grappelliSkin .mceMenuItemSelected a { + background-color: #ddd; +} +.grappelliSkin td.mceMenuItemSeparator { + height: 2px; + border: none; + background: #a9a9a9; +} + +.grappelliSkin .mceMenuItemTitle a { + border: 0; + background: #f2d6d6; +} + +.grappelliSkin .mceMenuItemTitle span.mceText { + padding-left: 4px; + color: #666; +} +.grappelliSkin .mceMenuItemDisabled .mceText { + color: #999; +} + + + +/* Language Specific Content Additions +----------------------------------------------------------------------- */ + +.grappelliSkin .mceMenuItemTitle span.mceText[title="Format"]:before, +.grappelliSkin .mceMenuItemTitle span.mceText[title="Style"]:before { + content: "Reset "; +} +.grappelliSkin .mceMenuItemTitle span.mceText[title="Format "]:after, +.grappelliSkin .mceMenuItemTitle span.mceText[title="Stil"]:after { + content: " zurücksetzen"; +} + + + +/* Statusbar: Progress, Resize +----------------------------------------------------------------------- */ + +#mce_fullscreen_container .grappelliSkin td.mceStatusbar { + border-top: 1px solid #fff; + height: 100%; +} +.grappelliSkin td.mceStatusbar > div { + display: none; +} + +.grappelliSkin .mcePlaceHolder { + position: relative; + border: 1px solid #d4d4d4; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #d6ebf2 url('img/icons/icon-mceResize.png') 50% 100% no-repeat; + cursor: s-resize; +} +.predelete .grappelliSkin .mcePlaceHolder { + border: 1px solid #e5caca; +} +.table .grappelliSkin .mcePlaceHolder, +.table .grappelliSkin .mcePlaceHolder { + left: 0; +} + +.grappelliSkin a.mceResize { + display: block; + width: 100%; height: 20px; + border: 1px solid transparent; + border-top-color: #fff; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; + background-image: url('img/icons/icon-mceResize.png'); + background-position: 50% 50%; + background-repeat: no-repeat; + cursor: s-resize; +} +.predelete .grappelliSkin a.mceResize { + border-top-color: #ffe5e5; +} +.grappelliSkin a.mceResize:link, .grappelliSkin a.mceResize:visited { + background-color: transparent; +} +.grappelliSkin a.mceResize:hover, .grappelliSkin a.mceResize:active { + border-color: #d4d4d4; + border-top-color: #ebebeb; + background-color: #d6ebf2; +} +.predelete .grappelliSkin a.mceResize:hover, .predelete .grappelliSkin a.mceResize:active { + border-color: #e5caca; + border-top-color: #ffe5e5; + background-color: #d6ebf2; +} + + + +/* Formats +----------------------------------------------------------------------- */ + +.grappelliSkin .mce_formatPreview a { /*apply specific styles here*/ } +.grappelliSkin .mce_p span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_pre span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h1 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h2 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h3 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h4 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h5 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h6 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_div span.mceText { /*apply specific styles here*/ } + + + +/* Toolbar: Theme & Plugins Defaults +----------------------------------------------------------------------- */ + +.grappelliSkin .mceToolbar span { + /*width: 100%; */height: 100%; + background-position: 0 0; + background-repeat: no-repeat; +} + + + +/* Grappelli Button Icons +----------------------------------------------------------------------- */ + +.grappelliSkin span.mce_bold { background-image: url('img/buttons/bold.png'); } +.grappelliSkin span.mce_italic { background-image: url('img/buttons/italic.png'); } +.grappelliSkin span.mce_underline { background-image: url('img/buttons/underline.png'); } +.grappelliSkin span.mce_undo { background-image: url('img/buttons/undo.png'); } +.grappelliSkin span.mce_redo { background-image: url('img/buttons/redo.png'); } +.grappelliSkin span.mce_bullist { background-image: url('img/buttons/bullist.png'); } +.grappelliSkin span.mce_numlist { background-image: url('img/buttons/numlist.png'); } +.grappelliSkin span.mce_blockquote { background-image: url('img/buttons/blockquote.png'); } +.grappelliSkin span.mce_link { background-image: url('img/buttons/link.png'); } +.grappelliSkin span.mce_unlink { background-image: url('img/buttons/unlink.png'); } +.grappelliSkin span.mce_image { background-image: url('img/buttons/image.png'); } +.grappelliSkin span.mce_code { background-image: url('img/buttons/code.png'); } +.grappelliSkin span.mce_charmap { background-image: url('img/buttons/charmap.png'); } + +.grappelliSkin span.mce_fullscreen { background-image: url('img/buttons/fullscreen.png'); } +.grappelliSkin span.mce_media { background-image: url('img/buttons/media.png'); } +.grappelliSkin span.mce_pasteword { background-image: url('img/buttons/pasteword.png'); } +.grappelliSkin span.mce_template { background-image: url('img/buttons/template.png'); } +.grappelliSkin span.mce_table { background-image: url('img/buttons/table.png'); } +.grappelliSkin span.mce_row_props { background-image: url('img/buttons/table_row_props.png'); } +.grappelliSkin span.mce_cell_props { background-image: url('img/buttons/table_cell_props.png'); } +.grappelliSkin span.mce_delete_row { background-image: url('img/buttons/table_delete_row.png'); } +.grappelliSkin span.mce_delete_col { background-image: url('img/buttons/table_delete_col.png'); } +.grappelliSkin span.mce_row_before { background-image: url('img/buttons/table_row_before.png'); } +.grappelliSkin span.mce_row_after { background-image: url('img/buttons/table_row_after.png'); } +.grappelliSkin span.mce_col_before { background-image: url('img/buttons/table_col_before.png'); } +.grappelliSkin span.mce_col_after { background-image: url('img/buttons/table_col_after.png'); } +.grappelliSkin span.mce_split_cells { background-image: url('img/buttons/table_split_cells.png'); } +.grappelliSkin span.mce_merge_cells { background-image: url('img/buttons/table_merge_cells.png'); } +.grappelliSkin span.mce_search { background-image: url('img/buttons/search.png'); } +.grappelliSkin span.mce_cleanup { background-image: url('img/buttons/cleanup.png'); } + +.grappelliSkin span.mce_grappelli_adv { background-image: url('img/buttons/show_advanced.png'); } +.grappelliSkin span.mce_grappelli_documentstructure { background-image: url('img/buttons/visualchars.png'); } + + + +/* Customized Button Icons +----------------------------------------------------------------------- */ + +.grappelliSkin span.mce_pagebreak { background-image: url('img/customized/button_pagebreak.png'); } + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css new file mode 100644 index 00000000..cbce6c6a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css @@ -0,0 +1,24 @@ +body, td, pre { margin:8px;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css new file mode 100644 index 00000000..6d9fc8dd --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css @@ -0,0 +1,106 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +background:#F0F0EE; +color: black; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE; color:#000;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;background-color:transparent;} +a:hover {color:#2B6FB6;background-color:transparent;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;background-color:transparent;} +input.invalid {border:1px solid #EE0000;background-color:transparent;} +input {background:#FFF; border:1px solid #CCC;color:black;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +font-weight:bold; +width:94px; height:23px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#cancel {float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} +.tabs li.current {font-weight: bold; margin-right:2px;} +.tabs span {float:left; display:block; padding:0px 10px 0 0;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css new file mode 100644 index 00000000..effbbe15 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css @@ -0,0 +1,106 @@ +/* Reset */ +.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} +.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} +.highcontrastSkin table td {vertical-align:middle} + +.highcontrastSkin .mceIconOnly {display: block !important;} + +/* External */ +.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} +.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} + +/* Layout */ +.highcontrastSkin table.mceLayout {border: 1px solid;} +.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} +.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} +.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} +.highcontrastSkin .mceStatusbar div {float:left} +.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} + +.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} +.highcontrastSkin .mceToolbar tr { display: block;} +.highcontrastSkin .mceToolbar table { display: block; } + +/* Button */ + +.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} +.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} +.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} + +/* Separator */ +.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} + +/* ListBox */ +.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} +.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} +.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} + +.highcontrastSkin .mceListBoxMenu {overflow-y:auto} + +/* SplitButton */ +.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} +.highcontrastSkin .mceSplitButton tr { display: table-row; } +.highcontrastSkin table.mceSplitButton { display: table; } +.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } +.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} + +/* Menu */ +.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} +.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; direction:ltr} +.highcontrastSkin .mceMenu table {background:white; color: black} +.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} +.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} +.highcontrastSkin .mceMenu td {height:2em} +.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} +.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} +.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} +.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} +.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} +.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} +.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} +.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} +.highcontrastSkin .mceMenu span.mceMenuLine {display:none} +.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} +.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} + +/* ColorSplitButton */ +.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} +.highcontrastSkin .mceColorSplitMenu td {padding:2px} +.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} +.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} +.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} +.highcontrastSkin .mceColorPreview {display:none;} +.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} + +/* Progress,Resize */ +.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.highcontrastSkin .mce_p span.mceText {} +.highcontrastSkin .mce_address span.mceText {font-style:italic} +.highcontrastSkin .mce_pre span.mceText {font-family:monospace} +.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css new file mode 100644 index 00000000..a1a8f9bd --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css @@ -0,0 +1,48 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css new file mode 100644 index 00000000..a54db98d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css @@ -0,0 +1,118 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px} +#cancel {background:url(../default/img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} +#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} +#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png new file mode 100644 index 00000000..13a5cb03 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png new file mode 100644 index 00000000..7fc57f2b Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png new file mode 100644 index 00000000..c0dcc6ca Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css new file mode 100644 index 00000000..a3102237 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -0,0 +1,222 @@ +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {padding-left: 3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD; direction:ltr} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} +.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Rtl */ +.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} +.mceRtl .mceMenuItem .mceText {text-align: right} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} +.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} +.o2k7Skin span.mce_visualblocks {background-position: -40px -40px} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css new file mode 100644 index 00000000..50c9b76a --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -0,0 +1,8 @@ +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css new file mode 100644 index 00000000..960a8e47 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -0,0 +1,5 @@ +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm new file mode 100644 index 00000000..575d2ab6 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm @@ -0,0 +1,26 @@ + + + {#advanced_dlg.code_title} + + + + + +
            +
            {#advanced_dlg.code_title}
            +
            + + +
            +
            +
            +
            +
              +
            • +
            • +
            +
            +
            + + + diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js new file mode 100644 index 00000000..4b3209cc --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js @@ -0,0 +1 @@ +(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js new file mode 100644 index 00000000..01ce87c5 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js @@ -0,0 +1,84 @@ +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + deltaHeight : -20 + }; + }, + + getInfo : function() { + return { + longname : 'Simple theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + } + }); + + tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); +})(); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif new file mode 100644 index 00000000..6fcbcb5d Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js new file mode 100644 index 00000000..59bf788d --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.simple',{"cleanup_desc":"Quellcode aufr\u00e4umen","redo_desc":"Wiederholen (Strg+Y)","undo_desc":"R\u00fcckg\u00e4ngig (Strg+Z)","numlist_desc":"Nummerierung","bullist_desc":"Aufz\u00e4hlung","striketrough_desc":"Durchgestrichen","underline_desc":"Unterstrichen (Strg+U)","italic_desc":"Kursiv (Strg+I)","bold_desc":"Fett (Strg+B)"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js new file mode 100644 index 00000000..088ed0fc --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"}); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css new file mode 100644 index 00000000..2506c807 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css @@ -0,0 +1,25 @@ +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css new file mode 100644 index 00000000..076fe84e --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css @@ -0,0 +1,32 @@ +/* Reset */ +.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css new file mode 100644 index 00000000..595809fa --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css @@ -0,0 +1,17 @@ +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png new file mode 100644 index 00000000..527e3495 Binary files /dev/null and b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png differ diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css new file mode 100644 index 00000000..cf6c35d1 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css @@ -0,0 +1,35 @@ +/* Reset */ +.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/tiny_mce.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/tiny_mce.js new file mode 100644 index 00000000..44d9fd90 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/tiny_mce.js @@ -0,0 +1 @@ +(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.8",releaseDate:"2012-11-20",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(c,e,d){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,e,d)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&Object.prototype.toString.call(o)==="[object Array]"){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey},metaKeyPressed:function(b){return a.isMac?b.metaKey:b.ctrlKey&&!b.altKey}}})(tinymce);tinymce.util.Quirks=function(a){var j=tinymce.VK,f=j.BACKSPACE,k=j.DELETE,e=a.dom,l=a.selection,H=a.settings,v=a.parser,o=a.serializer,E=tinymce.each;function A(N,M){try{a.getDoc().execCommand(N,false,M)}catch(L){}}function n(){var L=a.getDoc().documentMode;return L?L:6}function z(L){return L.isDefaultPrevented()}function J(){function L(O){var M,Q,N,P;M=l.getRng();Q=e.getParent(M.startContainer,e.isBlock);if(O){Q=e.getNext(Q,e.isBlock)}if(Q){N=Q.firstChild;while(N&&N.nodeType==3&&N.nodeValue.length===0){N=N.nextSibling}if(N&&N.nodeName==="SPAN"){P=N.cloneNode(false)}}E(e.select("span",Q),function(R){R.setAttribute("data-mce-mark","1")});a.getDoc().execCommand(O?"ForwardDelete":"Delete",false,null);Q=e.getParent(M.startContainer,e.isBlock);E(e.select("span",Q),function(R){var S=l.getBookmark();if(P){e.replace(P.cloneNode(false),R,true)}else{if(!R.getAttribute("data-mce-mark")){e.remove(R,true)}else{R.removeAttribute("data-mce-mark")}}l.moveToBookmark(S)})}a.onKeyDown.add(function(M,O){var N;N=O.keyCode==k;if(!z(O)&&(N||O.keyCode==f)&&!j.modifierPressed(O)){O.preventDefault();L(N)}});a.addCommand("Delete",function(){L()})}function q(){function L(O){var N=e.create("body");var P=O.cloneContents();N.appendChild(P);return l.serializer.serialize(N,{format:"html"})}function M(N){var P=L(N);var Q=e.createRng();Q.selectNode(a.getBody());var O=L(Q);return P===O}a.onKeyDown.add(function(O,Q){var P=Q.keyCode,N;if(!z(Q)&&(P==k||P==f)){N=O.selection.isCollapsed();if(N&&!e.isEmpty(O.getBody())){return}if(tinymce.isIE&&!N){return}if(!N&&!M(O.selection.getRng())){return}O.setContent("");O.selection.setCursorLocation(O.getBody(),0);O.nodeChanged()}})}function I(){a.onKeyDown.add(function(L,M){if(!z(M)&&M.keyCode==65&&j.metaKeyPressed(M)){M.preventDefault();L.execCommand("SelectAll")}})}function K(){if(!a.settings.content_editable){e.bind(a.getDoc(),"focusin",function(L){l.setRng(l.getRng())});e.bind(a.getDoc(),"mousedown",function(L){if(L.target==a.getDoc().documentElement){a.getWin().focus();l.setRng(l.getRng())}})}}function B(){a.onKeyDown.add(function(L,O){if(!z(O)&&O.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var N=l.getNode();var M=N.previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="hr"){e.remove(M);tinymce.dom.Event.cancel(O)}}}})}function y(){if(!Range.prototype.getClientRects){a.onMouseDown.add(function(M,N){if(!z(N)&&N.target.nodeName==="HTML"){var L=M.getBody();L.blur();setTimeout(function(){L.focus()},0)}})}}function h(){a.onClick.add(function(L,M){M=M.target;if(/^(IMG|HR)$/.test(M.nodeName)){l.getSel().setBaseAndExtent(M,0,M,1)}if(M.nodeName=="A"&&e.hasClass(M,"mceItemAnchor")){l.select(M)}L.nodeChanged()})}function c(){function M(){var O=e.getAttribs(l.getStart().cloneNode(false));return function(){var P=l.getStart();if(P!==a.getBody()){e.setAttrib(P,"style",null);E(O,function(Q){P.setAttributeNode(Q.cloneNode(true))})}}}function L(){return !l.isCollapsed()&&e.getParent(l.getStart(),e.isBlock)!=e.getParent(l.getEnd(),e.isBlock)}function N(O,P){P.preventDefault();return false}a.onKeyPress.add(function(O,Q){var P;if(!z(Q)&&(Q.keyCode==8||Q.keyCode==46)&&L()){P=M();O.getDoc().execCommand("delete",false,null);P();Q.preventDefault();return false}});e.bind(a.getDoc(),"cut",function(P){var O;if(!z(P)&&L()){O=M();a.onKeyUp.addToTop(N);setTimeout(function(){O();a.onKeyUp.remove(N)},0)}})}function b(){var M,L;e.bind(a.getDoc(),"selectionchange",function(){if(L){clearTimeout(L);L=0}L=window.setTimeout(function(){var N=l.getRng();if(!M||!tinymce.dom.RangeUtils.compareRanges(N,M)){a.nodeChanged();M=N}},50)})}function x(){document.body.setAttribute("role","application")}function t(){a.onKeyDown.add(function(L,N){if(!z(N)&&N.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var M=l.getNode().previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(N)}}}})}function C(){if(n()>7){return}A("RespectVisibilityInDesign",true);a.contentStyles.push(".mceHideBrInPre pre br {display: none}");e.addClass(a.getBody(),"mceHideBrInPre");v.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type===3&&P.value.charAt(P.value-1)!="\n"){P.value+="\n"}else{R.parent.insert(new tinymce.html.Node("#text",3),R,true).value="\n"}}}});o.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type==3){P.value=P.value.replace(/\r?\n$/,"")}}}})}function g(){e.bind(a.getBody(),"mouseup",function(N){var M,L=l.getNode();if(L.nodeName=="IMG"){if(M=e.getStyle(L,"width")){e.setAttrib(L,"width",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"width","")}if(M=e.getStyle(L,"height")){e.setAttrib(L,"height",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"height","")}}})}function d(){a.onKeyDown.add(function(R,S){var Q,L,M,O,P,T,N;Q=S.keyCode==k;if(!z(S)&&(Q||S.keyCode==f)&&!j.modifierPressed(S)){L=l.getRng();M=L.startContainer;O=L.startOffset;N=L.collapsed;if(M.nodeType==3&&M.nodeValue.length>0&&((O===0&&!N)||(N&&O===(Q?0:1)))){nonEmptyElements=R.schema.getNonEmptyElements();S.preventDefault();P=e.create("br",{id:"__tmp"});M.parentNode.insertBefore(P,M);R.getDoc().execCommand(Q?"ForwardDelete":"Delete",false,null);M=l.getRng().startContainer;T=M.previousSibling;if(T&&T.nodeType==1&&!e.isBlock(T)&&e.isEmpty(T)&&!nonEmptyElements[T.nodeName.toLowerCase()]){e.remove(T)}e.remove("__tmp")}}})}function G(){a.onKeyDown.add(function(P,Q){var N,M,R,L,O;if(z(Q)||Q.keyCode!=j.BACKSPACE){return}N=l.getRng();M=N.startContainer;R=N.startOffset;L=e.getRoot();O=M;if(!N.collapsed||R!==0){return}while(O&&O.parentNode&&O.parentNode.firstChild==O&&O.parentNode!=L){O=O.parentNode}if(O.tagName==="BLOCKQUOTE"){P.formatter.toggle("blockquote",null,O);N=e.createRng();N.setStart(M,0);N.setEnd(M,0);l.setRng(N)}})}function F(){function L(){a._refreshContentEditable();A("StyleWithCSS",false);A("enableInlineTableEditing",false);if(!H.object_resizing){A("enableObjectResizing",false)}}if(!H.readonly){a.onBeforeExecCommand.add(L);a.onMouseDown.add(L)}}function s(){function L(M,N){E(e.select("a"),function(Q){var O=Q.parentNode,P=e.getRoot();if(O.lastChild===Q){while(O&&!e.isBlock(O)){if(O.parentNode.lastChild!==O||O===P){return}O=O.parentNode}e.add(O,"br",{"data-mce-bogus":1})}})}a.onExecCommand.add(function(M,N){if(N==="CreateLink"){L(M)}});a.onSetContent.add(l.onSetContent.add(L))}function m(){if(H.forced_root_block){a.onInit.add(function(){A("DefaultParagraphSeparator",H.forced_root_block)})}}function p(){function L(N,M){if(!N||!M.initial){a.execCommand("mceRepaint")}}a.onUndo.add(L);a.onRedo.add(L);a.onSetContent.add(L)}function i(){a.onKeyDown.add(function(M,N){var L;if(!z(N)&&N.keyCode==f){L=M.getDoc().selection.createRange();if(L&&L.item){N.preventDefault();M.undoManager.beforeChange();e.remove(L.item(0));M.undoManager.add()}}})}function r(){var L;if(n()>=10){L="";E("p div h1 h2 h3 h4 h5 h6".split(" "),function(M,N){L+=(N>0?",":"")+M+":empty"});a.contentStyles.push(L+"{padding-right: 1px !important}")}}function u(){var N,M,ad,L,Y,ab,Z,ac,O,P,aa,W,V,X=document,T=a.getDoc();if(!H.object_resizing||H.webkit_fake_resize===false){return}A("enableObjectResizing",false);aa={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};function R(ah){var ag,af;ag=ah.screenX-ab;af=ah.screenY-Z;W=ag*Y[2]+ac;V=af*Y[3]+O;W=W<5?5:W;V=V<5?5:V;if(j.modifierPressed(ah)||(ad.nodeName=="IMG"&&Y[2]*Y[3]!==0)){W=Math.round(V/P);V=Math.round(W*P)}e.setStyles(L,{width:W,height:V});if(Y[2]<0&&L.clientWidth<=W){e.setStyle(L,"left",N+(ac-W))}if(Y[3]<0&&L.clientHeight<=V){e.setStyle(L,"top",M+(O-V))}}function ae(){function af(ag,ah){if(ah){if(ad.style[ag]||!a.schema.isValid(ad.nodeName.toLowerCase(),ag)){e.setStyle(ad,ag,ah)}else{e.setAttrib(ad,ag,ah)}}}af("width",W);af("height",V);e.unbind(T,"mousemove",R);e.unbind(T,"mouseup",ae);if(X!=T){e.unbind(X,"mousemove",R);e.unbind(X,"mouseup",ae)}e.remove(L);Q(ad)}function Q(ai){var ag,ah,af;S();ag=e.getPos(ai);N=ag.x;M=ag.y;ah=ai.offsetWidth;af=ai.offsetHeight;if(ad!=ai){ad=ai;W=V=0}E(aa,function(al,aj){var ak;ak=e.get("mceResizeHandle"+aj);if(!ak){ak=e.add(T.documentElement,"div",{id:"mceResizeHandle"+aj,"class":"mceResizeHandle",style:"cursor:"+aj+"-resize; margin:0; padding:0"});e.bind(ak,"mousedown",function(am){am.preventDefault();ae();ab=am.screenX;Z=am.screenY;ac=ad.clientWidth;O=ad.clientHeight;P=O/ac;Y=al;L=ad.cloneNode(true);e.addClass(L,"mceClonedResizable");e.setStyles(L,{left:N,top:M,margin:0});T.documentElement.appendChild(L);e.bind(T,"mousemove",R);e.bind(T,"mouseup",ae);if(X!=T){e.bind(X,"mousemove",R);e.bind(X,"mouseup",ae)}})}else{e.show(ak)}e.setStyles(ak,{left:(ah*al[0]+N)-(ak.offsetWidth/2),top:(af*al[1]+M)-(ak.offsetHeight/2)})});if(!tinymce.isOpera&&ad.nodeName=="IMG"){ad.setAttribute("data-mce-selected","1")}}function S(){if(ad){ad.removeAttribute("data-mce-selected")}for(var af in aa){e.hide("mceResizeHandle"+af)}}a.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}");function U(){var af=e.getParent(l.getNode(),"table,img");E(e.select("img[data-mce-selected]"),function(ag){ag.removeAttribute("data-mce-selected")});if(af){Q(af)}else{S()}}a.onNodeChange.add(U);e.bind(T,"selectionchange",U);a.serializer.addAttributeFilter("data-mce-selected",function(af,ag){var ah=af.length;while(ah--){af[ah].attr(ag,null)}})}function D(){if(n()<9){v.addNodeFilter("noscript",function(L){var M=L.length,N,O;while(M--){N=L[M];O=N.firstChild;if(O){N.attr("data-mce-innertext",O.value)}}});o.addNodeFilter("noscript",function(L){var M=L.length,N,P,O;while(M--){N=L[M];P=L[M].firstChild;if(P){P.value=tinymce.html.Entities.decode(P.value)}else{O=N.attributes.map["data-mce-innertext"];if(O){N.attr("data-mce-innertext",null);P=new tinymce.html.Node("#text",3);P.value=O;P.raw=true;N.append(P)}}}})}}t();G();q();if(tinymce.isWebKit){d();J();K();h();m();if(tinymce.isIDevice){b()}else{u();I()}}if(tinymce.isIE){B();x();C();g();i();r();D()}if(tinymce.isGecko){B();y();c();F();s();p()}if(tinymce.isOpera){u()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script noscript style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);textBlockElementsMap=m("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure");v=m("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",textBlockElementsMap);function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){x.reverse();A=o=f.filterNode(x[0].clone());for(u=0;u0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){if(!q){return false}var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},addStyle:function(j){var k=this.doc,i;styleElm=k.getElementById("mceDefaultStyles");if(!styleElm){styleElm=k.createElement("style"),styleElm.id="mceDefaultStyles";styleElm.type="text/css";i=k.getElementsByTagName("head")[0];if(i.firstChild){i.insertBefore(styleElm,i.firstChild)}else{i.appendChild(styleElm)}}if(styleElm.styleSheet){styleElm.styleSheet.cssText+=j}else{styleElm.appendChild(k.createTextNode(j))}},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
            "+j;m.removeChild(m.firstChild)}catch(l){var n=i.create("div");n.innerHTML="
            "+j;g(e.grep(n.childNodes),function(p,o){if(o&&m.canHaveHTML){m.appendChild(p)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,v,q,t,s=d.dom.doc,m=s.body,r,u;function j(C){var y,B,x,A,z;x=h.create("a");y=C?k:v;B=C?p:q;A=n.duplicate();if(y==s||y==s.documentElement){y=m;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);h.remove(x);n.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){h.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{if(y.canHaveHTML){y.innerHTML="\uFEFF";x=y.firstChild;A.moveToElementText(x);A.collapse(f)}}n.setEndPoint(C?"StartToStart":"EndToEnd",A);h.remove(x)}}k=i.startContainer;p=i.startOffset;v=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==v&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){t=k.previousSibling;if(t&&!t.hasChildNodes()&&h.isBlock(t)){t.innerHTML="\uFEFF"}else{t=null}k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(t){t.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{u=k.childNodes[p];l=m.createControlRange();l.addElement(u);l.select();r=d.getRng();if(r.item&&u===r.item(0)){return}}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return ye[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="

            ";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="
            ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var i=this,h=i.getRng(),j,g,l,k;if(h.duplicate||h.item){if(h.item){return h.item(0)}l=h.duplicate();l.collapse(1);j=l.parentElement();if(j.ownerDocument!==i.dom.doc){j=i.dom.getRoot()}g=k=h.parentElement();while(k=k.parentNode){if(k==j){j=g;break}}return j}else{j=h.startContainer;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[Math.min(j.childNodes.length-1,h.startOffset)]}if(j&&j.nodeType==3){return j.parentNode}return j}},getEnd:function(){var h=this,g=h.getRng(),j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);j=g.parentElement();if(j.ownerDocument!==h.dom.doc){j=h.dom.getRoot()}if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=g.endContainer;i=g.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[i>0?i-1:i]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
            '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},selectorChanged:function(g,j){var h=this,i;if(!h.selectorChangedData){h.selectorChangedData={};i={};h.editor.onNodeChange.addToTop(function(l,k,o){var p=h.dom,m=p.getParents(o,null,p.getRoot()),n={};e(h.selectorChangedData,function(r,q){e(m,function(s){if(p.is(s,q)){if(!i[q]){e(r,function(t){t(true,{node:s,selector:q,parents:m})});i[q]=r}n[q]=r;return false}})});e(i,function(r,q){if(!n[q]){delete i[q];e(r,function(s){s(false,{node:o,selector:q,parents:m})})}})})}if(!h.selectorChangedData[g]){h.selectorChangedData[g]=[]}h.selectorChangedData[g].push(j);return h},scrollIntoView:function(k){var j,h,g=this,i=g.dom;h=i.getViewPort(g.editor.getWin());j=i.getPos(k).y;if(jh.y+h.h){g.editor.getWin().scrollTo(0,j0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("noscript",function(j){var k=j.length,l;while(k--){l=j[k].firstChild;if(l){l.value=a.html.Entities.decode(l.value)}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+(c?''+c+"":"")}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.keyboardNav=new d.ui.KeyboardNavigation({root:f.id+"_menu",items:c.select("a",f.id+"_menu"),onCancel:function(){f.hideMenu();f.focus()}});f.keyboardNav.focus();f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch();f.keyboardNav.destroy()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){var f=this;f.parent();a.clear(f.id+"_menu");a.clear(f.id+"_more");c.remove(f.id+"_menu");if(f.keyboardNav){f.keyboardNav.destroy()}}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
            ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
            ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}if(!this.editors.hasOwnProperty(l)){return a}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.contentStyles=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(!q.content_editable){p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden"}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.language+".js")}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,G=this,H=G.settings,D,y,z,C=G.getElement(),p,m,E,v,B,F,x,r=[];k.add(G);H.aria_label=H.aria_label||l.getAttrib(C,"aria-label",G.getLang("aria.rich_text_area"));if(H.theme){if(typeof H.theme!="function"){H.theme=H.theme.replace(/-/,"");p=h.get(H.theme);G.theme=new p();if(G.theme.init){G.theme.init(G,h.urls[H.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{G.theme=H.theme}}function A(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){A(u)});n=new t(G,o);G.plugins[s]=n;if(n.init){n.init(G,o);r.push(s)}}}i(g(H.plugins.replace(/\-/g,"")),A);if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new k.ControlManager(G);G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui&&G.theme){G.orgDisplay=C.style.display;if(typeof H.theme!="function"){D=H.width||C.style.width||C.offsetWidth;y=H.height||C.style.height||C.offsetHeight;z=H.min_height||100;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D,10)+(p.deltaWidth||0),100)}if(F.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),z)}p=G.theme.renderUI({targetNode:C,width:D,height:y,deltaWidth:H.delta_width,deltaHeight:H.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:D,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y';if(H.document_base_url!=k.documentBaseURL){G.iframeHTML+=''}if(k.isIE8){if(H.ie7_compat){G.iframeHTML+=''}else{G.iframeHTML+=''}}G.iframeHTML+='';for(x=0;x'}G.contentCSS=[];v=H.body_id||"tinymce";if(v.indexOf("=")!=-1){v=G.getParam("body_id","","hash");v=v[G.id]||v}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='
            ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",allowTransparency:"true",title:H.aria_label,style:{width:"100%",height:y,display:"block"}});G.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=G.orgDisplay}C.style.visibility=G.orgVisibility;l.get(G.id).style.display="none";l.setAttrib(G.id,"aria-hidden",true);if(!k.relaxedDomain||!E){G.initContentBody()}C=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m,s;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(t,u){var v=t.length,y,A=n.dom,z,x;while(v--){y=t[v];z=y.attr(u);x="data-mce-"+u;if(!y.attributes.map[x]){if(u==="style"){y.attr(x,A.serializeStyle(A.parseStyle(z),y.name))}else{y.attr(x,n.convertURL(z,u,y.name))}}}});n.parser.addNodeFilter("script",function(t,u){var v=t.length,x;while(v--){x=t[v];x.attr("type","mce-"+(x.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(t,u){var v=t.length,x;while(v--){x=t[v];x.type=8;x.name="#comment";x.value="[CDATA["+x.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(u,v){var x=u.length,y,t=n.schema.getNonEmptyElements();while(x--){y=u[x];if(y.isEmpty(t)){y.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer,n);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.onExecCommand.add(function(t,u){if(!/^(FontName|FontSize)$/.test(u)){n.nodeChanged()}});n.serializer.onPreProcess.add(function(t,u){return n.onPreProcess.dispatch(n,u,t)});n.serializer.onPostProcess.add(function(t,u){return n.onPostProcess.dispatch(n,u,t)});n.onPreInit.dispatch(n);if(!p.browser_spellcheck&&!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(t,u){i(p.protect,function(v){u.content=u.content.replace(v,function(x){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(t,u){u.content=u.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
            [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});if(n.contentStyles.length>0){s="";i(n.contentStyles,function(t){s+=t+"\r\n"});n.dom.addStyle(s)}i(n.contentCSS,function(t){n.dom.loadCSS(t)});if(p.auto_focus){setTimeout(function(){var t=k.get(p.auto_focus);t.selection.select(t.getBody(),1);t.selection.collapse(1);t.getBody().focus();t.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){if(u.lastIERng){t.setRng(u.lastIERng)}n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
            "}else{r='
            '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}if(!o.settings.content_editable||document.activeElement===o.getBody()){o.selection.normalize()}return p.content},getContent:function(o){var n=this,p,m=n.getBody();o=o||{};o.format=o.format||"html";o.get=true;o.getInner=true;if(!o.no_events){n.onBeforeGetContent.dispatch(n,o)}if(o.format=="raw"){p=m.innerHTML}else{if(o.format=="text"){p=m.innerText||m.textContent}else{p=n.serializer.serialize(m,o)}}if(o.format!="text"){o.content=k.trim(p)}else{o.content=p}if(!o.no_events){n.onGetContent.dispatch(n,o)}return o.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!p.getAttrib(s,"href",false)){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,o=m.getContainer(),n=m.getDoc();if(!m.removed){m.removed=1;if(b&&n){n.execCommand("SelectAll")}m.save();l.setStyle(m.id,"display",m.orgDisplay);if(!m.settings.content_editable){j.unbind(m.getWin());j.unbind(m.getDoc())}j.unbind(m.getBody());j.clear(o);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(o)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){g.preventDefault();g.stopPropagation()}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(i,m){if(m.keyCode!=65||!a.VK.metaKeyPressed(m)){l.selection.normalize()}l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k(i,n)}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=p.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();if(p.getRng().setStart){v.setStart(x,0);v.setEnd(x,x.childNodes.length);p.setRng(v)}else{f("SelectAll")}}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(x){var v=m.getParent(p.getNode(),"ul,ol");return v&&(x==="insertunorderedlist"&&v.tagName==="UL"||x==="insertorderedlist"&&v.tagName==="OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getBody(),"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}}c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k1||ag==ay||ag.tagName=="BR"){return ag}}}var aq=aa.selection.getRng();var av=aq.startContainer;var ap=aq.endContainer;if(av!=ap&&aq.endOffset===0){var au=ar(av,ap);var at=au.nodeType==3?au.length:au.childNodes.length;aq.setEnd(au,at)}return aq}function ad(at,ay,aw,av,aq){var ap=[],ar=-1,ax,aA=-1,au=-1,az;T(at.childNodes,function(aC,aB){if(aC.nodeName==="UL"||aC.nodeName==="OL"){ar=aB;ax=aC;return false}});T(at.childNodes,function(aC,aB){if(aC.nodeName==="SPAN"&&c.getAttrib(aC,"data-mce-type")=="bookmark"){if(aC.id==ay.id+"_start"){aA=aB}else{if(aC.id==ay.id+"_end"){au=aB}}}});if(ar<=0||(aAar)){T(a.grep(at.childNodes),aq);return 0}else{az=c.clone(aw,X);T(a.grep(at.childNodes),function(aC,aB){if((aAar&&aB>ar)){ap.push(aC);aC.parentNode.removeChild(aC)}});if(aAar){at.insertBefore(az,ax.nextSibling)}}av.push(az);T(ap,function(aB){az.appendChild(aB)});return az}}function an(aq,at,aw){var ap=[],av,ar,au=true;av=am.inline||am.block;ar=c.create(av);ab(ar);N.walk(aq,function(ax){var ay;function az(aA){var aF,aD,aB,aC,aE;aE=au;aF=aA.nodeName.toLowerCase();aD=aA.parentNode.nodeName.toLowerCase();if(aA.nodeType===1&&x(aA)){aE=au;au=x(aA)==="true";aC=true}if(g(aF,"br")){ay=0;if(am.block){c.remove(aA)}return}if(am.wrapper&&y(aA,ae,al)){ay=0;return}if(au&&!aC&&am.block&&!am.wrapper&&I(aF)){aA=c.rename(aA,av);ab(aA);ap.push(aA);ay=0;return}if(am.selector){T(ah,function(aG){if("collapsed" in aG&&aG.collapsed!==ai){return}if(c.is(aA,aG.selector)&&!b(aA)){ab(aA,aG);aB=true}});if(!am.inline||aB){ay=0;return}}if(au&&!aC&&d(av,aF)&&d(aD,av)&&!(!aw&&aA.nodeType===3&&aA.nodeValue.length===1&&aA.nodeValue.charCodeAt(0)===65279)&&!b(aA)){if(!ay){ay=c.clone(ar,X);aA.parentNode.insertBefore(ay,aA);ap.push(ay)}ay.appendChild(aA)}else{if(aF=="li"&&at){ay=ad(aA,at,ar,ap,az)}else{ay=0;T(a.grep(aA.childNodes),az);if(aC){au=aE}ay=0}}}T(ax,az)});if(am.wrap_links===false){T(ap,function(ax){function ay(aC){var aB,aA,az;if(aC.nodeName==="A"){aA=c.clone(ar,X);ap.push(aA);az=a.grep(aC.childNodes);for(aB=0;aB1||!H(az))&&ax===0){c.remove(az,1);return}if(am.inline||am.wrapper){if(!am.exact&&ax===1){az=ay(az)}T(ah,function(aB){T(c.select(aB.inline,az),function(aD){var aC;if(aB.wrap_links===false){aC=aD.parentNode;do{if(aC.nodeName==="A"){return}}while(aC=aC.parentNode)}Z(aB,al,aD,aB.exact?aD:null)})});if(y(az.parentNode,ae,al)){c.remove(az,1);az=0;return C}if(am.merge_with_parents){c.getParent(az.parentNode,function(aB){if(y(aB,ae,al)){c.remove(az,1);az=0;return C}})}if(az&&am.merge_siblings!==false){az=u(E(az),az);az=u(az,E(az,C))}}})}if(am){if(ag){if(ag.nodeType){ac=c.createRng();ac.setStartBefore(ag);ac.setEndAfter(ag);an(p(ac,ah),null,true)}else{an(ag,null,true)}}else{if(!ai||!am.inline||c.select("td.mceSelected,th.mceSelected").length){var ao=aa.selection.getNode();if(!m&&ah[0].defaultBlock&&!c.getParent(ao,c.isBlock)){Y(ah[0].defaultBlock)}aa.selection.setRng(af());ak=r.getBookmark();an(p(r.getRng(C),ah),ak);if(am.styles&&(am.styles.color||am.styles.textDecoration)){a.walk(ao,L,"childNodes");L(ao)}r.moveToBookmark(ak);R(r.getRng(C));aa.nodeChanged()}else{U("apply",ae,al)}}}}function B(ad,am,af){var ag=V(ad),ao=ag[0],ak,aj,ac,al=true;function ae(av){var au,at,ar,aq,ax,aw;if(av.nodeType===3){return}if(av.nodeType===1&&x(av)){ax=al;al=x(av)==="true";aw=true}au=a.grep(av.childNodes);if(al&&!aw){for(at=0,ar=ag.length;at=0;ac--){ab=ah[ac].selector;if(!ab){return C}for(ag=ad.length-1;ag>=0;ag--){if(c.is(ad[ag],ab)){return C}}}}return X}function J(ab,ae,ac){var ad;if(!P){P={};ad={};aa.onNodeChange.addToTop(function(ag,af,ai){var ah=n(ai),aj={};T(P,function(ak,al){T(ah,function(am){if(y(am,al,{},ak.similar)){if(!ad[al]){T(ak,function(an){an(true,{node:am,format:al,parents:ah})});ad[al]=ak}aj[al]=ak;return false}})});T(ad,function(ak,al){if(!aj[al]){delete ad[al];T(ak,function(am){am(false,{node:ai,format:al,parents:ah})})}})})}T(ab.split(","),function(af){if(!P[af]){P[af]=[];P[af].similar=ac}P[af].push(ae)});return this}a.extend(this,{get:V,register:l,apply:Y,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z,formatChanged:J});j();W();function h(ab,ac){if(g(ab,ac.inline)){return C}if(g(ab,ac.block)){return C}if(ac.selector){return c.is(ab,ac.selector)}}function g(ac,ab){ac=ac||"";ab=ab||"";ac=""+(ac.nodeName||ac);ab=""+(ab.nodeName||ab);return ac.toLowerCase()==ab.toLowerCase()}function O(ac,ab){var ad=c.getStyle(ac,ab);if(ab=="color"||ab=="backgroundColor"){ad=c.toHex(ad)}if(ab=="fontWeight"&&ad==700){ad="bold"}return""+ad}function q(ab,ac){if(typeof(ab)!="string"){ab=ab(ac)}else{if(ac){ab=ab.replace(/%(\w+)/g,function(ae,ad){return ac[ad]||ae})}}return ab}function f(ab){return ab&&ab.nodeType===3&&/^([\t \r\n]+|)$/.test(ab.nodeValue)}function S(ad,ac,ab){var ae=c.create(ac,ab);ad.parentNode.insertBefore(ae,ad);ae.appendChild(ad);return ae}function p(ab,am,ae){var ap,an,ah,al,ad=ab.startContainer,ai=ab.startOffset,ar=ab.endContainer,ak=ab.endOffset;function ao(aA){var au,ax,az,aw,av,at;au=ax=aA?ad:ar;av=aA?"previousSibling":"nextSibling";at=c.getRoot();function ay(aB){return aB.nodeName=="BR"&&aB.getAttribute("data-mce-bogus")&&!aB.nextSibling}if(au.nodeType==3&&!f(au)){if(aA?ai>0:akan?an:ai];if(ad.nodeType==3){ai=0}}if(ar.nodeType==1&&ar.hasChildNodes()){an=ar.childNodes.length-1;ar=ar.childNodes[ak>an?an:ak-1];if(ar.nodeType==3){ak=ar.nodeValue.length}}function aq(au){var at=au;while(at){if(at.nodeType===1&&x(at)){return x(at)==="false"?at:au}at=at.parentNode}return au}function aj(au,ay,aA){var ax,av,az,at;function aw(aC,aE){var aF,aB,aD=aC.nodeValue;if(typeof(aE)=="undefined"){aE=aA?aD.length:0}if(aA){aF=aD.lastIndexOf(" ",aE);aB=aD.lastIndexOf("\u00a0",aE);aF=aF>aB?aF:aB;if(aF!==-1&&!ae){aF++}}else{aF=aD.indexOf(" ",aE);aB=aD.indexOf("\u00a0",aE);aF=aF!==-1&&(aB===-1||aF0&&ah.node.nodeType===3&&ah.node.nodeValue.charAt(ah.offset-1)===" "){if(ah.offset>1){ar=ah.node;ar.splitText(ah.offset-1)}}}}if(am[0].inline||am[0].block_expand){if(!am[0].inline||(ad.nodeType!=3||ai===0)){ad=ao(true)}if(!am[0].inline||(ar.nodeType!=3||ak===ar.nodeValue.length)){ar=ao()}}if(am[0].selector&&am[0].expand!==X&&!am[0].inline){ad=af(ad,"previousSibling");ar=af(ar,"nextSibling")}if(am[0].block||am[0].selector){ad=ac(ad,"previousSibling");ar=ac(ar,"nextSibling");if(am[0].block){if(!H(ad)){ad=ao(true)}if(!H(ar)){ar=ao()}}}if(ad.nodeType==1){ai=s(ad);ad=ad.parentNode}if(ar.nodeType==1){ak=s(ar)+1;ar=ar.parentNode}return{startContainer:ad,startOffset:ai,endContainer:ar,endOffset:ak}}function Z(ah,ag,ae,ab){var ad,ac,af;if(!h(ae,ah)){return X}if(ah.remove!="all"){T(ah.styles,function(aj,ai){aj=q(aj,ag);if(typeof(ai)==="number"){ai=aj;ab=0}if(!ab||g(O(ab,ai),aj)){c.setStyle(ae,ai,"")}af=1});if(af&&c.getAttrib(ae,"style")==""){ae.removeAttribute("style");ae.removeAttribute("data-mce-style")}T(ah.attributes,function(ak,ai){var aj;ak=q(ak,ag);if(typeof(ai)==="number"){ai=ak;ab=0}if(!ab||g(c.getAttrib(ab,ai),ak)){if(ai=="class"){ak=c.getAttrib(ae,ai);if(ak){aj="";T(ak.split(/\s+/),function(al){if(/mce\w+/.test(al)){aj+=(aj?" ":"")+al}});if(aj){c.setAttrib(ae,ai,aj);return}}}if(ai=="class"){ae.removeAttribute("className")}if(e.test(ai)){ae.removeAttribute("data-mce-"+ai)}ae.removeAttribute(ai)}});T(ah.classes,function(ai){ai=q(ai,ag);if(!ab||c.hasClass(ab,ai)){c.removeClass(ae,ai)}});ac=c.getAttribs(ae);for(ad=0;adad?ad:af]}if(ab.nodeType===3&&ag&&af>=ab.nodeValue.length){ab=new t(ab,aa.getBody()).next()||ab}if(ab.nodeType===3&&!ag&&af===0){ab=new t(ab,aa.getBody()).prev()||ab}return ab}function U(ak,ab,ai){var al="_mce_caret",ac=aa.settings.caret_debug;function ad(ap){var ao=c.create("span",{id:al,"data-mce-bogus":true,style:ac?"color:red":""});if(ap){ao.appendChild(aa.getDoc().createTextNode(G))}return ao}function aj(ap,ao){while(ap){if((ap.nodeType===3&&ap.nodeValue!==G)||ap.childNodes.length>1){return false}if(ao&&ap.nodeType===1){ao.push(ap)}ap=ap.firstChild}return true}function ag(ao){while(ao){if(ao.id===al){return ao}ao=ao.parentNode}}function af(ao){var ap;if(ao){ap=new t(ao,ao);for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType===3){return ao}}}}function ae(aq,ap){var ar,ao;if(!aq){aq=ag(r.getStart());if(!aq){while(aq=c.get(al)){ae(aq,false)}}}else{ao=r.getRng(true);if(aj(aq)){if(ap!==false){ao.setStartBefore(aq);ao.setEndBefore(aq)}c.remove(aq)}else{ar=af(aq);if(ar.nodeValue.charAt(0)===G){ar=ar.deleteData(0,1)}c.remove(aq,1)}r.setRng(ao)}}function ah(){var aq,ao,av,au,ar,ap,at;aq=r.getRng(true);au=aq.startOffset;ap=aq.startContainer;at=ap.nodeValue;ao=ag(r.getStart());if(ao){av=af(ao)}if(at&&au>0&&au=0;at--){aq.appendChild(c.clone(ax[at],false));aq=aq.firstChild}aq.appendChild(c.doc.createTextNode(G));aq=aq.firstChild;c.insertAfter(aw,ay);r.setCursorLocation(aq,1)}}function an(){var ap,ao,aq;ao=ag(r.getStart());if(ao&&!c.isEmpty(ao)){a.walk(ao,function(ar){if(ar.nodeType==1&&ar.id!==al&&!c.isEmpty(ar)){c.setAttrib(ar,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){aa.onBeforeGetContent.addToTop(function(){var ao=[],ap;if(aj(ag(r.getStart()),ao)){ap=ao.length;while(ap--){c.setAttrib(ao[ap],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ao){aa[ao].addToTop(function(){ae();an()})});aa.onKeyDown.addToTop(function(ao,aq){var ap=aq.keyCode;if(ap==8||ap==37||ap==39){ae(ag(r.getStart()))}an()});r.onSetContent.add(an);self._hasCaretEvents=true}if(ak=="apply"){ah()}else{am()}}function R(ac){var ab=ac.startContainer,ai=ac.startOffset,ae,ah,ag,ad,af;if(ab.nodeType==3&&ai>=ab.nodeValue.length){ai=s(ab);ab=ab.parentNode;ae=true}if(ab.nodeType==1){ad=ab.childNodes;ab=ad[Math.min(ai,ad.length-1)];ah=new t(ab,c.getParent(ab,c.isBlock));if(ai>ad.length-1||ae){ah.next()}for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!f(ag)){af=c.create("a",null,G);ag.parentNode.insertBefore(af,ag);ac.setStart(ag,0);r.setRng(ac);c.remove(af);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(f){var i=f.dom,e=f.selection,d=f.settings,h=f.undoManager,c=f.schema.getNonEmptyElements();function g(A){var v=e.getRng(true),G,j,z,u,p,M,B,o,k,n,t,J,x,C;function E(N){return N&&i.isBlock(N)&&!/^(TD|TH|CAPTION|FORM)$/.test(N.nodeName)&&!/^(fixed|absolute)/i.test(N.style.position)&&i.getContentEditable(N)!=="true"}function F(O){var N;if(b.isIE&&i.isBlock(O)){N=e.getRng();O.appendChild(i.create("span",null,"\u00a0"));e.select(O);O.lastChild.outerHTML="";e.setRng(N)}}function y(P){var O=P,Q=[],N;while(O=O.firstChild){if(i.isBlock(O)){return}if(O.nodeType==1&&!c[O.nodeName.toLowerCase()]){Q.push(O)}}N=Q.length;while(N--){O=Q[N];if(!O.hasChildNodes()||(O.firstChild==O.lastChild&&O.firstChild.nodeValue==="")){i.remove(O)}else{if(O.nodeName=="A"&&(O.innerText||O.textContent)===" "){i.remove(O)}}}}function m(O){var T,R,N,U,S,Q=O,P;N=i.createRng();if(O.hasChildNodes()){T=new a(O,O);while(R=T.current()){if(R.nodeType==3){N.setStart(R,0);N.setEnd(R,0);break}if(c[R.nodeName.toLowerCase()]){N.setStartBefore(R);N.setEndBefore(R);break}Q=R;R=T.next()}if(!R){N.setStart(Q,0);N.setEnd(Q,0)}}else{if(O.nodeName=="BR"){if(O.nextSibling&&i.isBlock(O.nextSibling)){if(!M||M<9){P=i.create("br");O.parentNode.insertBefore(P,O)}N.setStartBefore(O);N.setEndBefore(O)}else{N.setStartAfter(O);N.setEndAfter(O)}}else{N.setStart(O,0);N.setEnd(O,0)}}e.setRng(N);i.remove(P);S=i.getViewPort(f.getWin());U=i.getPos(O).y;if(US.y+S.h){f.getWin().scrollTo(0,U'}return R}function q(Q){var P,O,N;if(z.nodeType==3&&(Q?u>0:u=z.nodeValue.length){if(!b.isIE&&!D()){P=i.create("br");v.insertNode(P);v.setStartAfter(P);v.setEndAfter(P);O=true}}P=i.create("br");v.insertNode(P);if(b.isIE&&t=="PRE"&&(!M||M<8)){P.parentNode.insertBefore(i.doc.createTextNode("\r"),P)}N=i.create("span",{}," ");P.parentNode.insertBefore(N,P);e.scrollIntoView(N);i.remove(N);if(!O){v.setStartAfter(P);v.setEndAfter(P)}else{v.setStartBefore(P);v.setEndBefore(P)}e.setRng(v);h.add()}function s(N){do{if(N.nodeType===3){N.nodeValue=N.nodeValue.replace(/^[\r\n]+/,"")}N=N.firstChild}while(N)}function K(P){var N=i.getRoot(),O,Q;O=P;while(O!==N&&i.getContentEditable(O)!=="false"){if(i.getContentEditable(O)==="true"){Q=O}O=O.parentNode}return O!==N?Q:N}function I(O){var N;if(!b.isIE){O.normalize();N=O.lastChild;if(!N||(/^(left|right)$/gi.test(i.getStyle(N,"float",true)))){i.add(O,"br")}}}if(!v.collapsed){f.execCommand("Delete");return}if(A.isDefaultPrevented()){return}z=v.startContainer;u=v.startOffset;x=(d.force_p_newlines?"p":"")||d.forced_root_block;x=x?x.toUpperCase():"";M=i.doc.documentMode;B=A.shiftKey;if(z.nodeType==1&&z.hasChildNodes()){C=u>z.childNodes.length-1;z=z.childNodes[Math.min(u,z.childNodes.length-1)]||z;if(C&&z.nodeType==3){u=z.nodeValue.length}else{u=0}}j=K(z);if(!j){return}h.beforeChange();if(!i.isBlock(j)&&j!=i.getRoot()){if(!x||B){L()}return}if((x&&!B)||(!x&&B)){z=l(z,u)}p=i.getParent(z,i.isBlock);n=p?i.getParent(p.parentNode,i.isBlock):null;t=p?p.nodeName.toUpperCase():"";J=n?n.nodeName.toUpperCase():"";if(J=="LI"&&!A.ctrlKey){p=n;t=J}if(t=="LI"){if(!x&&B){L();return}if(i.isEmpty(p)){if(/^(UL|OL|LI)$/.test(n.parentNode.nodeName)){return false}H();return}}if(t=="PRE"&&d.br_in_pre!==false){if(!B){L();return}}else{if((!x&&!B&&t!="LI")||(x&&B)){L();return}}x=x||"P";if(q()){if(/^(H[1-6]|PRE)$/.test(t)&&J!="HGROUP"){o=r(x)}else{o=r()}if(d.end_container_on_empty_block&&E(n)&&i.isEmpty(p)){o=i.split(n,p)}else{i.insertAfter(o,p)}m(o)}else{if(q(true)){o=p.parentNode.insertBefore(r(),p);F(o)}else{G=v.cloneRange();G.setEndAfter(p);k=G.extractContents();s(k);o=k.firstChild;i.insertAfter(k,p);y(o);I(p);m(o)}}i.setAttrib(o,"id","");h.add()}f.onKeyDown.add(function(k,j){if(j.keyCode==13){if(g(j)!==false){j.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/static/grappelli_old/tinymce/jscripts/tiny_mce/tiny_mce_popup.js b/static/grappelli_old/tinymce/jscripts/tiny_mce/tiny_mce_popup.js new file mode 100644 index 00000000..bb8e58c8 --- /dev/null +++ b/static/grappelli_old/tinymce/jscripts/tiny_mce/tiny_mce_popup.js @@ -0,0 +1,5 @@ + +// Uncomment and change this document.domain value if you are loading the script cross subdomains +// document.domain = 'moxiecode.com'; + +var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(' + + + + + + + + +
            + +
            +

            Section 1

            +
            +

            Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

            +
            +

            Section 2

            +
            +

            Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

            +
            +

            Section 3

            +
            +

            Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

            +
              +
            • List item one
            • +
            • List item two
            • +
            • List item three
            • +
            +
            +

            Section 4

            +
            +

            Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

            Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

            +
            +
            + +
            + + + +
            +

            By default, accordions always keep one section open. To allow for all sections to be be collapsible, set the collapsible option to true. Click on the currently open section to collapse its content pane.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/custom-icons.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/custom-icons.html new file mode 100644 index 00000000..06377ff0 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/custom-icons.html @@ -0,0 +1,69 @@ + + + + + jQuery UI Accordion - Customize icons + + + + + + + + + + + +
            + +
            +

            Section 1

            +
            +

            Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

            +
            +

            Section 2

            +
            +

            Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

            +
            +

            Section 3

            +
            +

            Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

            +
              +
            • List item one
            • +
            • List item two
            • +
            • List item three
            • +
            +
            +

            Section 4

            +
            +

            Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

            Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

            +
            +
            + + + +
            + + + +
            +

            Customize the header icons with the icons option, which accepts classes for the header's default and selected (open) state. Use any class from the UI CSS framework, or create custom classes with background images.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/default.html new file mode 100644 index 00000000..d9ed600c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/default.html @@ -0,0 +1,85 @@ + + + + + jQuery UI Accordion - Default functionality + + + + + + + + + + +
            + +
            +

            Section 1

            +
            +

            + Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer + ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit + amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut + odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate. +

            +
            +

            Section 2

            +
            +

            + Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet + purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor + velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In + suscipit faucibus urna. +

            +
            +

            Section 3

            +
            +

            + Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. + Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero + ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis + lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. +

            +
              +
            • List item one
            • +
            • List item two
            • +
            • List item three
            • +
            +
            +

            Section 4

            +
            +

            + Cras dictum. Pellentesque habitant morbi tristique senectus et netus + et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in + faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia + mauris vel est. +

            +

            + Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. + Class aptent taciti sociosqu ad litora torquent per conubia nostra, per + inceptos himenaeos. +

            +
            +
            + +
            + +
            +

            +Click headers to expand/collapse content that is broken into logical sections, much like tabs. +Optionally, toggle sections open/closed on mouseover. +

            +

            +The underlying HTML markup is a series of headers (H3 tags) and content divs so the content is +usable without JavaScript. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/fillspace.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/fillspace.html new file mode 100644 index 00000000..3621eb97 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/fillspace.html @@ -0,0 +1,76 @@ + + + + + jQuery UI Accordion - Fill space + + + + + + + + + + + + +
            + +

            Resize the outer container:

            + +
            + +
            +

            Section 1

            +
            +

            Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

            +
            +

            Section 2

            +
            +

            Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

            +
            +

            Section 3

            +
            +

            Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

            +
              +
            • List item one
            • +
            • List item two
            • +
            • List item three
            • +
            +
            +

            Section 4

            +
            +

            Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

            Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

            +
            +
            + + +
            + +
            I'm another panel
            + +
            + + + +
            +

            Because the accordion is comprised of block-level elements, by default its width fills the available horizontal space. To fill the vertical space allocated by its container, set the boolean fillSpace option to true, and the script will automatically set the dimensions of the accordion to the height of its parent container. The accordion will also resize with its container if the container is resizable.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/hoverintent.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/hoverintent.html new file mode 100644 index 00000000..5ef9ff85 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/hoverintent.html @@ -0,0 +1,138 @@ + + + + + jQuery UI Accordion - Open on hoverintent + + + + + + + + + + +
            + +
            +

            Section 1

            +
            +

            + Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer + ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit + amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut + odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate. +

            +
            +

            Section 2

            +
            +

            + Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet + purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor + velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In + suscipit faucibus urna. +

            +
            +

            Section 3

            +
            +

            + Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. + Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero + ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis + lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. +

            +
              +
            • List item one
            • +
            • List item two
            • +
            • List item three
            • +
            +
            +

            Section 4

            +
            +

            + Cras dictum. Pellentesque habitant morbi tristique senectus et netus + et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in + faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia + mauris vel est. +

            +

            + Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. + Class aptent taciti sociosqu ad litora torquent per conubia nostra, per + inceptos himenaeos. +

            +
            +
            + +
            + +
            +

            +Click headers to expand/collapse content that is broken into logical sections, much like tabs. +Optionally, toggle sections open/closed on mouseover. +

            +

            +The underlying HTML markup is a series of headers (H3 tags) and content divs so the content is +usable without JavaScript. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/index.html new file mode 100644 index 00000000..d107dd88 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/index.html @@ -0,0 +1,25 @@ + + + + + jQuery UI Accordion Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/mouseover.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/mouseover.html new file mode 100644 index 00000000..39cae565 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/mouseover.html @@ -0,0 +1,57 @@ + + + + + jQuery UI Accordion - Open on mouseover + + + + + + + + + + +
            + +
            +

            Section 1

            +
            +

            Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

            +
            +

            Section 2

            +
            +

            Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

            +
            +

            Section 3

            +
            +

            Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

            +
              +
            • List item one
            • +
            • List item two
            • +
            • List item three
            • +
            +
            +

            Section 4

            +
            +

            Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

            Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

            +
            +
            + +
            + + + +
            +

            Toggle sections open/closed on mouseover with the event option. The default value for event is "click."

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/no-auto-height.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/no-auto-height.html new file mode 100644 index 00000000..d6694846 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/no-auto-height.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Accordion - No auto height + + + + + + + + + + +
            + +
            +

            Section 1

            +
            +

            Mauris mauris ante, blandit et, ultrices a, susceros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

            +
            +

            Section 2

            +
            +

            Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

            +
            +

            Section 3

            +
            +

            Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

            +
              +
            • List item
            • +
            • List item
            • +
            • List item
            • +
            • List item
            • +
            • List item
            • +
            • List item
            • +
            • List item
            • +
            + Link to other content +
            +
            + +
            + + + +
            +

            Setting autoHeight: false allows to accordion panels to keep their native height.

            +

            In addition, the navigation option is enabled, opening the panel based on the current location, eg. no-auto-height.html#panel2 would open the second panel on page load. It also finds anchors within the content, so #othercontent will open the third section, as it contains a link with that href.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/accordion/sortable.html b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/sortable.html new file mode 100644 index 00000000..b9b92551 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/accordion/sortable.html @@ -0,0 +1,81 @@ + + + + + jQuery UI Accordion - Sortable + + + + + + + + + + + + + +
            + +
            +
            +

            Section 1

            +
            +

            Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

            +
            +
            +
            +

            Section 2

            +
            +

            Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

            +
            +
            +
            +

            Section 3

            +
            +

            Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

            +
              +
            • List item one
            • +
            • List item two
            • +
            • List item three
            • +
            +
            +
            +
            +

            Section 4

            +
            +

            Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

            Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

            +
            +
            +
            + +
            + + + +
            +

            Drag the header to re-order panels.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/addClass/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/addClass/default.html new file mode 100644 index 00000000..d6713045 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/addClass/default.html @@ -0,0 +1,52 @@ + + + + + jQuery UI Effects - addClass demo + + + + + + + + + +
            + +
            +
            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. +
            +
            + +Run Effect + +
            + + + +
            +

            This demo adds a class which animates: text-indent, letter-spacing, width, height, padding, margin, and font-size.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/addClass/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/addClass/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/addClass/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/animate/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/animate/default.html new file mode 100644 index 00000000..4fec428e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/animate/default.html @@ -0,0 +1,61 @@ + + + + + jQuery UI Effects - Animate demo + + + + + + + + + +
            + +
            +
            +

            Animate

            +

            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. +

            +
            +
            + +Toggle Effect + +
            + + + +
            +

            Click the button above to preview the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/animate/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/animate/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/animate/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/categories.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/categories.html new file mode 100644 index 00000000..2912daa9 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/categories.html @@ -0,0 +1,71 @@ + + + + + jQuery UI Autocomplete - Categories + + + + + + + + + + + + + +
            + + +
            + + + +
            +

            A categorized search result. Try typing "a" or "n".

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/combobox.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/combobox.html new file mode 100644 index 00000000..3c7876a5 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/combobox.html @@ -0,0 +1,194 @@ + + + + + jQuery UI Autocomplete - Combobox + + + + + + + + + + + + + +
            + +
            + + +
            + + +
            + + + +
            +

            A custom widget built by composition of Autocomplete and Button. You can either type something into the field to get filtered suggestions based on your input, or use the button to get the full list of selections.

            +

            The input is read from an existing select-element for progressive enhancement, passed to Autocomplete with a customized source-option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/custom-data.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/custom-data.html new file mode 100644 index 00000000..e2d0042d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/custom-data.html @@ -0,0 +1,95 @@ + + + + + jQuery UI Autocomplete - Custom data and display + + + + + + + + + + + + +
            +
            Select a project (type "j" for a start):
            + + + +

            +
            + + + +
            +

            You can use your own custom data formats and displays by simply overriding the default focus and select actions.

            +

            Try typing "j" to get a list of projects or just press the down arrow.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/default.html new file mode 100644 index 00000000..dbecdda8 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/default.html @@ -0,0 +1,64 @@ + + + + + jQuery UI Autocomplete - Default functionality + + + + + + + + + + + +
            + +
            + + +
            + +
            + + + +
            +

            The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.

            +

            The datasource is a simple JavaScript array, provided to the widget using the source-option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/folding.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/folding.html new file mode 100644 index 00000000..a580c9df --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/folding.html @@ -0,0 +1,62 @@ + + + + + jQuery UI Autocomplete - Accent folding + + + + + + + + + + + +
            + +
            +
            + + +
            +
            + +
            + + + +
            +

            The autocomplete field uses a custom source option which will match results that have accented characters even when the text field doesn't contain accented characters. However if the you type in accented characters in the text field it is smart enough not to show results that aren't accented.

            +

            Try typing "Jo" to see "John" and "Jörn", then type "Jö" to see only "Jörn".

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/jquery_32x32.png b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/jquery_32x32.png new file mode 100644 index 00000000..9312f02d Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/jquery_32x32.png differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/jqueryui_32x32.png b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/jqueryui_32x32.png new file mode 100644 index 00000000..e003d16c Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/jqueryui_32x32.png differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/sizzlejs_32x32.png b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/sizzlejs_32x32.png new file mode 100644 index 00000000..4ce0704d Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/sizzlejs_32x32.png differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/transparent_1x1.png b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/transparent_1x1.png new file mode 100644 index 00000000..c2da5b88 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/transparent_1x1.png differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/ui-anim_basic_16x16.gif b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/ui-anim_basic_16x16.gif new file mode 100644 index 00000000..084ecb87 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/images/ui-anim_basic_16x16.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/index.html new file mode 100644 index 00000000..77f80199 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/index.html @@ -0,0 +1,27 @@ + + + + + jQuery UI Autocomplete Demos + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/london.xml b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/london.xml new file mode 100644 index 00000000..26285499 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/london.xml @@ -0,0 +1,114 @@ + + +6987 + +London +51.5084152563931 +-0.125532746315002 +2643743 +GB +United Kingdom + +P +PPLC + + +London +42.983389283 +-81.233042387 +6058560 +CA +Canada + +P +PPL + + +East London +-33.0152850934643 +27.9116249084473 +1006984 +ZA +South Africa + +P +PPL + + +City +51.5133363996235 +-0.0890064239501953 +2643744 +GB +United Kingdom + +A +ADM2 + + +London +37.1289771 +-84.0832646 +4298960 +US +United States + +P +PPL + + +The Tower of London +51.5082349601834 +-0.0763034820556641 +6286786 +GB +United Kingdom + +S +CSTL + + +London Reefs +8.85 +112.5333333 +1879967 + + + +U +RFSU + + +Greater London +51.5 +-0.1666667 +2648110 +GB +United Kingdom + +A +ADM2 + + +London +46.1666667 +6.0166667 +2661811 +CH +Switzerland + +H +STM + + +London Borough of Islington +51.5333333 +-0.1333333 +3333156 +GB +United Kingdom + +A +ADM2 + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/maxheight.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/maxheight.html new file mode 100644 index 00000000..1b6b2bd5 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/maxheight.html @@ -0,0 +1,79 @@ + + + + + jQuery UI Autocomplete - Scrollable results + + + + + + + + + + + + +
            + +
            + + +
            + +
            + + + +
            +

            When displaying a long list of options, you can simply set the max-height for the autocomplete menu to prevent the menu from growing too large. Try typing "a" or "s" above to get a long list of results that you can scroll through.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/multiple-remote.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/multiple-remote.html new file mode 100644 index 00000000..4a77fadd --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/multiple-remote.html @@ -0,0 +1,84 @@ + + + + + jQuery UI Autocomplete - Multiple, remote + + + + + + + + + + + + +
            + +
            + + +
            + +
            + + + +
            +

            Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names.

            +

            This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/multiple.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/multiple.html new file mode 100644 index 00000000..ade18ce3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/multiple.html @@ -0,0 +1,99 @@ + + + + + jQuery UI Autocomplete - Multiple values + + + + + + + + + + + +
            + +
            + + +
            + +
            + + + +
            +

            Usage: Type something, eg. "j" to see suggestions for tagging with programming languages. Select a value, then continue typing to add more.

            +

            This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote-jsonp.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote-jsonp.html new file mode 100644 index 00000000..956e0ce9 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote-jsonp.html @@ -0,0 +1,86 @@ + + + + + jQuery UI Autocomplete - Remote JSONP datasource + + + + + + + + + + + + +
            + +
            + + + Powered by geonames.org +
            + +
            + Result: +
            +
            + +
            + + + +
            +

            The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are cities, displayed when at least two characters are entered into the field.

            +

            In this case, the datasource is the geonames.org webservice. While only the city name itself ends up in the input after selecting an element, more info is displayed in the suggestions to help find the right entry. That data is also available in callbacks, as illustrated by the Result area below the input.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote-with-cache.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote-with-cache.html new file mode 100644 index 00000000..054baa60 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote-with-cache.html @@ -0,0 +1,59 @@ + + + + + jQuery UI Autocomplete - Remote with caching + + + + + + + + + + + + +
            + +
            + + +
            + +
            + + + +
            +

            The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.

            +

            Similar to the remote datasource demo, though this adds some local caching to improve performance. The cache here saves just one query, and could be extended to cache multiple values, one for each term.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote.html new file mode 100644 index 00000000..2e8fbff7 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/remote.html @@ -0,0 +1,59 @@ + + + + + jQuery UI Autocomplete - Remote datasource + + + + + + + + + + + + +
            + +
            + + +
            + +
            + Result: +
            +
            + +
            + + + +
            +

            The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.

            +

            The datasource is a server-side script which returns JSON data, specified via a simple URL for the source-option. In addition, the minLength-option is set to 2 to avoid queries that would return too many results and the select-event is used to display some feedback.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/search.php b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/search.php new file mode 100644 index 00000000..8fa9d28f --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/search.php @@ -0,0 +1,640 @@ +"Botaurus stellaris", +"Little Grebe"=>"Tachybaptus ruficollis", +"Black-necked Grebe"=>"Podiceps nigricollis", +"Little Bittern"=>"Ixobrychus minutus", +"Black-crowned Night Heron"=>"Nycticorax nycticorax", +"Purple Heron"=>"Ardea purpurea", +"White Stork"=>"Ciconia ciconia", +"Spoonbill"=>"Platalea leucorodia", +"Red-crested Pochard"=>"Netta rufina", +"Common Eider"=>"Somateria mollissima", +"Red Kite"=>"Milvus milvus", +"Hen Harrier"=>"Circus cyaneus", +"Montagu`s Harrier"=>"Circus pygargus", +"Black Grouse"=>"Tetrao tetrix", +"Grey Partridge"=>"Perdix perdix", +"Spotted Crake"=>"Porzana porzana", +"Corncrake"=>"Crex crex", +"Common Crane"=>"Grus grus", +"Avocet"=>"Recurvirostra avosetta", +"Stone Curlew"=>"Burhinus oedicnemus", +"Common Ringed Plover"=>"Charadrius hiaticula", +"Kentish Plover"=>"Charadrius alexandrinus", +"Ruff"=>"Philomachus pugnax", +"Common Snipe"=>"Gallinago gallinago", +"Black-tailed Godwit"=>"Limosa limosa", +"Common Redshank"=>"Tringa totanus", +"Sandwich Tern"=>"Sterna sandvicensis", +"Common Tern"=>"Sterna hirundo", +"Arctic Tern"=>"Sterna paradisaea", +"Little Tern"=>"Sternula albifrons", +"Black Tern"=>"Chlidonias niger", +"Barn Owl"=>"Tyto alba", +"Little Owl"=>"Athene noctua", +"Short-eared Owl"=>"Asio flammeus", +"European Nightjar"=>"Caprimulgus europaeus", +"Common Kingfisher"=>"Alcedo atthis", +"Eurasian Hoopoe"=>"Upupa epops", +"Eurasian Wryneck"=>"Jynx torquilla", +"European Green Woodpecker"=>"Picus viridis", +"Crested Lark"=>"Galerida cristata", +"White-headed Duck"=>"Oxyura leucocephala", +"Pale-bellied Brent Goose"=>"Branta hrota", +"Tawny Pipit"=>"Anthus campestris", +"Whinchat"=>"Saxicola rubetra", +"European Stonechat"=>"Saxicola rubicola", +"Northern Wheatear"=>"Oenanthe oenanthe", +"Savi`s Warbler"=>"Locustella luscinioides", +"Sedge Warbler"=>"Acrocephalus schoenobaenus", +"Great Reed Warbler"=>"Acrocephalus arundinaceus", +"Bearded Reedling"=>"Panurus biarmicus", +"Red-backed Shrike"=>"Lanius collurio", +"Great Grey Shrike"=>"Lanius excubitor", +"Woodchat Shrike"=>"Lanius senator", +"Common Raven"=>"Corvus corax", +"Yellowhammer"=>"Emberiza citrinella", +"Ortolan Bunting"=>"Emberiza hortulana", +"Corn Bunting"=>"Emberiza calandra", +"Great Cormorant"=>"Phalacrocorax carbo", +"Hawfinch"=>"Coccothraustes coccothraustes", +"Common Shelduck"=>"Tadorna tadorna", +"Bluethroat"=>"Luscinia svecica", +"Grey Heron"=>"Ardea cinerea", +"Barn Swallow"=>"Hirundo rustica", +"Hooded Crow"=>"Corvus cornix", +"Dunlin"=>"Calidris alpina", +"Eurasian Pied Flycatcher"=>"Ficedula hypoleuca", +"Eurasian Nuthatch"=>"Sitta europaea", +"Short-toed Tree Creeper"=>"Certhia brachydactyla", +"Wood Lark"=>"Lullula arborea", +"Tree Pipit"=>"Anthus trivialis", +"Eurasian Hobby"=>"Falco subbuteo", +"Marsh Warbler"=>"Acrocephalus palustris", +"Wood Sandpiper"=>"Tringa glareola", +"Tawny Owl"=>"Strix aluco", +"Lesser Whitethroat"=>"Sylvia curruca", +"Barnacle Goose"=>"Branta leucopsis", +"Common Goldeneye"=>"Bucephala clangula", +"Western Marsh Harrier"=>"Circus aeruginosus", +"Common Buzzard"=>"Buteo buteo", +"Sanderling"=>"Calidris alba", +"Little Gull"=>"Larus minutus", +"Eurasian Magpie"=>"Pica pica", +"Willow Warbler"=>"Phylloscopus trochilus", +"Wood Warbler"=>"Phylloscopus sibilatrix", +"Great Crested Grebe"=>"Podiceps cristatus", +"Eurasian Jay"=>"Garrulus glandarius", +"Common Redstart"=>"Phoenicurus phoenicurus", +"Blue-headed Wagtail"=>"Motacilla flava", +"Common Swift"=>"Apus apus", +"Marsh Tit"=>"Poecile palustris", +"Goldcrest"=>"Regulus regulus", +"European Golden Plover"=>"Pluvialis apricaria", +"Eurasian Bullfinch"=>"Pyrrhula pyrrhula", +"Common Whitethroat"=>"Sylvia communis", +"Meadow Pipit"=>"Anthus pratensis", +"Greylag Goose"=>"Anser anser", +"Spotted Flycatcher"=>"Muscicapa striata", +"European Greenfinch"=>"Carduelis chloris", +"Common Greenshank"=>"Tringa nebularia", +"Great Spotted Woodpecker"=>"Dendrocopos major", +"Greater Canada Goose"=>"Branta canadensis", +"Mistle Thrush"=>"Turdus viscivorus", +"Great Black-backed Gull"=>"Larus marinus", +"Goosander"=>"Mergus merganser", +"Great Egret"=>"Casmerodius albus", +"Northern Goshawk"=>"Accipiter gentilis", +"Dunnock"=>"Prunella modularis", +"Stock Dove"=>"Columba oenas", +"Common Wood Pigeon"=>"Columba palumbus", +"Eurasian Woodcock"=>"Scolopax rusticola", +"House Sparrow"=>"Passer domesticus", +"Common House Martin"=>"Delichon urbicum", +"Red Knot"=>"Calidris canutus", +"Western Jackdaw"=>"Corvus monedula", +"Brambling"=>"Fringilla montifringilla", +"Northern Lapwing"=>"Vanellus vanellus", +"European Reed Warbler"=>"Acrocephalus scirpaceus", +"Lesser Black-backed Gull"=>"Larus fuscus", +"Little Egret"=>"Egretta garzetta", +"Little Stint"=>"Calidris minuta", +"Common Linnet"=>"Carduelis cannabina", +"Mute Swan"=>"Cygnus olor", +"Common Cuckoo"=>"Cuculus canorus", +"Black-headed Gull"=>"Larus ridibundus", +"Greater White-fronted Goose"=>"Anser albifrons", +"Great Tit"=>"Parus major", +"Redwing"=>"Turdus iliacus", +"Gadwall"=>"Anas strepera", +"Fieldfare"=>"Turdus pilaris", +"Tufted Duck"=>"Aythya fuligula", +"Crested Tit"=>"Lophophanes cristatus", +"Willow Tit"=>"Poecile montanus", +"Eurasian Coot"=>"Fulica atra", +"Common Blackbird"=>"Turdus merula", +"Smew"=>"Mergus albellus", +"Common Sandpiper"=>"Actitis hypoleucos", +"Sand Martin"=>"Riparia riparia", +"Purple Sandpiper"=>"Calidris maritima", +"Northern Pintail"=>"Anas acuta", +"Blue Tit"=>"Cyanistes caeruleus", +"European Goldfinch"=>"Carduelis carduelis", +"Eurasian Whimbrel"=>"Numenius phaeopus", +"Common Reed Bunting"=>"Emberiza schoeniclus", +"Eurasian Tree Sparrow"=>"Passer montanus", +"Rook"=>"Corvus frugilegus", +"European Robin"=>"Erithacus rubecula", +"Bar-tailed Godwit"=>"Limosa lapponica", +"Dark-bellied Brent Goose"=>"Branta bernicla", +"Eurasian Oystercatcher"=>"Haematopus ostralegus", +"Eurasian Siskin"=>"Carduelis spinus", +"Northern Shoveler"=>"Anas clypeata", +"Eurasian Wigeon"=>"Anas penelope", +"Eurasian Sparrow Hawk"=>"Accipiter nisus", +"Icterine Warbler"=>"Hippolais icterina", +"Common Starling"=>"Sturnus vulgaris", +"Long-tailed Tit"=>"Aegithalos caudatus", +"Ruddy Turnstone"=>"Arenaria interpres", +"Mew Gull"=>"Larus canus", +"Common Pochard"=>"Aythya ferina", +"Common Chiffchaff"=>"Phylloscopus collybita", +"Greater Scaup"=>"Aythya marila", +"Common Kestrel"=>"Falco tinnunculus", +"Garden Warbler"=>"Sylvia borin", +"Eurasian Collared Dove"=>"Streptopelia decaocto", +"Eurasian Skylark"=>"Alauda arvensis", +"Common Chaffinch"=>"Fringilla coelebs", +"Common Moorhen"=>"Gallinula chloropus", +"Water Pipit"=>"Anthus spinoletta", +"Mallard"=>"Anas platyrhynchos", +"Winter Wren"=>"Troglodytes troglodytes", +"Common Teal"=>"Anas crecca", +"Green Sandpiper"=>"Tringa ochropus", +"White Wagtail"=>"Motacilla alba", +"Eurasian Curlew"=>"Numenius arquata", +"Song Thrush"=>"Turdus philomelos", +"European Herring Gull"=>"Larus argentatus", +"Grey Plover"=>"Pluvialis squatarola", +"Carrion Crow"=>"Corvus corone", +"Coal Tit"=>"Periparus ater", +"Spotted Redshank"=>"Tringa erythropus", +"Blackcap"=>"Sylvia atricapilla", +"Egyptian Vulture"=>"Neophron percnopterus", +"Razorbill"=>"Alca torda", +"Alpine Swift"=>"Apus melba", +"Long-legged Buzzard"=>"Buteo rufinus", +"Audouin`s Gull"=>"Larus audouinii", +"Balearic Shearwater"=>"Puffinus mauretanicus", +"Upland Sandpiper"=>"Bartramia longicauda", +"Greater Spotted Eagle"=>"Aquila clanga", +"Ring Ouzel"=>"Turdus torquatus", +"Yellow-browed Warbler"=>"Phylloscopus inornatus", +"Blue Rock Thrush"=>"Monticola solitarius", +"Buff-breasted Sandpiper"=>"Tryngites subruficollis", +"Jack Snipe"=>"Lymnocryptes minimus", +"White-rumped Sandpiper"=>"Calidris fuscicollis", +"Ruddy Shelduck"=>"Tadorna ferruginea", +"Cetti's Warbler"=>"Cettia cetti", +"Citrine Wagtail"=>"Motacilla citreola", +"Roseate Tern"=>"Sterna dougallii", +"Black-legged Kittiwake"=>"Rissa tridactyla", +"Pygmy Cormorant"=>"Phalacrocorax pygmeus", +"Booted Eagle"=>"Aquila pennata", +"Lesser White-fronted Goose"=>"Anser erythropus", +"Little Bunting"=>"Emberiza pusilla", +"Eleonora's Falcon"=>"Falco eleonorae", +"European Serin"=>"Serinus serinus", +"Twite"=>"Carduelis flavirostris", +"Yellow-legged Gull"=>"Larus michahellis", +"Gyr Falcon"=>"Falco rusticolus", +"Greenish Warbler"=>"Phylloscopus trochiloides", +"Red-necked Phalarope"=>"Phalaropus lobatus", +"Mealy Redpoll"=>"Carduelis flammea", +"Glaucous Gull"=>"Larus hyperboreus", +"Great Skua"=>"Stercorarius skua", +"Great Bustard"=>"Otis tarda", +"Velvet Scoter"=>"Melanitta fusca", +"Pine Grosbeak"=>"Pinicola enucleator", +"House Crow"=>"Corvus splendens", +"Hume`s Leaf Warbler"=>"Phylloscopus humei", +"Great Northern Loon"=>"Gavia immer", +"Long-tailed Duck"=>"Clangula hyemalis", +"Lapland Longspur"=>"Calcarius lapponicus", +"Northern Gannet"=>"Morus bassanus", +"Eastern Imperial Eagle"=>"Aquila heliaca", +"Little Auk"=>"Alle alle", +"Lesser Spotted Woodpecker"=>"Dendrocopos minor", +"Iceland Gull"=>"Larus glaucoides", +"Parasitic Jaeger"=>"Stercorarius parasiticus", +"Bewick`s Swan"=>"Cygnus bewickii", +"Little Bustard"=>"Tetrax tetrax", +"Little Crake"=>"Porzana parva", +"Baillon`s Crake"=>"Porzana pusilla", +"Long-tailed Jaeger"=>"Stercorarius longicaudus", +"King Eider"=>"Somateria spectabilis", +"Greater Short-toed Lark"=>"Calandrella brachydactyla", +"Houbara Bustard"=>"Chlamydotis undulata", +"Curlew Sandpiper"=>"Calidris ferruginea", +"Common Crossbill"=>"Loxia curvirostra", +"European Shag"=>"Phalacrocorax aristotelis", +"Horned Grebe"=>"Podiceps auritus", +"Common Quail"=>"Coturnix coturnix", +"Bearded Vulture"=>"Gypaetus barbatus", +"Lanner Falcon"=>"Falco biarmicus", +"Middle Spotted Woodpecker"=>"Dendrocopos medius", +"Pomarine Jaeger"=>"Stercorarius pomarinus", +"Red-breasted Merganser"=>"Mergus serrator", +"Eurasian Black Vulture"=>"Aegypius monachus", +"Eurasian Dotterel"=>"Charadrius morinellus", +"Common Nightingale"=>"Luscinia megarhynchos", +"Northern willow warbler"=>"Phylloscopus trochilus acredula", +"Manx Shearwater"=>"Puffinus puffinus", +"Northern Fulmar"=>"Fulmarus glacialis", +"Eurasian Eagle Owl"=>"Bubo bubo", +"Orphean Warbler"=>"Sylvia hortensis", +"Melodious Warbler"=>"Hippolais polyglotta", +"Pallas's Leaf Warbler"=>"Phylloscopus proregulus", +"Atlantic Puffin"=>"Fratercula arctica", +"Black-throated Loon"=>"Gavia arctica", +"Bohemian Waxwing"=>"Bombycilla garrulus", +"Marsh Sandpiper"=>"Tringa stagnatilis", +"Great Snipe"=>"Gallinago media", +"Squacco Heron"=>"Ardeola ralloides", +"Long-eared Owl"=>"Asio otus", +"Caspian Tern"=>"Hydroprogne caspia", +"Red-breasted Goose"=>"Branta ruficollis", +"Red-throated Loon"=>"Gavia stellata", +"Common Rosefinch"=>"Carpodacus erythrinus", +"Red-footed Falcon"=>"Falco vespertinus", +"Ross's Goose"=>"Anser rossii", +"Red Phalarope"=>"Phalaropus fulicarius", +"Pied Wagtail"=>"Motacilla yarrellii", +"Rose-coloured Starling"=>"Sturnus roseus", +"Rough-legged Buzzard"=>"Buteo lagopus", +"Saker Falcon"=>"Falco cherrug", +"European Roller"=>"Coracias garrulus", +"Short-toed Eagle"=>"Circaetus gallicus", +"Peregrine Falcon"=>"Falco peregrinus", +"Merlin"=>"Falco columbarius", +"Snow Goose"=>"Anser caerulescens", +"Snowy Owl"=>"Bubo scandiacus", +"Snow Bunting"=>"Plectrophenax nivalis", +"Common Grasshopper Warbler"=>"Locustella naevia", +"Golden Eagle"=>"Aquila chrysaetos", +"Black-winged Stilt"=>"Himantopus himantopus", +"Steppe Eagle"=>"Aquila nipalensis", +"Pallid Harrier"=>"Circus macrourus", +"European Storm-petrel"=>"Hydrobates pelagicus", +"Horned Lark"=>"Eremophila alpestris", +"Eurasian Treecreeper"=>"Certhia familiaris", +"Taiga Bean Goose"=>"Anser fabalis", +"Temminck`s Stint"=>"Calidris temminckii", +"Terek Sandpiper"=>"Xenus cinereus", +"Tundra Bean Goose"=>"Anser serrirostris", +"European Turtle Dove"=>"Streptopelia turtur", +"Leach`s Storm-petrel"=>"Oceanodroma leucorhoa", +"Eurasian Griffon Vulture"=>"Gyps fulvus", +"Paddyfield Warbler"=>"Acrocephalus agricola", +"Osprey"=>"Pandion haliaetus", +"Firecrest"=>"Regulus ignicapilla", +"Water Rail"=>"Rallus aquaticus", +"European Honey Buzzard"=>"Pernis apivorus", +"Eurasian Golden Oriole"=>"Oriolus oriolus", +"Whooper Swan"=>"Cygnus cygnus", +"Two-barred Crossbill"=>"Loxia leucoptera", +"White-tailed Eagle"=>"Haliaeetus albicilla", +"Atlantic Murre"=>"Uria aalge", +"Garganey"=>"Anas querquedula", +"Black Redstart"=>"Phoenicurus ochruros", +"Common Scoter"=>"Melanitta nigra", +"Rock Pipit"=>"Anthus petrosus", +"Lesser Spotted Eagle"=>"Aquila pomarina", +"Cattle Egret"=>"Bubulcus ibis", +"White-winged Black Tern"=>"Chlidonias leucopterus", +"Black Stork"=>"Ciconia nigra", +"Mediterranean Gull"=>"Larus melanocephalus", +"Black Kite"=>"Milvus migrans", +"Yellow Wagtail"=>"Motacilla flavissima", +"Red-necked Grebe"=>"Podiceps grisegena", +"Gull-billed Tern"=>"Gelochelidon nilotica", +"Pectoral Sandpiper"=>"Calidris melanotos", +"Barred Warbler"=>"Sylvia nisoria", +"Red-throated Pipit"=>"Anthus cervinus", +"Grey Wagtail"=>"Motacilla cinerea", +"Richard`s Pipit"=>"Anthus richardi", +"Black Woodpecker"=>"Dryocopus martius", +"Little Ringed Plover"=>"Charadrius dubius", +"Whiskered Tern"=>"Chlidonias hybrida", +"Lesser Redpoll"=>"Carduelis cabaret", +"Pallas' Bunting"=>"Emberiza pallasi", +"Ferruginous Duck"=>"Aythya nyroca", +"Whistling Swan"=>"Cygnus columbianus", +"Black Brant"=>"Branta nigricans", +"Marbled Teal"=>"Marmaronetta angustirostris", +"Canvasback"=>"Aythya valisineria", +"Redhead"=>"Aythya americana", +"Lesser Scaup"=>"Aythya affinis", +"Steller`s Eider"=>"Polysticta stelleri", +"Spectacled Eider"=>"Somateria fischeri", +"Harlequin Duck"=>"Histronicus histrionicus", +"Black Scoter"=>"Melanitta americana", +"Surf Scoter"=>"Melanitta perspicillata", +"Barrow`s Goldeneye"=>"Bucephala islandica", +"Falcated Duck"=>"Anas falcata", +"American Wigeon"=>"Anas americana", +"Blue-winged Teal"=>"Anas discors", +"American Black Duck"=>"Anas rubripes", +"Baikal Teal"=>"Anas formosa", +"Green-Winged Teal"=>"Anas carolinensis", +"Hazel Grouse"=>"Bonasa bonasia", +"Rock Partridge"=>"Alectoris graeca", +"Red-legged Partridge"=>"Alectoris rufa", +"Yellow-billed Loon"=>"Gavia adamsii", +"Cory`s Shearwater"=>"Calonectris borealis", +"Madeiran Storm-Petrel"=>"Oceanodroma castro", +"Great White Pelican"=>"Pelecanus onocrotalus", +"Dalmatian Pelican"=>"Pelecanus crispus", +"American Bittern"=>"Botaurus lentiginosus", +"Glossy Ibis"=>"Plegadis falcinellus", +"Spanish Imperial Eagle"=>"Aquila adalberti", +"Lesser Kestrel"=>"Falco naumanni", +"Houbara Bustard"=>"Chlamydotis undulata", +"Crab-Plover"=>"Dromas ardeola", +"Cream-coloured Courser"=>"Cursorius cursor", +"Collared Pratincole"=>"Glareola pratincola", +"Black-winged Pratincole"=>"Glareola nordmanni", +"Killdeer"=>"Charadrius vociferus", +"Lesser Sand Plover"=>"Charadrius mongolus", +"Greater Sand Plover"=>"Charadrius leschenaultii", +"Caspian Plover"=>"Charadrius asiaticus", +"American Golden Plover"=>"Pluvialis dominica", +"Pacific Golden Plover"=>"Pluvialis fulva", +"Sharp-tailed Sandpiper"=>"Calidris acuminata", +"Broad-billed Sandpiper"=>"Limicola falcinellus", +"Spoon-Billed Sandpiper"=>"Eurynorhynchus pygmaeus", +"Short-Billed Dowitcher"=>"Limnodromus griseus", +"Long-billed Dowitcher"=>"Limnodromus scolopaceus", +"Hudsonian Godwit"=>"Limosa haemastica", +"Little Curlew"=>"Numenius minutus", +"Lesser Yellowlegs"=>"Tringa flavipes", +"Wilson`s Phalarope"=>"Phalaropus tricolor", +"Pallas`s Gull"=>"Larus ichthyaetus", +"Laughing Gull"=>"Larus atricilla", +"Franklin`s Gull"=>"Larus pipixcan", +"Bonaparte`s Gull"=>"Larus philadelphia", +"Ring-billed Gull"=>"Larus delawarensis", +"American Herring Gull"=>"Larus smithsonianus", +"Caspian Gull"=>"Larus cachinnans", +"Ivory Gull"=>"Pagophila eburnea", +"Royal Tern"=>"Sterna maxima", +"Brünnich`s Murre"=>"Uria lomvia", +"Crested Auklet"=>"Aethia cristatella", +"Parakeet Auklet"=>"Cyclorrhynchus psittacula", +"Tufted Puffin"=>"Lunda cirrhata", +"Laughing Dove"=>"Streptopelia senegalensis", +"Great Spotted Cuckoo"=>"Clamator glandarius", +"Great Grey Owl"=>"Strix nebulosa", +"Tengmalm`s Owl"=>"Aegolius funereus", +"Red-Necked Nightjar"=>"Caprimulgus ruficollis", +"Chimney Swift"=>"Chaetura pelagica", +"Green Bea-Eater"=>"Merops orientalis", +"Grey-headed Woodpecker"=>"Picus canus", +"Lesser Short-Toed Lark"=>"Calandrella rufescens", +"Eurasian Crag Martin"=>"Hirundo rupestris", +"Red-rumped Swallow"=>"Cecropis daurica", +"Blyth`s Pipit"=>"Anthus godlewskii", +"Pechora Pipit"=>"Anthus gustavi", +"Grey-headed Wagtail"=>"Motacilla thunbergi", +"Yellow-Headed Wagtail"=>"Motacilla lutea", +"White-throated Dipper"=>"Cinclus cinclus", +"Rufous-Tailed Scrub Robin"=>"Cercotrichas galactotes", +"Thrush Nightingale"=>"Luscinia luscinia", +"White-throated Robin"=>"Irania gutturalis", +"Caspian Stonechat"=>"Saxicola maura variegata", +"Western Black-eared Wheatear"=>"Oenanthe hispanica", +"Rufous-tailed Rock Thrush"=>"Monticola saxatilis", +"Red-throated Thrush/Black-throated"=>"Turdus ruficollis", +"American Robin"=>"Turdus migratorius", +"Zitting Cisticola"=>"Cisticola juncidis", +"Lanceolated Warbler"=>"Locustella lanceolata", +"River Warbler"=>"Locustella fluviatilis", +"Blyth`s Reed Warbler"=>"Acrocephalus dumetorum", +"Caspian Reed Warbler"=>"Acrocephalus fuscus", +"Aquatic Warbler"=>"Acrocephalus paludicola", +"Booted Warbler"=>"Acrocephalus caligatus", +"Marmora's Warbler"=>"Sylvia sarda", +"Dartford Warbler"=>"Sylvia undata", +"Subalpine Warbler"=>"Sylvia cantillans", +"Ménétries's Warbler"=>"Sylvia mystacea", +"Rüppel's Warbler"=>"Sylvia rueppelli", +"Asian Desert Warbler"=>"Sylvia nana", +"Western Orphean Warbler"=>"Sylvia hortensis hortensis", +"Arctic Warbler"=>"Phylloscopus borealis", +"Radde`s Warbler"=>"Phylloscopus schwarzi", +"Western Bonelli`s Warbler"=>"Phylloscopus bonelli", +"Red-breasted Flycatcher"=>"Ficedula parva", +"Eurasian Penduline Tit"=>"Remiz pendulinus", +"Daurian Shrike"=>"Lanius isabellinus", +"Long-Tailed Shrike"=>"Lanius schach", +"Lesser Grey Shrike"=>"Lanius minor", +"Southern Grey Shrike"=>"Lanius meridionalis", +"Masked Shrike"=>"Lanius nubicus", +"Spotted Nutcracker"=>"Nucifraga caryocatactes", +"Daurian Jackdaw"=>"Corvus dauuricus", +"Purple-Backed Starling"=>"Sturnus sturninus", +"Red-Fronted Serin"=>"Serinus pusillus", +"Arctic Redpoll"=>"Carduelis hornemanni", +"Scottish Crossbill"=>"Loxia scotica", +"Parrot Crossbill"=>"Loxia pytyopsittacus", +"Black-faced Bunting"=>"Emberiza spodocephala", +"Pink-footed Goose"=>"Anser brachyrhynchus", +"Black-winged Kite"=>"Elanus caeruleus", +"European Bee-eater"=>"Merops apiaster", +"Sabine`s Gull"=>"Larus sabini", +"Sooty Shearwater"=>"Puffinus griseus", +"Lesser Canada Goose"=>"Branta hutchinsii", +"Ring-necked Duck"=>"Aythya collaris", +"Greater Flamingo"=>"Phoenicopterus roseus", +"Iberian Chiffchaff"=>"Phylloscopus ibericus", +"Ashy-headed Wagtail"=>"Motacilla cinereocapilla", +"Stilt Sandpiper"=>"Calidris himantopus", +"Siberian Stonechat"=>"Saxicola maurus", +"Greater Yellowlegs"=>"Tringa melanoleuca", +"Forster`s Tern"=>"Sterna forsteri", +"Dusky Warbler"=>"Phylloscopus fuscatus", +"Cirl Bunting"=>"Emberiza cirlus", +"Olive-backed Pipit"=>"Anthus hodgsoni", +"Sociable Lapwing"=>"Vanellus gregarius", +"Spotted Sandpiper"=>"Actitis macularius", +"Baird`s Sandpiper"=>"Calidris bairdii", +"Rustic Bunting"=>"Emberiza rustica", +"Yellow-browed Bunting"=>"Emberiza chrysophrys", +"Great Shearwater"=>"Puffinus gravis", +"Bonelli`s Eagle"=>"Aquila fasciata", +"Calandra Lark"=>"Melanocorypha calandra", +"Sardinian Warbler"=>"Sylvia melanocephala", +"Ross's Gull"=>"Larus roseus", +"Yellow-Breasted Bunting"=>"Emberiza aureola", +"Pine Bunting"=>"Emberiza leucocephalos", +"Black Guillemot"=>"Cepphus grylle", +"Pied-billed Grebe"=>"Podilymbus podiceps", +"Soft-plumaged Petrel"=>"Pterodroma mollis", +"Bulwer's Petrel"=>"Bulweria bulwerii", +"White-Faced Storm-Petrel"=>"Pelagodroma marina", +"Pallas’s Fish Eagle"=>"Haliaeetus leucoryphus", +"Sandhill Crane"=>"Grus canadensis", +"Macqueen’s Bustard"=>"Chlamydotis macqueenii", +"White-tailed Lapwing"=>"Vanellus leucurus", +"Great Knot"=>"Calidris tenuirostris", +"Semipalmated Sandpiper"=>"Calidris pusilla", +"Red-necked Stint"=>"Calidris ruficollis", +"Slender-billed Curlew"=>"Numenius tenuirostris", +"Bridled Tern"=>"Onychoprion anaethetus", +"Pallas’s Sandgrouse"=>"Syrrhaptes paradoxus", +"European Scops Owl"=>"Otus scops", +"Northern Hawk Owl"=>"Surnia ulula", +"White-Throated Needletail"=>"Hirundapus caudacutus", +"Belted Kingfisher"=>"Ceryle alcyon", +"Blue-cheeked Bee-eater"=>"Merops persicus", +"Black-headed Wagtail"=>"Motacilla feldegg", +"Northern Mockingbird"=>"Mimus polyglottos", +"Alpine Accentor"=>"Prunella collaris", +"Red-flanked Bluetail"=>"Tarsiger cyanurus", +"Isabelline Wheatear"=>"Oenanthe isabellina", +"Pied Wheatear"=>"Oenanthe pleschanka", +"Eastern Black-eared Wheatear"=>"Oenanthe melanoleuca", +"Desert Wheatear"=>"Oenanthe deserti", +"White`s Thrush"=>"Zoothera aurea", +"Siberian Thrush"=>"Zoothera sibirica", +"Eyebrowed Thrush"=>"Turdus obscurus", +"Dusky Thrush"=>"Turdus eunomus", +"Black-throated Thrush"=>"Turdus atrogularis", +"Pallas`s Grasshopper Warbler"=>"Locustella certhiola", +"Spectacled Warbler"=>"Sylvia conspicillata", +"Two-barred Warbler"=>"Phylloscopus plumbeitarsus", +"Eastern Bonelli’s Warbler"=>"Phylloscopus orientalis", +"Collared Flycatcher"=>"Ficedula albicollis", +"Wallcreeper"=>"Tichodroma muraria", +"Turkestan Shrike"=>"Lanius phoenicuroides", +"Steppe Grey Shrike"=>"Lanius pallidirostris", +"Spanish Sparrow"=>"Passer hispaniolensis", +"Red-eyed Vireo"=>"Vireo olivaceus", +"Myrtle Warbler"=>"Dendroica coronata", +"White-crowned Sparrow"=>"Zonotrichia leucophrys", +"White-throated Sparrow"=>"Zonotrichia albicollis", +"Cretzschmar`s Bunting"=>"Emberiza caesia", +"Chestnut Bunting"=>"Emberiza rutila", +"Red-headed Bunting"=>"Emberiza bruniceps", +"Black-headed Bunting"=>"Emberiza melanocephala", +"Indigo Bunting"=>"Passerina cyanea", +"Balearic Woodchat Shrike"=>"Lanius senator badius", +"Demoiselle Crane"=>"Grus virgo", +"Chough"=>"Pyrrhocorax pyrrhocorax", +"Red-Billed Chough"=>"Pyrrhocorax graculus", +"Elegant Tern"=>"Sterna elegans", +"Chukar"=>"Alectoris chukar", +"Yellow-Billed Cuckoo"=>"Coccyzus americanus", +"American Sandwich Tern"=>"Sterna sandvicensis acuflavida", +"Olive-Tree Warbler"=>"Hippolais olivetorum", +"Eastern Olivaceous Warbler"=>"Acrocephalus pallidus", +"Indian Cormorant"=>"Phalacrocorax fuscicollis", +"Spur-Winged Lapwing"=>"Vanellus spinosus", +"Yelkouan Shearwater"=>"Puffinus yelkouan", +"Trumpeter Finch"=>"Bucanetes githagineus", +"Red Grouse"=>"Lagopus scoticus", +"Rock Ptarmigan"=>"Lagopus mutus", +"Long-Tailed Cormorant"=>"Phalacrocorax africanus", +"Double-crested Cormorant"=>"Phalacrocorax auritus", +"Magnificent Frigatebird"=>"Fregata magnificens", +"Naumann's Thrush"=>"Turdus naumanni", +"Oriental Pratincole"=>"Glareola maldivarum", +"Bufflehead"=>"Bucephala albeola", +"Snowfinch"=>"Montifrigilla nivalis", +"Ural owl"=>"Strix uralensis", +"Spanish Wagtail"=>"Motacilla iberiae", +"Song Sparrow"=>"Melospiza melodia", +"Rock Bunting"=>"Emberiza cia", +"Siberian Rubythroat"=>"Luscinia calliope", +"Pallid Swift"=>"Apus pallidus", +"Eurasian Pygmy Owl"=>"Glaucidium passerinum", +"Madeira Little Shearwater"=>"Puffinus baroli", +"House Finch"=>"Carpodacus mexicanus", +"Green Heron"=>"Butorides virescens", +"Solitary Sandpiper"=>"Tringa solitaria", +"Heuglin's Gull"=>"Larus heuglini" +); + +function array_to_json( $array ){ + + if( !is_array( $array ) ){ + return false; + } + + $associative = count( array_diff( array_keys($array), array_keys( array_keys( $array )) )); + if( $associative ){ + + $construct = array(); + foreach( $array as $key => $value ){ + + // We first copy each key/value pair into a staging array, + // formatting each key and value properly as we go. + + // Format the key: + if( is_numeric($key) ){ + $key = "key_$key"; + } + $key = "\"".addslashes($key)."\""; + + // Format the value: + if( is_array( $value )){ + $value = array_to_json( $value ); + } else if( !is_numeric( $value ) || is_string( $value ) ){ + $value = "\"".addslashes($value)."\""; + } + + // Add to staging array: + $construct[] = "$key: $value"; + } + + // Then we collapse the staging array into the JSON form: + $result = "{ " . implode( ", ", $construct ) . " }"; + + } else { // If the array is a vector (not associative): + + $construct = array(); + foreach( $array as $value ){ + + // Format the value: + if( is_array( $value )){ + $value = array_to_json( $value ); + } else if( !is_numeric( $value ) || is_string( $value ) ){ + $value = "'".addslashes($value)."'"; + } + + // Add to staging array: + $construct[] = $value; + } + + // Then we collapse the staging array into the JSON form: + $result = "[ " . implode( ", ", $construct ) . " ]"; + } + + return $result; +} + +$result = array(); +foreach ($items as $key=>$value) { + if (strpos(strtolower($key), $q) !== false) { + array_push($result, array("id"=>$value, "label"=>$key, "value" => strip_tags($key))); + } + if (count($result) > 11) + break; +} +echo array_to_json($result); + +?> \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/xml.html b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/xml.html new file mode 100644 index 00000000..2397557c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/autocomplete/xml.html @@ -0,0 +1,72 @@ + + + + + jQuery UI Autocomplete - XML data parsed once + + + + + + + + + + + + +
            + +
            + + +
            + +
            + Result: +
            +
            + +
            + + + +
            +

            This demo shows how to retrieve some XML data, parse it using jQuery's methods, then provide it to the autocomplete as the datasource.

            +

            This should also serve as a reference on how to parse a remote XML datasource - the parsing would just happen for each request within the source-callback.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/button/checkbox.html b/static/grappelli_orig/js/ui/development-bundle/demos/button/checkbox.html new file mode 100644 index 00000000..dffc9bf9 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/button/checkbox.html @@ -0,0 +1,44 @@ + + + + + jQuery UI Button - Checkboxes + + + + + + + + + + + +
            + + + +
            + + + +
            + +
            + + + +
            +

            A checkbox is styled as a toggle button with the button widget. The label element associated with the checkbox is used for the button text.

            +

            This demo also demonstrates three checkboxes styled as a button set by calling .buttonset() on a common container.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/button/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/button/default.html new file mode 100644 index 00000000..60d2674c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/button/default.html @@ -0,0 +1,38 @@ + + + + + jQuery UI Button - Default functionality + + + + + + + + + + +
            + + + + + +An anchor + +
            + + + +
            +

            Examples of the markup that can be used for buttons: A button element, an input of type submit and an anchor.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/button/icons.html b/static/grappelli_orig/js/ui/development-bundle/demos/button/icons.html new file mode 100644 index 00000000..b6cd4c59 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/button/icons.html @@ -0,0 +1,56 @@ + + + + + jQuery UI Button - Icons + + + + + + + + + + +
            + + + + + + +
            + + + +
            +

            Some buttons with various combinations of text and icons, here specified via metadata.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/button/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/button/index.html new file mode 100644 index 00000000..23977c82 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/button/index.html @@ -0,0 +1,23 @@ + + + + + jQuery UI Button Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/button/radio.html b/static/grappelli_orig/js/ui/development-bundle/demos/button/radio.html new file mode 100644 index 00000000..2f0dc8fb --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/button/radio.html @@ -0,0 +1,39 @@ + + + + + jQuery UI Button - Radios + + + + + + + + + + +
            + +
            +
            + + + +
            +
            + +
            + + + +
            +

            A set of three radio buttons transformed into a button set.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/button/splitbutton.html b/static/grappelli_orig/js/ui/development-bundle/demos/button/splitbutton.html new file mode 100644 index 00000000..43302300 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/button/splitbutton.html @@ -0,0 +1,55 @@ + + + + + jQuery UI Button - Split button + + + + + + + + + + + +
            + +
            + + +
            + +
            + + + +
            +

            An example of a split button built with two buttons: A plan button with just text, one with only a primary icon and no text. Both are grouped together in a set.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/button/toolbar.html b/static/grappelli_orig/js/ui/development-bundle/demos/button/toolbar.html new file mode 100644 index 00000000..2902b811 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/button/toolbar.html @@ -0,0 +1,120 @@ + + + + + jQuery UI Button - Toolbar + + + + + + + + + + + +
            + + + + + + + + + + + + + + + + + + +
            + + + +
            +

            + A mediaplayer toolbar. Take a look at the underlying markup: A few button elements, + an input of type checkbox for the Shuffle button, and three inputs of type radio for the Repeat options. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/alt-field.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/alt-field.html new file mode 100644 index 00000000..6323cf31 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/alt-field.html @@ -0,0 +1,36 @@ + + + + + jQuery UI Datepicker - Populate alternate field + + + + + + + + + + +
            + +

            Date:  

            + +
            + + + +
            +

            Populate an alternate field with its own date format whenever a date is selected using the altField and altFormat options. This feature could be used to present a human-friendly date for user selection, while passing a more computer-friendly date through for further processing.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/animation.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/animation.html new file mode 100644 index 00000000..f2e6452f --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/animation.html @@ -0,0 +1,58 @@ + + + + + jQuery UI Datepicker - Animations + + + + + + + + + + + + + + + + + +
            + +

            Date:

            + +

            Animations:
            + +

            + +
            + + + +
            +

            Use different animations when opening or closing the datepicker. Choose an animation from the dropdown, then click on the input to see its effect. You can use one of the three standard animations or any of the UI Effects.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/buttonbar.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/buttonbar.html new file mode 100644 index 00000000..20c72926 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/buttonbar.html @@ -0,0 +1,35 @@ + + + + + jQuery UI Datepicker - Display button bar + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            Display a button for selecting Today's date and a Done button for closing the calendar with the boolean showButtonPanel option. Each button is enabled by default when the bar is displayed, but can be turned off with additional options. Button text is customizable.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/date-formats.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/date-formats.html new file mode 100644 index 00000000..35a5e6bb --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/date-formats.html @@ -0,0 +1,47 @@ + + + + + jQuery UI Datepicker - Format date + + + + + + + + + + +
            + +

            Date:

            + +

            Format options:
            + +

            + +
            + + + +
            +

            Display date feedback in a variety of ways. Choose a date format from the dropdown, then click on the input and select a date to see it in that format.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/date-range.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/date-range.html new file mode 100644 index 00000000..09ebba84 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/date-range.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Datepicker - Select a Date Range + + + + + + + + + + +
            + + + + + + +
            + + + +
            +

            Select the date range to search for.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/default.html new file mode 100644 index 00000000..869c4e99 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/default.html @@ -0,0 +1,33 @@ + + + + + jQuery UI Datepicker - Default functionality + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/dropdown-month-year.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/dropdown-month-year.html new file mode 100644 index 00000000..eed1dfea --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/dropdown-month-year.html @@ -0,0 +1,36 @@ + + + + + jQuery UI Datepicker - Display month & year menus + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            Show month and year dropdowns in place of the static month/year header to facilitate navigation through large timeframes. Add the boolean changeMonth and changeYear options.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/icon-trigger.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/icon-trigger.html new file mode 100644 index 00000000..3ec339ff --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/icon-trigger.html @@ -0,0 +1,37 @@ + + + + + jQuery UI Datepicker - Icon trigger + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            Click the icon next to the input field to show the datepicker. Set the datepicker to open on focus (default behavior), on icon click, or both.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/images/calendar.gif b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/images/calendar.gif new file mode 100644 index 00000000..d0abaa7c Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/images/calendar.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/index.html new file mode 100644 index 00000000..ed247740 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/index.html @@ -0,0 +1,31 @@ + + + + + jQuery UI Datepicker Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/inline.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/inline.html new file mode 100644 index 00000000..f3291508 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/inline.html @@ -0,0 +1,33 @@ + + + + + jQuery UI Datepicker - Display inline + + + + + + + + + + +
            + +Date:
            + +
            + + + +
            +

            Display the datepicker embedded in the page instead of in an overlay. Simply call .datepicker() on a div instead of an input.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/localization.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/localization.html new file mode 100644 index 00000000..e7bb42c1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/localization.html @@ -0,0 +1,176 @@ + + + + + jQuery UI Datepicker - Localize calendar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +

            Date:   +

            + +
            + + + +
            +

            Localize the datepicker calendar language and format (English / Western formatting is the default). The datepicker includes built-in support for languages that read right-to-left, such as Arabic and Hebrew.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/min-max.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/min-max.html new file mode 100644 index 00000000..cc1fbda4 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/min-max.html @@ -0,0 +1,33 @@ + + + + + jQuery UI Datepicker - Restrict date range + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            Restrict the range of selectable dates with the minDate and maxDate options. Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)), as a numeric offset from today (-20), or as a string of periods and units ('+1M +10D'). For the last, use 'D' for days, 'W' for weeks, 'M' for months, or 'Y' for years.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/multiple-calendars.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/multiple-calendars.html new file mode 100644 index 00000000..9ebd63c3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/multiple-calendars.html @@ -0,0 +1,36 @@ + + + + + jQuery UI Datepicker - Display multiple months + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            Set the numberOfMonths option to an integer of 2 or more to show multiple months in a single datepicker.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/other-months.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/other-months.html new file mode 100644 index 00000000..e6b03580 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/other-months.html @@ -0,0 +1,37 @@ + + + + + jQuery UI Datepicker - Dates in other months + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            The datepicker can show dates that come from other than the main month + being displayed. These other dates can also be made selectable.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/show-week.html b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/show-week.html new file mode 100644 index 00000000..eee2dd0a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/datepicker/show-week.html @@ -0,0 +1,39 @@ + + + + + jQuery UI Datepicker - Show week of the year + + + + + + + + + + +
            + +

            Date:

            + +
            + + + +
            +

            The datepicker can show the week of the year. The default calculation follows + the ISO 8601 definition: the week starts on Monday, the first week of the year + contains the first Thursday of the year. This means that some days from one + year may be placed into weeks 'belonging' to another year.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/demos.css b/static/grappelli_orig/js/ui/development-bundle/demos/demos.css new file mode 100644 index 00000000..2d2ce1fc --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/demos.css @@ -0,0 +1,334 @@ +body { + font-size: 62.5%; +} + +table { + font-size: 1em; +} + +/* Site + -------------------------------- */ + +body { + font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; +} + +/* Layout + -------------------------------- */ + +.layout-grid { + width: 960px; +} + +.layout-grid td { + vertical-align: top; +} + +.layout-grid td.left-nav { + width: 140px; +} + +.layout-grid td.normal { + border-left: 1px solid #eee; + padding: 20px 24px; + font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; +} + +.layout-grid td.demos { + background: url('/images/demos_bg.jpg') no-repeat; + height: 337px; + overflow: hidden; +} + +/* Normal + -------------------------------- */ + +.normal h3, +.normal h4 { + margin: 0; + font-weight: normal; +} + +.normal h3 { + padding: 0 0 9px; + font-size: 1.8em; +} + +.normal h4 { + padding-bottom: 21px; + border-bottom: 1px dashed #999; + font-size: 1.2em; + font-weight: bold; +} + +.normal p { + font-size: 1.2em; +} + +/* Demos */ + +.demos-nav, .demos-nav dt, .demos-nav dd, .demos-nav ul, .demos-nav li { + margin: 0; + padding: 0 +} + +.demos-nav { + float: left; + width: 170px; + font-size: 1.3em; +} + +.demos-nav dt, +.demos-nav h4 { + margin: 0; + padding: 0; + font: normal 1.1em "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; + color: #e87b10; +} + +.demos-nav dt, +.demos-nav h4 { + margin-top: 1.5em; + margin-bottom: 0; + padding-left: 8px; + padding-bottom:5px; + line-height: 1.2em; + border-bottom: 1px solid #F4F4F4; +} + +.demos-nav dd a, +.demos-nav li a { + border-bottom: 1px solid #F4F4F4; + display:block; + padding: 4px 3px 4px 8px; + font-size: 90%; + text-decoration: none; + color: #555 ; + margin:2px 0; + height:13px; +} + +.demos-nav dd a:hover, +.demos-nav dd a:focus, +.demos-nav dd a:hover, +.demos-nav dd a:focus { + background: #f3f3f3; + color:#000; + -moz-border-radius: 5px; -webkit-border-radius: 5px; +} + .demos-nav dd a.selected { + background: #555; + color:#ffffff; + -moz-border-radius: 5px; -webkit-border-radius: 5px; +} + + +/* new styles for demo pages, added by Filament 12.29.08 +eventually we should convert the font sizes to ems -- using px for now to minimize style conflicts +*/ + +.normal h3.demo-header { font-size:32px; padding:0 0 5px; border-bottom:1px solid #eee; text-transform: capitalize; } +.normal h4.demo-subheader { font-size:10px; text-transform: uppercase; color:#999; padding:8px 0 3px; border:0; margin:0; } +.normal a:link, +.normal a:visited { color:#1b75bb; text-decoration:none; } +.normal a:hover, +.normal a:active { color:#0b559b; } + +#demo-config { padding:20px 0 0; } + +#demo-frame { float:left; width:540px; height:380px; border:1px solid #ddd; overflow: auto; position: relative; } +#demo-frame h3, #demo-frame h4 { padding: 0; font-weight: bold; font-size: 1em; } + +#demo-config-menu { float:right; width:180px; } +#demo-config-menu h4 { font-size:13px; color:#666; font-weight:normal; border:0; padding-left:18px; } + +#demo-config-menu ul { list-style: none; padding: 0; margin: 0; } + +#demo-config-menu li { font-size:12px; padding:0 0 0 10px; margin:3px 0; zoom: 1; } + +#demo-config-menu li a:link, +#demo-config-menu li a:visited { display:block; padding:1px 8px 4px; border-bottom:1px dotted #b3b3b3; } +* html #demo-config-menu li a:link, +* html #demo-config-menu li a:visited { padding:1px 8px 2px; } +#demo-config-menu li a:hover, +#demo-config-menu li a:active { background-color:#f6f6f6; } + +#demo-config-menu li.demo-config-on { background: url(images/demo-config-on-tile.gif) repeat-x left center; } + +#demo-config-menu li.demo-config-on a:link, +#demo-config-menu li.demo-config-on a:visited, +#demo-config-menu li.demo-config-on a:hover, +#demo-config-menu li.demo-config-on a:active { background: url(images/demo-config-on.gif) no-repeat left; padding-left:18px; color:#fff; border:0; margin-left:-10px; margin-top: 0px; margin-bottom: 0px; } + +#demo-source, #demo-notes { + clear: both; + padding: 20px 0 0; + font-size: 1.3em; +} + +#demo-notes { width:520px; color:#333; font-size: 1em; } +#demo-notes p code, .demo-description p code { padding: 0; font-weight: bold; } +#demo-source pre, #demo-source code { padding: 0; } +code, pre { padding:8px 0 8px 20px ; font-size: 1.2em; line-height:130%; } + +#demo-source a:link, +#demo-source a:visited, +#demo-source a:hover, +#demo-source a:active { font-size:12px; padding-left:13px; background-position: left center; background-repeat: no-repeat; } + +#demo-source a.source-open:link, +#demo-source a.source-open:visited, +#demo-source a.source-open:hover, +#demo-source a.source-open:active { background-image: url(images/demo-spindown-open.gif); } + +#demo-source a.source-closed:link, +#demo-source a.source-closed:visited, +#demo-source a.source-closed:hover, +#demo-source a.source-closed:active { background-image: url(images/demo-spindown-closed.gif); } + +div.demo { + padding:12px; + font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; +} + +div.demo h3.docs { clear:left; font-size:12px; font-weight:normal; padding:0 0 1em; margin:0; } + +div.demo-description { + clear:both; + padding:12px; + font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; + font-size: 1.3em; + line-height: 1.4em; +} + +.ui-draggable, .ui-droppable { + background-position: top left; +} + +.left-nav .demos-nav { + padding-right: 10px; +} + +#demo-link { font-size:11px; padding-top: 6px; clear: both; overflow: hidden; } +#demo-link a span.ui-icon { float:left; margin-right:3px; } + +/* Component containers +----------------------------------*/ +#widget-docs .ui-widget { font-family: Trebuchet MS,Verdana,Arial,sans-serif; font-size: 1em; } +#widget-docs .ui-widget input, #widget-docs .ui-widget select, #widget-docs .ui-widget textarea, #widget-docs .ui-widget button { font-family: Trebuchet MS,Verdana,Arial,sans-serif; font-size: 1em; } +#widget-docs .ui-widget-header { border: 1px solid #ffffff; background: #464646 url(images/464646_40x100_textures_01_flat_100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } +#widget-docs .ui-widget-header a { color: #ffffff; } +#widget-docs .ui-widget-content { border: 1px solid #ffffff; background: #ffffff url(images/ffffff_40x100_textures_01_flat_75.png) 50% 50% repeat-x; color: #222222; } +#widget-docs .ui-widget-content a { color: #222222; } + +/* Interaction states +----------------------------------*/ +#widget-docs .ui-state-default, #widget-docs .ui-widget-content #widget-docs .ui-state-default { border: 1px solid #666666; background: #555555 url(images/555555_40x100_textures_03_highlight_soft_75.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } +#widget-docs .ui-state-default a { color: #ffffff; text-decoration: none; outline: none; } +#widget-docs .ui-state-hover, #widget-docs .ui-widget-content #widget-docs .ui-state-hover, #widget-docs .ui-state-focus, #widget-docs .ui-widget-content #widget-docs .ui-state-focus { border: 1px solid #666666; background: #444444 url(images/444444_40x100_textures_03_highlight_soft_60.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } +#widget-docs .ui-state-hover a { color: #ffffff; text-decoration: none; outline: none; } +#widget-docs .ui-state-active, #widget-docs .ui-widget-content #widget-docs .ui-state-active { border: 1px solid #666666; background: #ffffff url(images/ffffff_40x100_textures_01_flat_65.png) 50% 50% repeat-x; font-weight: normal; color: #F6921E; outline: none; } +#widget-docs .ui-state-active a { color: #F6921E; outline: none; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +#widget-docs .ui-state-highlight, #widget-docs .ui-widget-content #widget-docs .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/fbf9ee_40x100_textures_02_glass_55.png) 50% 50% repeat-x; color: #363636; } +#widget-docs .ui-state-error, #widget-docs .ui-widget-content #widget-docs .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/fef1ec_40x100_textures_05_inset_soft_95.png) 50% bottom repeat-x; color: #cd0a0a; } +#widget-docs .ui-state-error-text, #widget-docs .ui-widget-content #widget-docs .ui-state-error-text { color: #cd0a0a; } +#widget-docs .ui-state-disabled, #widget-docs .ui-widget-content #widget-docs .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +#widget-docs .ui-priority-primary, #widget-docs .ui-widget-content #widget-docs .ui-priority-primary { font-weight: bold; } +#widget-docs .ui-priority-secondary, #widget-docs .ui-widget-content #widget-docs .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + +/* Icons +----------------------------------*/ + +/* states and images */ +#demo-frame-wrapper .ui-icon, #widget-docs .ui-icon { width: 16px; height: 16px; background-image: url(images/222222_256x240_icons_icons.png); } +#widget-docs .ui-widget-content .ui-icon {background-image: url(images/222222_256x240_icons_icons.png); } +#widget-docs .ui-widget-header .ui-icon {background-image: url(images/222222_256x240_icons_icons.png); } +#widget-docs .ui-state-default .ui-icon { background-image: url(images/888888_256x240_icons_icons.png); } +#widget-docs .ui-state-hover .ui-icon, #widget-docs .ui-state-focus .ui-icon {background-image: url(images/454545_256x240_icons_icons.png); } +#widget-docs .ui-state-active .ui-icon {background-image: url(images/454545_256x240_icons_icons.png); } +#widget-docs .ui-state-highlight .ui-icon {background-image: url(images/2e83ff_256x240_icons_icons.png); } +#widget-docs .ui-state-error .ui-icon, #widget-docs .ui-state-error-text .ui-icon {background-image: url(images/cd0a0a_256x240_icons_icons.png); } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +#widget-docs .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } +#widget-docs .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +#widget-docs .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +#widget-docs .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +#widget-docs .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +#widget-docs .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +#widget-docs .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +#widget-docs .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +#widget-docs .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } + +/* Overlays */ +#widget-docs .ui-widget-overlay { background: #aaaaaa url(images/aaaaaa_40x100_textures_01_flat_0.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +#widget-docs .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/aaaaaa_40x100_textures_01_flat_0.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; } + +/* +----------------------------------*/ + +#widget-docs { margin:20px 0 0; border: none; } + +#widget-docs h2, #widget-docs h3, #widget-docs h4, #widget-docs p, #widget-docs ul, #widget-docs code { margin:0; padding:0; } +#widget-docs code { display:block; color:#444; font-size:.9em; margin:0 0 1em; } +#widget-docs code strong { color:#000; } +#widget-docs p { margin:0 3em 1.2em 0; } +#widget-docs p.intro { font-size:13px; color:#666; line-height:1.3; } +#widget-docs ul { list-style-type: none; } + +#widget-docs h2 { font-size:16px; margin:1.2em 0 .5em; } +#widget-docs h3 { font-size:14px; color:#e6820E; margin:1.5em 0 .5em; } +.normal #widget-docs h4 { font-size:12px; color:#000; border:0; margin:0 0 .5em; } + +#docs-overview-main { width:400px; } +#docs-overview-sidebar { float:right; width:200px; } +#docs-overview-sidebar a span { color:#666; } +#widget-docs #docs-overview-main p { margin-right:0; } +#widget-docs #docs-overview-sidebar h4 { padding-left:0; } + +.docs-list-header { float:left; width:100%; margin:10px 0 0; border-bottom:1px solid #eee; } +#widget-docs .docs-list-header h2 { float:left; margin:0; } +#widget-docs .docs-list-header p { float:right; margin:5px 0; font-size:11px; } + +.docs-list { float:left; width:100%; padding:0 0 10px; } +.docs-list .param-header { float:left; clear:left; width:100%; padding:8px 0; border-top:1px solid #eee; } +#widget-docs .param-header h3, #widget-docs .param-header p { margin:0; float:left; } +#widget-docs .param-header h3 { width:50%; } +#widget-docs .param-header h3 span { background: url(images/demo-spindown-closed.gif) no-repeat left; padding-left:13px; } +#widget-docs .param-open .param-header h3 span { background: url(images/demo-spindown-open.gif) no-repeat left; } +#widget-docs .param-header p { width:24%; } +#widget-docs .param-header p.param-type span { background: url(images/icon-docs-info.gif) no-repeat left; cursor:pointer; border-bottom:1px dashed #ccc; padding-left:15px; } + +.param-details { padding-left:13px; } +.param-args { margin:0 0 1.5em; border-top:1px dotted #ccc;} +.param-args td { padding:3px 30px 3px 5px; border-bottom:1px dotted #ccc; } + + +/* overrides for ui-tab styles */ +#widget-docs ul.ui-tabs-nav { padding:0 0 0 8px; } +#widget-docs .ui-tabs-nav li { margin:5px 5px 0 0; } + +#widget-docs .ui-tabs-nav li a:link, +#widget-docs .ui-tabs-nav li a:visited, +#widget-docs .ui-tabs-nav li a:hover, +#widget-docs .ui-tabs-nav li a:active { font-size:14px; padding:4px 1.2em 3px; color:#fff; } + +#widget-docs .ui-tabs-nav li.ui-tabs-selected a:link, +#widget-docs .ui-tabs-nav li.ui-tabs-selected a:visited, +#widget-docs .ui-tabs-nav li.ui-tabs-selected a:hover, +#widget-docs .ui-tabs-nav li.ui-tabs-selected a:active { color:#e6820E; } + +#widget-docs .ui-tabs-panel { padding:20px 9px; font-size:12px; line-height:1.4; color:#000; } + +#widget-docs .ui-widget-content a:link, +#widget-docs .ui-widget-content a:visited { color:#1b75bb; text-decoration:none; } +#widget-docs .ui-widget-content a:hover, +#widget-docs .ui-widget-content a:active { color:#0b559b; } + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/dialog/animated.html b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/animated.html new file mode 100644 index 00000000..4124ae40 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/animated.html @@ -0,0 +1,56 @@ + + + + + jQuery UI Dialog - Animation + + + + + + + + + + + + + + + + + + +
            + +
            +

            This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

            +
            + + + +
            + + + +
            +

            Dialogs may be animated by specifying an effect for the show and/or hide properties. You must include the individual effects file for any effects you would like to use.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/dialog/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/default.html new file mode 100644 index 00000000..bd976a16 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/default.html @@ -0,0 +1,54 @@ + + + + + jQuery UI Dialog - Default functionality + + + + + + + + + + + + + + + +
            + +
            +

            This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

            +
            + + +
            +

            Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.

            +
            +
            + checkbox
            + radio
            +

            +
            +
            +
            + +
            + + + +
            +

            The basic dialog window is an overlay positioned within the viewport and is protected from page content (like select elements) shining through with an iframe. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/dialog/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/index.html new file mode 100644 index 00000000..460e4fb3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/index.html @@ -0,0 +1,23 @@ + + + + + jQuery UI Dialog Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-confirmation.html b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-confirmation.html new file mode 100644 index 00000000..f0b70b7d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-confirmation.html @@ -0,0 +1,69 @@ + + + + + jQuery UI Dialog - Modal confirmation + + + + + + + + + + + + + + + +
            + +
            +

            These items will be permanently deleted and cannot be recovered. Are you sure?

            +
            + + +
            +

            Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.

            +
            +
            + checkbox
            + radio
            +

            +
            +
            +
            + +
            + + + +
            +

            Confirm an action that may be destructive or important. Set the modal option to true, and specify primary and secondary user actions with the buttons option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-form.html b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-form.html new file mode 100644 index 00000000..55333522 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-form.html @@ -0,0 +1,167 @@ + + + + + jQuery UI Dialog - Modal form + + + + + + + + + + + + + + + + + + +
            + +
            +

            All form fields are required.

            + +
            +
            + + + + + + +
            +
            +
            + + +
            +

            Existing Users:

            + + + + + + + + + + + + + + + +
            NameEmailPassword
            John Doejohn.doe@example.comjohndoe1
            +
            + + +
            + + + +
            +

            Use a modal dialog to require that the user enter data during a multi-step process. Embed form markup in the content area, set the modal option to true, and specify primary and secondary user actions with the buttons option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-message.html b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-message.html new file mode 100644 index 00000000..17b3e0ec --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal-message.html @@ -0,0 +1,71 @@ + + + + + jQuery UI Dialog - Modal message + + + + + + + + + + + + + + + + +
            + +
            +

            + + Your files have downloaded successfully into the My Downloads folder. +

            +

            + Currently using 36% of your storage space. +

            +
            + + +
            +

            Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.

            +
            +
            + checkbox
            + radio
            +

            +
            +
            +
            + +
            + + + +
            +

            Use a modal dialog to explicitly acknowledge information or an action before continuing their work. Set the modal option to true, and specify a primary action (Ok) with the buttons option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal.html b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal.html new file mode 100644 index 00000000..b352af0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/dialog/modal.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Dialog - Basic modal + + + + + + + + + + + + + + + +
            + +
            +

            Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.

            +
            + + +
            +

            Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.

            +
            +
            + checkbox
            + radio
            +

            +
            +
            +
            + +
            + + + +
            +

            A modal dialog prevents the user from interacting with the rest of the page until it is closed.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/constrain-movement.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/constrain-movement.html new file mode 100644 index 00000000..0f947449 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/constrain-movement.html @@ -0,0 +1,69 @@ + + + + + jQuery UI Draggable - Constrain movement + + + + + + + + + + + + +
            + +

            Constrain movement along an axis:

            + +
            +

            I can be dragged only vertically

            +
            + +
            +

            I can be dragged only horizontally

            +
            + +

            Or to within another DOM element:

            +
            +
            +

            I'm contained within the box

            +
            + +
            +

            I'm contained within the box's parent

            +
            + +
            +

            I'm contained within my parent

            +
            +
            + +
            + + + +
            +

            Constrain the movement of each draggable by defining the boundaries of the draggable area. Set the axis option to limit the draggable's path to the x- or y-axis, or use the containment option to specify a parent DOM element or a jQuery selector, like 'document.'

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/cursor-style.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/cursor-style.html new file mode 100644 index 00000000..71100efb --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/cursor-style.html @@ -0,0 +1,49 @@ + + + + + jQuery UI Draggable - Cursor style + + + + + + + + + + + + +
            + +
            +

            I will always stick to the center (relative to the mouse)

            +
            + +
            +

            My cursor is at left -5 and top -5

            +
            + +
            +

            My cursor position is only controlled for the 'bottom' value

            +
            + +
            + + + +
            +

            Position the cursor while dragging the object. By default the cursor appears in the center of the dragged object; use the cursorAt option to specify another location relative to the draggable (specify a pixel value from the top, right, bottom, and/or left). Customize the cursor's appearance by supplying the cursor option with a valid CSS cursor value: default, move, pointer, crosshair, etc.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/default.html new file mode 100644 index 00000000..8d9be4c3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/default.html @@ -0,0 +1,39 @@ + + + + + jQuery UI Draggable - Default functionality + + + + + + + + + + + + +
            + +
            +

            Drag me around

            +
            + +
            + + + +
            +

            Enable draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/delay-start.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/delay-start.html new file mode 100644 index 00000000..76e91b91 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/delay-start.html @@ -0,0 +1,45 @@ + + + + + jQuery UI Draggable - Delay start + + + + + + + + + + + + +
            + +
            +

            Only if you drag me by 20 pixels, the dragging will start

            +
            + +
            +

            Regardless of the distance, you have to drag and wait for 1000ms before dragging starts

            +
            + +
            + + + +
            +

            Delay the start of dragging for a number of milliseconds with the delay option; prevent dragging until the cursor is held down and dragged a specifed number of pixels with the distance option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/events.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/events.html new file mode 100644 index 00000000..06577ecf --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/events.html @@ -0,0 +1,77 @@ + + + + + jQuery UI Draggable - Events + + + + + + + + + + + + +
            + +
            + +

            Drag me to trigger the chain of events.

            + +
              +
            • "start" invoked 0x
            • +
            • "drag" invoked 0x
            • +
            • "stop" invoked 0x
            • +
            +
            + +
            + + + +
            +

            Layer functionality onto the draggable using the start, drag, and stop events. Start is fired at the start of the drag; drag during the drag; and stop when dragging stops.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/handle.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/handle.html new file mode 100644 index 00000000..6efab53d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/handle.html @@ -0,0 +1,50 @@ + + + + + jQuery UI Draggable - Handles + + + + + + + + + + + + +
            + +
            +

            I can be dragged only by this handle

            +
            + +
            +

            You can drag me around…

            +

            …but you can't drag me by this handle.

            +
            + + + +
            + + + +
            +

            Allow dragging only when the cursor is over a specific part of the draggable. Use the handle option to specify the jQuery selector of an element (or group of elements) used to drag the object.

            +

            Or prevent dragging when the cursor is over a specific element (or group of elements) within the draggable. Use the cancel option to specify a jQuery selector over which to "cancel" draggable functionality.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/index.html new file mode 100644 index 00000000..0beda8e7 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/index.html @@ -0,0 +1,28 @@ + + + + + jQuery UI Draggable Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/revert.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/revert.html new file mode 100644 index 00000000..98843ae8 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/revert.html @@ -0,0 +1,44 @@ + + + + + jQuery UI Draggable - Revert position + + + + + + + + + + + + +
            + +
            +

            Revert the original

            +
            + +
            +

            Revert the helper

            +
            + +
            + + + +
            +

            Return the draggable (or it's helper) to its original location when dragging stops with the boolean revert option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/scroll.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/scroll.html new file mode 100644 index 00000000..8e3c789f --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/scroll.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Draggable - Auto-scroll + + + + + + + + + + + + +
            + +
            +

            Scroll set to true, default settings

            +
            + +
            +

            scrollSensitivity set to 100

            +
            + +
            +

            scrollSpeed set to 100

            +
            + +
            + +
            + + + +
            +

            Automatically scroll the document when the draggable is moved beyond the viewport. Set the scroll option to true to enable auto-scrolling, and fine-tune when scrolling is triggered and its speed with the scrollSensitivity and scrollSpeed options.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/snap-to.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/snap-to.html new file mode 100644 index 00000000..320cb794 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/snap-to.html @@ -0,0 +1,68 @@ + + + + + jQuery UI Draggable - Snap to element or grid + + + + + + + + + + + + +
            + +
            +

            I'm a snap target

            +
            + +
            + +
            +

            Default (snap: true), snaps to all other draggable elements

            +
            + +
            +

            I only snap to the big box

            +
            + +
            +

            I only snap to the outer edges of the big box

            +
            + +
            +

            I snap to a 20 x 20 grid

            +
            + +
            +

            I snap to a 80 x 80 grid

            +
            + +
            + + + +
            +

            Snap the draggable to the inner or outer boundaries of a DOM element. Use the snap, snapMode (inner, outer, both), and snapTolerance (distance in pixels the draggable must be from the element when snapping is invoked) options.

            +

            Or snap the draggable to a grid. Set the dimensions of grid cells (height and width in pixels) with the grid option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/sortable.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/sortable.html new file mode 100644 index 00000000..75b15b96 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/sortable.html @@ -0,0 +1,57 @@ + + + + + jQuery UI Draggable + Sortable + + + + + + + + + + + + + +
            + +
              +
            • Drag me down
            • +
            + +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            + +
            + + + +
            +

            Draggables are built to interact seamlessly with sortables.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/draggable/visual-feedback.html b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/visual-feedback.html new file mode 100644 index 00000000..26b6e108 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/draggable/visual-feedback.html @@ -0,0 +1,77 @@ + + + + + jQuery UI Draggable - Visual feedback + + + + + + + + + + + + +
            + +

            With helpers:

            + +
            +

            Original

            +
            + +
            +

            Semi-transparent clone

            +
            + +
            +

            Custom helper (in combination with cursorAt)

            +
            + +

            Stacked:

            +
            +
            +

            We are draggables..

            +
            + +
            +

            ..whose z-indexes are controlled automatically..

            +
            + +
            +

            ..with the stack option.

            +
            +
            + +
            + + + +
            +

            Provide feedback to users as they drag an object in the form of a helper. The helper option accepts the values 'original' (the draggable object moves with the cursor), 'clone' (a duplicate of the draggable moves with the cursor), or a function that returns a DOM element (that element is shown near the cursor during drag). Control the helper's transparency with the opacity option.

            +

            To clarify which draggable is in play, bring the draggable in motion to front. Use the zIndex option to set a higher z-index for the helper, if in play, or use the stack option to ensure that the last item dragged will appear on top of others in the same group on drag stop.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/accepted-elements.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/accepted-elements.html new file mode 100644 index 00000000..7e845157 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/accepted-elements.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Droppable - Accept + + + + + + + + + + + + + +
            + +
            +

            I'm draggable but can't be dropped

            +
            + +
            +

            Drag me to my target

            +
            + +
            +

            accept: '#draggable'

            +
            + +
            + + + +
            +

            Specify using the accept option which element (or group of elements) is accepted by the target droppable.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/default.html new file mode 100644 index 00000000..61e9c08a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/default.html @@ -0,0 +1,53 @@ + + + + + jQuery UI Droppable - Default functionality + + + + + + + + + + + + + +
            + +
            +

            Drag me to my target

            +
            + +
            +

            Drop here

            +
            + +
            + + + +
            +

            Enable any DOM element to be droppable, a target for draggable elements.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras.jpg new file mode 100644 index 00000000..5723680d Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras2.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras2.jpg new file mode 100644 index 00000000..1acad3af Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras2.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras2_min.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras2_min.jpg new file mode 100644 index 00000000..493e0824 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras2_min.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras3.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras3.jpg new file mode 100644 index 00000000..e158b1ae Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras3.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras3_min.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras3_min.jpg new file mode 100644 index 00000000..4aa96b01 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras3_min.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras4.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras4.jpg new file mode 100644 index 00000000..da4124d8 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras4.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras4_min.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras4_min.jpg new file mode 100644 index 00000000..794dbdf7 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras4_min.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras_min.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras_min.jpg new file mode 100644 index 00000000..51e0cded Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/images/high_tatras_min.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/index.html new file mode 100644 index 00000000..13ae9855 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/index.html @@ -0,0 +1,24 @@ + + + + + jQuery UI Droppable Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/photo-manager.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/photo-manager.html new file mode 100644 index 00000000..d3586e62 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/photo-manager.html @@ -0,0 +1,184 @@ + + + + + jQuery UI Droppable - Simple photo manager + + + + + + + + + + + + + + + + +
            + + + +
            +

            Trash Trash

            +
            + +
            + + +
            +

            You can delete an image either by dragging it to the Trash or by clicking the trash icon.

            +

            You can "recycle" an image by dragging it back to the gallery or by clicking the recycle icon.

            +

            You can view larger image by clicking the zoom icon. jQuery UI dialog widget is used for the modal window.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/propagation.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/propagation.html new file mode 100644 index 00000000..7982e2af --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/propagation.html @@ -0,0 +1,80 @@ + + + + + jQuery UI Droppable - Prevent propagation + + + + + + + + + + + + + +
            + +
            +

            Drag me to my target

            +
            + +
            +

            Outer droppable

            +
            +

            Inner droppable (not greedy)

            +
            +
            + +
            +

            Outer droppable

            +
            +

            Inner droppable (greedy)

            +
            +
            + +
            + + + +
            +

            When working with nested droppables — for example, you may have an editable directory structure displayed as a tree, with folder and document nodes — the greedy option set to true prevents event propagation when a draggable is dropped on a child node (droppable).

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/revert.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/revert.html new file mode 100644 index 00000000..2809ff42 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/revert.html @@ -0,0 +1,61 @@ + + + + + jQuery UI Droppable - Revert draggable position + + + + + + + + + + + + + +
            + +
            +

            I revert when I'm dropped

            +
            + +
            +

            I revert when I'm not dropped

            +
            + +
            +

            Drop me here

            +
            + +
            + + + +
            +

            Return the draggable (or it's helper) to its original location when dragging stops with the boolean revert option set on the draggable.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/shopping-cart.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/shopping-cart.html new file mode 100644 index 00000000..8a08f576 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/shopping-cart.html @@ -0,0 +1,101 @@ + + + + + jQuery UI Droppable - Shopping Cart Demo + + + + + + + + + + + + + + + +
            + +
            +

            Products

            +
            +

            T-Shirts

            +
            +
              +
            • Lolcat Shirt
            • +
            • Cheezeburger Shirt
            • +
            • Buckit Shirt
            • +
            +
            +

            Bags

            +
            +
              +
            • Zebra Striped
            • +
            • Black Leather
            • +
            • Alligator Leather
            • +
            +
            +

            Gadgets

            +
            +
              +
            • iPhone
            • +
            • iPod
            • +
            • iPad
            • +
            +
            +
            +
            + +
            +

            Shopping Cart

            +
            +
              +
            1. Add your items here
            2. +
            +
            +
            + +
            + + + +
            +

            Demonstrate how to use an accordion to structure products into a catalog and make use drag and drop for adding them to a shopping cart, where they are sortable.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/droppable/visual-feedback.html b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/visual-feedback.html new file mode 100644 index 00000000..889f3be0 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/droppable/visual-feedback.html @@ -0,0 +1,78 @@ + + + + + jQuery UI Droppable - Visual feedback + + + + + + + + + + + + + +
            + +

            Feedback on hover:

            + +
            +

            Drag me to my target

            +
            + +
            +

            Drop here

            +
            + +

            Feedback on activating draggable:

            + +
            +

            Drag me to my target

            +
            + +
            +

            Drop here

            +
            + +
            + + + +
            +

            Change the droppable's appearance on hover, or when the droppable is active (an acceptable draggable is dropped on it). Use the hoverClass or activeClass options to specify respective classes.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/effect/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/effect/default.html new file mode 100644 index 00000000..deffa6da --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/effect/default.html @@ -0,0 +1,109 @@ + + + + + jQuery UI Effects - Effect demo + + + + + + + + + + + + + + + + + + + + + + +
            + +
            +
            +

            Effect

            +

            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. +

            +
            +
            + + + +Run Effect + +
            + + + +
            +

            Click the button above to show the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/effect/easing.html b/static/grappelli_orig/js/ui/development-bundle/demos/effect/easing.html new file mode 100644 index 00000000..c97535c0 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/effect/easing.html @@ -0,0 +1,108 @@ + + + + + jQuery UI Effects - Easing demo + + + + + + + + + +
            + +
            + +
            + + + +
            +

            All easings provided by jQuery UI are drawn above, using a HTML canvas element. Click a diagram to see the easing in action.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/effect/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/effect/index.html new file mode 100644 index 00000000..65aa3993 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/effect/index.html @@ -0,0 +1,19 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/hide/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/hide/default.html new file mode 100644 index 00000000..75ec1eb3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/hide/default.html @@ -0,0 +1,102 @@ + + + + + jQuery UI Effects - Hide Demo + + + + + + + + + + + + + + + + + + + + +
            + +
            +
            +

            Hide

            +

            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. +

            +
            +
            + + + +Run Effect + +
            + + + +
            +

            Click the button above to preview the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/hide/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/hide/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/hide/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/images/calendar.gif b/static/grappelli_orig/js/ui/development-bundle/demos/images/calendar.gif new file mode 100644 index 00000000..d0abaa7c Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/images/calendar.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-config-on-tile.gif b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-config-on-tile.gif new file mode 100644 index 00000000..a96b5bf3 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-config-on-tile.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-config-on.gif b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-config-on.gif new file mode 100644 index 00000000..e3b6d7c0 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-config-on.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-spindown-closed.gif b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-spindown-closed.gif new file mode 100644 index 00000000..ad4bd378 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-spindown-closed.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-spindown-open.gif b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-spindown-open.gif new file mode 100644 index 00000000..e1c60aa5 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/images/demo-spindown-open.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/images/icon-docs-info.gif b/static/grappelli_orig/js/ui/development-bundle/demos/images/icon-docs-info.gif new file mode 100644 index 00000000..ea6d2bec Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/images/icon-docs-info.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/images/pbar-ani.gif b/static/grappelli_orig/js/ui/development-bundle/demos/images/pbar-ani.gif new file mode 100644 index 00000000..cb59a04f Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/images/pbar-ani.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/index.html new file mode 100644 index 00000000..0c06d605 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/index.html @@ -0,0 +1,329 @@ + + + + + jQuery UI Demos + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            Interactions
            +
            Draggable
            +
            Droppable
            +
            Resizable
            +
            Selectable
            +
            Sortable
            +
            Widgets
            +
            Accordion
            +
            Autocomplete
            +
            Button
            +
            Datepicker
            +
            Dialog
            +
            Progressbar
            +
            Slider
            +
            Tabs
            +
            Effects
            +
            Color Animation
            +
            Toggle Class
            +
            Add Class
            +
            Remove Class
            +
            Switch Class
            +
            Effect
            +
            Toggle
            +
            Hide
            +
            Show
            +
            Utilities
            +
            Position
            +
            Widget
            +
            About jQuery UI
            +
            Getting Started
            +
            Upgrade Guide
            +
            Changelog
            +
            Roadmap
            +
            Subversion Access
            +
            UI Developer Guidelines
            +
            Theming
            +
            Theming jQuery UI
            +
            jQuery UI CSS Framework
            +
            ThemeRoller application
            +
            Theme Switcher Widget
            + +
            +
            + +
            + +

            Instructions

            +

            + These demos showcase some common uses of each jQuery UI plugin. Simply copy and paste code from the demos to get started. Have fun playing with them. +

            + +
            + +
            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/position/cycler.html b/static/grappelli_orig/js/ui/development-bundle/demos/position/cycler.html new file mode 100644 index 00000000..90dbb9cf --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/position/cycler.html @@ -0,0 +1,122 @@ + + + + + jQuery UI Position - Default functionality + + + + + + + + + + + +
            + + + + + + + + +
            + + + +
            +

            A prototype for the Photoviewer using Position to place images at the center, left and right and cycle them. +
            Use the links at the top to cycle, or click on the images on the left and right. +
            Note how the images are repositioned when resizing the window. +
            Warning: Doesn't currently work inside the demo viewer; open in a new window instead!

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/position/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/position/default.html new file mode 100644 index 00000000..54c9331a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/position/default.html @@ -0,0 +1,140 @@ + + + + + jQuery UI Position - Default functionality + + + + + + + + + + + + + +
            + +
            +

            + This is the position parent element. +

            +
            + +
            +

            + to position +

            +
            + +
            +

            + to position 2 +

            +
            + +
            + position... +
            + my: + + +
            +
            + at: + + +
            +
            + offset: + +
            +
            + collision: + + +
            +
            + +
            + + + +
            +

            Use the form controls to configure the positioning, or drag the positioned element to modify its offset. +
            Drag around the parent element to see collision detection in action.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/position/images/earth.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/position/images/earth.jpg new file mode 100644 index 00000000..e5477f75 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/position/images/earth.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/position/images/flight.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/position/images/flight.jpg new file mode 100644 index 00000000..362bd1a2 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/position/images/flight.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/position/images/rocket.jpg b/static/grappelli_orig/js/ui/development-bundle/demos/position/images/rocket.jpg new file mode 100644 index 00000000..9c0495c6 Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/position/images/rocket.jpg differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/position/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/position/index.html new file mode 100644 index 00000000..498c09b2 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/position/index.html @@ -0,0 +1,19 @@ + + + + + jQuery UI Position Demo + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/animated.html b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/animated.html new file mode 100644 index 00000000..6134a8ca --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/animated.html @@ -0,0 +1,44 @@ + + + + + jQuery UI Progressbar - Animated + + + + + + + + + + + +
            + +
            + +
            + + + +
            +

            +This progressbar has an animated fill by setting the +background-image +on the +.ui-progressbar-value +element, using css. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/default.html new file mode 100644 index 00000000..0f0d692c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/default.html @@ -0,0 +1,35 @@ + + + + + jQuery UI Progressbar - Default functionality + + + + + + + + + + +
            + +
            + +
            + + + +
            +

            Default determinate progress bar.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/images/pbar-ani.gif b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/images/pbar-ani.gif new file mode 100644 index 00000000..cb59a04f Binary files /dev/null and b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/images/pbar-ani.gif differ diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/index.html new file mode 100644 index 00000000..9836f59a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/index.html @@ -0,0 +1,20 @@ + + + + + jQuery UI Progressbar Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/resize.html b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/resize.html new file mode 100644 index 00000000..7452075f --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/progressbar/resize.html @@ -0,0 +1,40 @@ + + + + + jQuery UI Progressbar - Resizable + + + + + + + + + + + + +
            + +
            +
            +
            + +
            + + + +
            +

            The progress bar's widths are specified in percentages for flexible sizing so it will resize to fit its container. Try resizing the height and width of this bar to see how it maintains the correct proportions. (This is not necessarily a real-world example, but it's a good illustration of how flexibly all the plugins are coded.)

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/removeClass/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/removeClass/default.html new file mode 100644 index 00000000..a9f7c047 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/removeClass/default.html @@ -0,0 +1,52 @@ + + + + + jQuery UI Effects - removeClass Demo + + + + + + + + + +
            + +
            +
            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. +
            +
            + +Run Effect + +
            + + + +
            +

            Click the button above to preview the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/removeClass/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/removeClass/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/removeClass/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/animate.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/animate.html new file mode 100644 index 00000000..ebb47a2c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/animate.html @@ -0,0 +1,43 @@ + + + + + jQuery UI Resizable - Animate + + + + + + + + + + + + +
            + +
            +

            Animate

            +
            + +
            + + + +
            +

            Animate the resize action using the animate option (boolean). When this option is set to true, drag the outline to the desired location; the element animates to that size on drag stop.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/aspect-ratio.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/aspect-ratio.html new file mode 100644 index 00000000..959e4f77 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/aspect-ratio.html @@ -0,0 +1,42 @@ + + + + + jQuery UI Resizable - Preserve aspect ratio + + + + + + + + + + + + +
            + +
            +

            Preserve aspect ratio

            +
            + +
            + + + +
            +

            Maintain the existing aspect ratio or set a new one to constrain the proportions on resize. Set the aspectRatio option to true, and optionally pass in a new ratio (i.e., 4/3)

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/constrain-area.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/constrain-area.html new file mode 100644 index 00000000..86d3bd70 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/constrain-area.html @@ -0,0 +1,47 @@ + + + + + jQuery UI Resizable - Constrain resize area + + + + + + + + + + + + +
            + +
            +

            Containment

            +
            +

            Resizable

            +
            +
            + +
            + + + +
            +

            Define the boundaries of the resizable area. Use the containment option to specify a parent DOM element or a jQuery selector, like 'document.'

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/default.html new file mode 100644 index 00000000..6f64dc58 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/default.html @@ -0,0 +1,40 @@ + + + + + jQuery UI Resizable - Default functionality + + + + + + + + + + + + +
            + +
            +

            Resizable

            +
            + +
            + + + +
            +

            Enable any DOM element to be resizable. With the cursor grab the right or bottom border and drag to the desired width or height.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/delay-start.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/delay-start.html new file mode 100644 index 00000000..6ca17f76 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/delay-start.html @@ -0,0 +1,52 @@ + + + + + jQuery UI Resizable - Delay start + + + + + + + + + + + + +
            + +

            Time delay (ms):

            +
            +

            Time

            +
            + +

            Distance delay (px):

            +
            +

            Distance

            +
            + +
            + + + +
            +

            Delay the start of resizng for a number of milliseconds with the delay option; prevent resizing until the cursor is held down and dragged a specifed number of pixels with the distance option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/helper.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/helper.html new file mode 100644 index 00000000..981ee953 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/helper.html @@ -0,0 +1,43 @@ + + + + + jQuery UI Resizable - Helper + + + + + + + + + + + + +
            + +
            +

            Helper

            +
            + +
            + + + +
            +

            Display only an outline of the element while resizing by setting the helper option to a CSS class.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/index.html new file mode 100644 index 00000000..45f40062 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/index.html @@ -0,0 +1,28 @@ + + + + + jQuery UI Resizable Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/max-min.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/max-min.html new file mode 100644 index 00000000..c4e5441b --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/max-min.html @@ -0,0 +1,45 @@ + + + + + jQuery UI Resizable - Maximum / minimum size + + + + + + + + + + + + +
            + +
            +

            Resize larger / smaller

            +
            + +
            + + + +
            +

            Limit the resizable element to a maximum or minimum height or width using the maxHeight, maxWidth, minHeight, and minWidth options.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/snap-to-grid.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/snap-to-grid.html new file mode 100644 index 00000000..d8107274 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/snap-to-grid.html @@ -0,0 +1,42 @@ + + + + + jQuery UI Resizable - Snap to grid + + + + + + + + + + + + +
            + +
            +

            Grid

            +
            + +
            + + + +
            +

            Snap the resizable element to a grid. Set the dimensions of grid cells (height and width in pixels) with the grid option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/synchronous-resize.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/synchronous-resize.html new file mode 100644 index 00000000..7a242120 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/synchronous-resize.html @@ -0,0 +1,49 @@ + + + + + jQuery UI Resizable - Synchronous resize + + + + + + + + + + + + +
            + +
            +

            Resize

            +
            + +
            +

            will also resize

            +
            + +
            + + + +
            +

            Resize multiple elements simultaneously by clicking and dragging the sides of one. Pass a shared selector into the alsoResize option.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/textarea.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/textarea.html new file mode 100644 index 00000000..f7582d45 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/textarea.html @@ -0,0 +1,41 @@ + + + + + jQuery UI Resizable - Textarea + + + + + + + + + + + + +
            + + + +
            + + + +
            +

            Display only an outline of the element while resizing by setting the helper option to a CSS class.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/resizable/visual-feedback.html b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/visual-feedback.html new file mode 100644 index 00000000..06765def --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/resizable/visual-feedback.html @@ -0,0 +1,43 @@ + + + + + jQuery UI Resizable - Visual feedback + + + + + + + + + + + + +
            + +
            +

            Ghost

            +
            + +
            + + + +
            +

            Instead of showing the actual element during resize, set the ghost option to true to show a semi-transparent part of the element.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/selectable/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/default.html new file mode 100644 index 00000000..91cc3d0c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/default.html @@ -0,0 +1,50 @@ + + + + + jQuery UI Selectable - Default functionality + + + + + + + + + + + + + +
            + +
              +
            1. Item 1
            2. +
            3. Item 2
            4. +
            5. Item 3
            6. +
            7. Item 4
            8. +
            9. Item 5
            10. +
            11. Item 6
            12. +
            13. Item 7
            14. +
            + +
            + + + +
            +

            Enable a DOM element (or group of elements) to be selectable. Draw a box with your cursor to select items. Hold down the Ctrl key to make multiple non-adjacent selections.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/selectable/display-grid.html b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/display-grid.html new file mode 100644 index 00000000..dc9d41b4 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/display-grid.html @@ -0,0 +1,55 @@ + + + + + jQuery UI Selectable - Display as grid + + + + + + + + + + + + + +
            + +
              +
            1. 1
            2. +
            3. 2
            4. +
            5. 3
            6. +
            7. 4
            8. +
            9. 5
            10. +
            11. 6
            12. +
            13. 7
            14. +
            15. 8
            16. +
            17. 9
            18. +
            19. 10
            20. +
            21. 11
            22. +
            23. 12
            24. +
            + +
            + + + +
            +

            To arrange selectable items as a grid, give them identical dimensions and float them using CSS.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/selectable/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/index.html new file mode 100644 index 00000000..21fa4d5a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/index.html @@ -0,0 +1,20 @@ + + + + + jQuery UI Selectable Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/selectable/serialize.html b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/serialize.html new file mode 100644 index 00000000..3da4e0f5 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/selectable/serialize.html @@ -0,0 +1,61 @@ + + + + + jQuery UI Selectable - Serialize + + + + + + + + + + + + + +
            + +

            +You've selected: none. +

            + +
              +
            1. Item 1
            2. +
            3. Item 2
            4. +
            5. Item 3
            6. +
            7. Item 4
            8. +
            9. Item 5
            10. +
            11. Item 6
            12. +
            + +
            + + + +
            +

            Write a function that fires on the stop event to collect the index values of selected items. Present values as feedback, or pass as a data string.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/show/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/show/default.html new file mode 100644 index 00000000..091a7116 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/show/default.html @@ -0,0 +1,104 @@ + + + + + jQuery UI Effects - Show Demo + + + + + + + + + + + + + + + + + + + + +
            + +
            +
            +

            Show

            +

            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. +

            +
            +
            + + + +Run Effect + +
            + + + +
            +

            Click the button above to preview the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/show/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/show/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/show/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/colorpicker.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/colorpicker.html new file mode 100644 index 00000000..f551c43b --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/colorpicker.html @@ -0,0 +1,95 @@ + + + + + jQuery UI Slider - Colorpicker + + + + + + + + + + + + +
            + +

            + + Simple Colorpicker +

            + +
            +
            +
            + +
            + +
            + + + +
            +

            Combine three sliders to create a simple RGB colorpicker.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/default.html new file mode 100644 index 00000000..dd39f07c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/default.html @@ -0,0 +1,37 @@ + + + + + jQuery UI Slider - Default functionality + + + + + + + + + + + + +
            + +
            + +
            + + + +
            +

            The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/hotelrooms.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/hotelrooms.html new file mode 100644 index 00000000..a0ea31de --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/hotelrooms.html @@ -0,0 +1,59 @@ + + + + + jQuery UI Slider - Range with fixed minimum + + + + + + + + + + + + +
            + +
            + + +
            + +
            + + + +
            +

            How to bind a slider to an existing select element. The select stays visible to display the change. When the select is changed, the slider is updated, too.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/index.html new file mode 100644 index 00000000..caf68fe9 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/index.html @@ -0,0 +1,29 @@ + + + + + jQuery UI Slider Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/multiple-vertical.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/multiple-vertical.html new file mode 100644 index 00000000..080a40d4 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/multiple-vertical.html @@ -0,0 +1,77 @@ + + + + + jQuery UI Slider - Multiple sliders + + + + + + + + + + + + +
            + +

            + + Master volume +

            + +
            + +

            + + Graphic EQ +

            + +
            + 88 + 77 + 55 + 33 + 40 + 45 + 70 +
            + +
            + + + +
            +

            Combine horizontal and vertical sliders, each with their own options, to create the UI for a music player.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/range-vertical.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/range-vertical.html new file mode 100644 index 00000000..d0abb146 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/range-vertical.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Slider - Vertical range slider + + + + + + + + + + + + +
            + +

            + + +

            + +
            + +
            + + + +
            +

            Change the orientation of the range slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to "vertical."

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/range.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/range.html new file mode 100644 index 00000000..21c5080e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/range.html @@ -0,0 +1,52 @@ + + + + + jQuery UI Slider - Range slider + + + + + + + + + + + + +
            + +

            + + +

            + +
            + +
            + + + +
            +

            Set the range option to true to capture a range of values with two drag handles. The space between the handles is filled with a different background color to indicate those values are selected.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/rangemax.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/rangemax.html new file mode 100644 index 00000000..3f04bcf4 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/rangemax.html @@ -0,0 +1,50 @@ + + + + + jQuery UI Slider - Range with fixed maximum + + + + + + + + + + + + +
            + +

            + + +

            +
            + +
            + + + +
            +

            Fix the maximum value of the range slider so that the user can only select a minimum. Set the range option to "max."

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/rangemin.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/rangemin.html new file mode 100644 index 00000000..125b73df --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/rangemin.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Slider - Range with fixed minimum + + + + + + + + + + + + +
            + +

            + + +

            + +
            + +
            + + + +
            +

            Fix the minimum value of the range slider so that the user can only select a maximum. Set the range option to "min."

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/side-scroll.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/side-scroll.html new file mode 100644 index 00000000..be23f692 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/side-scroll.html @@ -0,0 +1,140 @@ + + + + + jQuery UI Slider - Slider scrollbar + + + + + + + + + + + + +
            + +
            +
            +
            1
            +
            2
            +
            3
            +
            4
            +
            5
            +
            6
            +
            7
            +
            8
            +
            9
            +
            10
            +
            11
            +
            12
            +
            13
            +
            14
            +
            15
            +
            16
            +
            17
            +
            18
            +
            19
            +
            20
            +
            +
            +
            +
            +
            + +
            + + + +
            +

            Use a slider to manipulate the positioning of content on the page. In this case, it acts as a scrollbar with the potential to capture values if needed.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/slider-vertical.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/slider-vertical.html new file mode 100644 index 00000000..0d3f1ee2 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/slider-vertical.html @@ -0,0 +1,52 @@ + + + + + jQuery UI Slider - Vertical slider + + + + + + + + + + + + +
            + +

            + + +

            + +
            + +
            + + + +
            +

            Change the orientation of the slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to "vertical."

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/steps.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/steps.html new file mode 100644 index 00000000..7444df61 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/steps.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Slider - Snap to increments + + + + + + + + + + + + +
            + +

            + + +

            + +
            + +
            + + + +
            +

            Increment slider values with the step option set to an integer, commonly a dividend of the slider's maximum value. The default increment is 1.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/slider/tabs.html b/static/grappelli_orig/js/ui/development-bundle/demos/slider/tabs.html new file mode 100644 index 00000000..fec0a46a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/slider/tabs.html @@ -0,0 +1,67 @@ + + + + + jQuery UI Slider - Snap to increments + + + + + + + + + + + + + +
            + +
            + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            Control tabs with a slider.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/connect-lists-through-tabs.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/connect-lists-through-tabs.html new file mode 100644 index 00000000..ff69d5d9 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/connect-lists-through-tabs.html @@ -0,0 +1,78 @@ + + + + + jQuery UI Sortable - Connect lists with Tabs + + + + + + + + + + + + + +
            + +
            + +
            +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            +
            +
            +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            +
            +
            + +
            + + + +
            +

            Sort items from one list into another and vice versa, by dropping the list item on the appropriate tab above.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/connect-lists.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/connect-lists.html new file mode 100644 index 00000000..275859e0 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/connect-lists.html @@ -0,0 +1,58 @@ + + + + + jQuery UI Sortable - Connect lists + + + + + + + + + + + +
            + +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            + +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            + +
            + + + +
            +

            + Sort items from one list into another and vice versa, by passing a selector into + the connectWith option. The simplest way to do this is to + group all related lists with a CSS class, and then pass that class into the + sortable function (i.e., connectWith: '.myclass'). +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/default.html new file mode 100644 index 00000000..3590de17 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/default.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Sortable - Default functionality + + + + + + + + + + + +
            + +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            • Item 6
            • +
            • Item 7
            • +
            + +
            + + + +
            +

            + Enable a group of DOM elements to be sortable. Click on and drag an + element to a new spot within the list, and the other items will adjust to + fit. By default, sortable items share draggable properties. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/delay-start.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/delay-start.html new file mode 100644 index 00000000..6096e9a5 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/delay-start.html @@ -0,0 +1,67 @@ + + + + + jQuery UI Sortable - Delay start + + + + + + + + + + + +
            + +

            Time delay of 300ms:

            + +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            + +

            Distance delay of 15px:

            + +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            + +
            + + + +
            +

            + Prevent accidental sorting either by delay (time) or distance. Set a number of + milliseconds the element needs to be dragged before sorting starts + with the delay option. Set a distance in pixels the element + needs to be dragged before sorting starts with the distance + option. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/display-grid.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/display-grid.html new file mode 100644 index 00000000..a9287d20 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/display-grid.html @@ -0,0 +1,54 @@ + + + + + jQuery UI Sortable - Display as grid + + + + + + + + + + + +
            + +
              +
            • 1
            • +
            • 2
            • +
            • 3
            • +
            • 4
            • +
            • 5
            • +
            • 6
            • +
            • 7
            • +
            • 8
            • +
            • 9
            • +
            • 10
            • +
            • 11
            • +
            • 12
            • +
            + +
            + + + +
            +

            + To arrange sortable items as a grid, give them identical dimensions and + float them using CSS. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/empty-lists.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/empty-lists.html new file mode 100644 index 00000000..f49b1072 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/empty-lists.html @@ -0,0 +1,69 @@ + + + + + jQuery UI Sortable - Handle empty lists + + + + + + + + + + + +
            + +
              +
            • Can be dropped..
            • +
            • ..on an empty list
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            + +
              +
            • Cannot be dropped..
            • +
            • ..on an empty list
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            + +
              +
            + +
            + +
            + + + +
            +

            + Prevent all items in a list from being dropped into a separate, empty list + using the dropOnEmpty option set to false. By default, + sortable items can be dropped on empty lists. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/index.html new file mode 100644 index 00000000..b307ef77 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/index.html @@ -0,0 +1,26 @@ + + + + + jQuery UI Sortable Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/items.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/items.html new file mode 100644 index 00000000..07a2ca96 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/items.html @@ -0,0 +1,70 @@ + + + + + jQuery UI Sortable - Include / exclude items + + + + + + + + + + + +
            + +

            Specify which items are sortable:

            + +
              +
            • Item 1
            • +
            • (I'm not sortable or a drop target)
            • +
            • (I'm not sortable or a drop target)
            • +
            • Item 4
            • +
            + +

            Cancel sorting (but keep as drop targets):

            + +
              +
            • Item 1
            • +
            • (I'm not sortable)
            • +
            • (I'm not sortable)
            • +
            • Item 4
            • +
            + +
            + + + +
            +

            + Specify which items are eligible to sort by passing a jQuery selector into + the items option. Items excluded from this option are not + sortable, nor are they valid targets for sortable items. +

            +

            + To only prevent sorting on certain items, pass a jQuery selector into the + cancel option. Cancelled items remain valid sort targets for + others. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/placeholder.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/placeholder.html new file mode 100644 index 00000000..4aa07ce1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/placeholder.html @@ -0,0 +1,56 @@ + + + + + jQuery UI Sortable - Drop placeholder + + + + + + + + + + + +
            + +
              +
            • Item 1
            • +
            • Item 2
            • +
            • Item 3
            • +
            • Item 4
            • +
            • Item 5
            • +
            • Item 6
            • +
            • Item 7
            • +
            + +
            + + + +
            +

            + When dragging a sortable item to a new location, other items will make room + for the that item by shifting to allow white space between them. Pass a + class into the placeholder option to style that space to + be visible. Use the boolean forcePlaceholderSize option + to set dimensions on the placeholder. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/sortable/portlets.html b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/portlets.html new file mode 100644 index 00000000..a932dbc1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/sortable/portlets.html @@ -0,0 +1,96 @@ + + + + + jQuery UI Sortable - Portlets + + + + + + + + + + + +
            + +
            + +
            +
            Feeds
            +
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit
            +
            + +
            +
            News
            +
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit
            +
            + +
            + +
            + +
            +
            Shopping
            +
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit
            +
            + +
            + +
            + +
            +
            Links
            +
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit
            +
            + +
            +
            Images
            +
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit
            +
            + +
            + +
            + + + +
            +

            + Enable portlets (styled divs) as sortables and use the connectWith + option to allow sorting between columns. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/switchClass/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/switchClass/default.html new file mode 100644 index 00000000..673a19d3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/switchClass/default.html @@ -0,0 +1,47 @@ + + + + + jQuery UI Effects - switchClass Demo + + + + + + + + + +
            + +
            +
            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. +
            +
            +Run Effect + +
            + + + +
            +

            Click the button above to preview the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/switchClass/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/switchClass/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/switchClass/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax.html new file mode 100644 index 00000000..a4c5e945 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax.html @@ -0,0 +1,53 @@ + + + + + jQuery UI Tabs - Content via Ajax + + + + + + + + + + +
            + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            + +
            + + + +
            +

            Fetch external content via Ajax for the tabs by setting an href value in the tab links. While the Ajax request is waiting for a response, the tab label changes to say "Loading...", then returns to the normal label once loaded.

            +

            Tabs 3 and 4 demonstrate slow-loading and broken AJAX tabs, and how to handle serverside errors in those cases. Note: These two require a webserver to interpret PHP. They won't work from the filesystem.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content1.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content1.html new file mode 100644 index 00000000..472bdfb3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content1.html @@ -0,0 +1,4 @@ +

            This content was loaded via ajax.

            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +

            Mauris vitae ante. Curabitur augue. Nulla purus nibh, lobortis ut, feugiat at, aliquam id, purus. Sed venenatis, lorem venenatis volutpat commodo, purus quam lacinia justo, mattis interdum pede pede a odio. Fusce nibh. Morbi nisl mauris, dapibus in, tristique eget, accumsan et, pede. Donec mauris risus, pulvinar ut, faucibus eu, mollis in, nunc. In augue massa, commodo a, cursus vehicula, varius eu, dui. Suspendisse sodales suscipit lorem. Morbi malesuada, eros quis condimentum dignissim, lectus nibh tristique urna, non bibendum diam massa vel risus. Morbi suscipit. Proin egestas, eros at scelerisque scelerisque, dolor lacus fringilla lacus, ut ullamcorper mi magna at quam. Aliquam sed elit. Aliquam turpis purus, congue quis, iaculis id, ullamcorper sit amet, justo. Maecenas sed mauris. Proin magna justo, interdum in, tincidunt eu, viverra eu, turpis. Suspendisse mollis. In magna. Phasellus pellentesque, urna pellentesque convallis pellentesque, augue sem blandit pede, at rhoncus libero nisl a odio.

            +

            Sed vitae nibh non magna semper tempor. Duis dolor. Nam congue laoreet arcu. Fusce lobortis enim quis ligula. Maecenas commodo odio id mi. Maecenas scelerisque tellus eu odio. Etiam dolor purus, lacinia a, imperdiet in, aliquam et, eros. In pellentesque. Nullam ac massa. Integer et turpis. Ut quam augue, congue non, imperdiet id, eleifend ac, nisi. Etiam ac arcu. Cras iaculis accumsan erat. Nullam vulputate sapien nec nisi pretium rhoncus. Aliquam a nibh. Vivamus est ante, fermentum a, tincidunt ut, imperdiet nec, velit. Aenean non tortor. Sed nec mauris eget tellus condimentum rutrum.

            \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content2.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content2.html new file mode 100644 index 00000000..18b03e40 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content2.html @@ -0,0 +1,4 @@ +

            This other content was loaded via ajax.

            +

            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean nec turpis justo, et facilisis ligula. In congue interdum odio, a scelerisque eros posuere ac. Aenean massa tellus, dictum sit amet laoreet ut, aliquam in orci. Duis eu aliquam ligula. Nullam vel placerat ligula. Fusce venenatis viverra dictum. Phasellus dui dolor, imperdiet in sodales at, mattis sed libero. Morbi ac ipsum ligula. Quisque suscipit dui vel diam pretium nec cursus lacus malesuada. Donec sollicitudin, eros eget dignissim mollis, risus leo feugiat tellus, vel posuere nisl ipsum eu erat. Quisque posuere lacinia imperdiet. Quisque nunc leo, elementum quis ultricies et, vehicula sit amet turpis. Nullam sed nunc nec nibh condimentum mattis. Quisque sed ligula sit amet nisi ultricies bibendum eget id nisi.

            +

            Proin ut erat vel nunc tincidunt commodo. Curabitur feugiat, nisi et vehicula viverra, nisl orci eleifend arcu, sed blandit lectus nisl quis nisi. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Aenean rutrum gravida velit ac imperdiet. Integer vitae arcu risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin tincidunt orci at leo egestas porta. Vivamus ac augue et enim bibendum hendrerit ut id urna. Donec sollicitudin pulvinar turpis vitae scelerisque. Etiam tempor porttitor est sed blandit. Phasellus varius consequat leo eget tincidunt. Aliquam ac dui lectus. In et consectetur orci. Duis posuere nulla ac turpis faucibus vestibulum. Sed ut velit et dolor rhoncus dapibus. Sed sit amet pellentesque est.

            +

            Nam in volutpat orci. Morbi sit amet orci in erat egestas dignissim. Etiam mi sapien, tempus sed iaculis a, adipiscing quis tellus. Suspendisse potenti. Nam malesuada tristique vestibulum. In tempor tellus dignissim neque consectetur eu vestibulum nisl pellentesque. Phasellus ultrices cursus velit, id aliquam nisl fringilla quis. Cras varius elit sed urna ultrices congue. Sed ornare odio sed velit pellentesque id varius nisl sodales. Sed auctor ligula egestas mi pharetra ut consectetur erat pharetra.

            \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content3-slow.php b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content3-slow.php new file mode 100644 index 00000000..7ad43ec0 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content3-slow.php @@ -0,0 +1,7 @@ + +

            This content was loaded via ajax, though it took a second.

            +

            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean nec turpis justo, et facilisis ligula. In congue interdum odio, a scelerisque eros posuere ac. Aenean massa tellus, dictum sit amet laoreet ut, aliquam in orci. Duis eu aliquam ligula. Nullam vel placerat ligula. Fusce venenatis viverra dictum. Phasellus dui dolor, imperdiet in sodales at, mattis sed libero. Morbi ac ipsum ligula. Quisque suscipit dui vel diam pretium nec cursus lacus malesuada. Donec sollicitudin, eros eget dignissim mollis, risus leo feugiat tellus, vel posuere nisl ipsum eu erat. Quisque posuere lacinia imperdiet. Quisque nunc leo, elementum quis ultricies et, vehicula sit amet turpis. Nullam sed nunc nec nibh condimentum mattis. Quisque sed ligula sit amet nisi ultricies bibendum eget id nisi.

            +

            Proin ut erat vel nunc tincidunt commodo. Curabitur feugiat, nisi et vehicula viverra, nisl orci eleifend arcu, sed blandit lectus nisl quis nisi. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Aenean rutrum gravida velit ac imperdiet. Integer vitae arcu risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin tincidunt orci at leo egestas porta. Vivamus ac augue et enim bibendum hendrerit ut id urna. Donec sollicitudin pulvinar turpis vitae scelerisque. Etiam tempor porttitor est sed blandit. Phasellus varius consequat leo eget tincidunt. Aliquam ac dui lectus. In et consectetur orci. Duis posuere nulla ac turpis faucibus vestibulum. Sed ut velit et dolor rhoncus dapibus. Sed sit amet pellentesque est.

            +

            Nam in volutpat orci. Morbi sit amet orci in erat egestas dignissim. Etiam mi sapien, tempus sed iaculis a, adipiscing quis tellus. Suspendisse potenti. Nam malesuada tristique vestibulum. In tempor tellus dignissim neque consectetur eu vestibulum nisl pellentesque. Phasellus ultrices cursus velit, id aliquam nisl fringilla quis. Cras varius elit sed urna ultrices congue. Sed ornare odio sed velit pellentesque id varius nisl sodales. Sed auctor ligula egestas mi pharetra ut consectetur erat pharetra.

            \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content4-broken.php b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content4-broken.php new file mode 100644 index 00000000..55ea2fe9 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/ajax/content4-broken.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/bottom.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/bottom.html new file mode 100644 index 00000000..dffe3a3a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/bottom.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Tabs - Tabs at bottom + + + + + + + + + + + +
            + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            With some additional CSS (for positioning) and JS (to put the right classes on elements) the tabs can be placed below their content.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/collapsible.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/collapsible.html new file mode 100644 index 00000000..ad4769ea --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/collapsible.html @@ -0,0 +1,55 @@ + + + + + jQuery UI Tabs - Collapse content + + + + + + + + + + +
            + +
            + +
            +

            Click this tab again to close the content pane.

            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Click this tab again to close the content pane.

            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Click this tab again to close the content pane.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            Click the selected tab to toggle its content closed/open. To enable this functionality, set the collapsible option to true.

            +
            collapsible: true
            +
            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/cookie.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/cookie.html new file mode 100644 index 00000000..1b71906e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/cookie.html @@ -0,0 +1,57 @@ + + + + + jQuery UI Tabs - Default functionality + + + + + + + + + + + +
            + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            Looks the same as the default demo, but uses cookie to store the selected tab, and restore it when the page (re)loads. +The cookie is stored for a day, so tabs will be restored even after closing the browser. Use cookie: {} for using cookies with default options.

            +

            The cookie option requires the cookie plugin, which can be found in the development-bundle > external folder from the download builder.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/default.html new file mode 100644 index 00000000..1d2f6f2a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/default.html @@ -0,0 +1,49 @@ + + + + + jQuery UI Tabs - Default functionality + + + + + + + + + + +
            + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            Click tabs to swap between content that is broken into logical sections.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/index.html new file mode 100644 index 00000000..c0d66843 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/index.html @@ -0,0 +1,25 @@ + + + + + jQuery UI Tabs Demos + + + + + + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/manipulation.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/manipulation.html new file mode 100644 index 00000000..53b28e15 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/manipulation.html @@ -0,0 +1,124 @@ + + + + + jQuery UI Tabs - Simple manipulation + + + + + + + + + + + + + + +
            + +
            +
            +
            + + + + +
            +
            +
            + + + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            + +
            + + + +
            +

            Simple tabs adding and removing.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/mouseover.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/mouseover.html new file mode 100644 index 00000000..0b8370e6 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/mouseover.html @@ -0,0 +1,53 @@ + + + + + jQuery UI Tabs - Open on mouseover + + + + + + + + + + +
            + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            Toggle sections open/closed on mouseover with the event option. The default value for event is "click."

            +
            event: 'mouseover'
            +
            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/sortable.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/sortable.html new file mode 100644 index 00000000..22f246de --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/sortable.html @@ -0,0 +1,58 @@ + + + + + jQuery UI Tabs - Sortable + + + + + + + + + + + + +
            + +
            + +
            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            Drag the tabs above to re-order them.

            +

            +Making tabs sortable is as simple as calling +.sortable() +on the +.ui-tabs-nav +element. +

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/tabs/vertical.html b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/vertical.html new file mode 100644 index 00000000..6e769d77 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/tabs/vertical.html @@ -0,0 +1,61 @@ + + + + + jQuery UI Tabs - Vertical Tabs functionality + + + + + + + + + + + +
            + +
            + +
            +

            Content heading 1

            +

            Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

            +
            +
            +

            Content heading 2

            +

            Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

            +
            +
            +

            Content heading 3

            +

            Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

            +

            Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

            +
            +
            + +
            + + + +
            +

            Click tabs to swap between content that is broken into logical sections.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/toggle/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/toggle/default.html new file mode 100644 index 00000000..469674b7 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/toggle/default.html @@ -0,0 +1,94 @@ + + + + + jQuery UI Effects - Toggle Demo + + + + + + + + + + + + + + + + + + + + +
            + +
            +
            +

            Toggle

            +

            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. +

            +
            +
            + + + +Run Effect +
            + + + +
            +

            Click the button above to preview the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/toggle/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/toggle/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/toggle/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/toggleClass/default.html b/static/grappelli_orig/js/ui/development-bundle/demos/toggleClass/default.html new file mode 100644 index 00000000..a7c100fc --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/toggleClass/default.html @@ -0,0 +1,46 @@ + + + + + jQuery UI Effects - toggleClass Demo + + + + + + + + + +
            + +
            +
            + Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. +
            +
            + +Run Effect + +
            + + + +
            +

            Click the button above to preview the effect.

            +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/demos/toggleClass/index.html b/static/grappelli_orig/js/ui/development-bundle/demos/toggleClass/index.html new file mode 100644 index 00000000..f5bd6a0e --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/demos/toggleClass/index.html @@ -0,0 +1,18 @@ + + + + + jQuery UI Effects Demos + + + + +
            +

            Examples

            + +
            + + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/accordion.html b/static/grappelli_orig/js/ui/development-bundle/docs/accordion.html new file mode 100644 index 00000000..58aa4677 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/accordion.html @@ -0,0 +1,1017 @@ + + +
            +

            jQuery UI Accordion

            +
            +

            Overview

            +
            +

            Make the selected elements Accordion widgets. Semantic requirements:

            +

            The markup of your accordion container needs pairs of headers and content panels:

            +
            <div id="accordion">
            +    <h3><a href="#">First header</a></h3>
            +    <div>First content</div>
            +    <h3><a href="#">Second header</a></h3>
            +    <div>Second content</div>
            +</div>
            +

            If you use a different element for the header, specify the header-option with an appropriate selector, eg. header: 'a.header'. The content element must be always next to its header.

            +

            If you have links inside the accordion content and use a-elements as headers, add a class to them and use that as the header, eg. header: 'a.header'.

            +

            Use activate(Number) to change the active content programmatically.

            +

            NOTE: If you want multiple sections open at once, don't use an accordion

            +

            An accordion doesn't allow more than one content panel to be open at the same time, and it takes a lot of effort to do that. If you are looking for a widget that allows more than one content panel to be open, don't use this. Usually it can be written with a few lines of jQuery instead, something like this:

            +
            jQuery(document).ready(function(){
            +	$('.accordion .head').click(function() {
            +		$(this).next().toggle();
            +		return false;
            +	}).next().hide();
            +});
            +

            Or animated:

            +
            jQuery(document).ready(function(){
            +	$('.accordion .head').click(function() {
            +		$(this).next().toggle('slow');
            +		return false;
            +	}).next().hide();
            +});
            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            • UI Effects Core (Optional - only for non-default animations)
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Accordion.
            +

            +
            $("#accordion").accordion();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("#accordion").accordion();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="accordion">
            +	<h3><a href="#">Section 1</a></h3>
            +	<div>
            +		<p>
            +		Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
            +		ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
            +		amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
            +		odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
            +		</p>
            +	</div>
            +	<h3><a href="#">Section 2</a></h3>
            +	<div>
            +		<p>
            +		Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
            +		purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
            +		velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
            +		suscipit faucibus urna.
            +		</p>
            +	</div>
            +	<h3><a href="#">Section 3</a></h3>
            +	<div>
            +		<p>
            +		Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
            +		Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
            +		ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
            +		lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
            +		</p>
            +		<ul>
            +			<li>List item one</li>
            +			<li>List item two</li>
            +			<li>List item three</li>
            +		</ul>
            +	</div>
            +	<h3><a href="#">Section 4</a></h3>
            +	<div>
            +		<p>
            +		Cras dictum. Pellentesque habitant morbi tristique senectus et netus
            +		et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
            +		faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
            +		mauris vel est.
            +		</p>
            +		<p>
            +		Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
            +		Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
            +		inceptos himenaeos.
            +		</p>
            +	</div>
            +</div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the accordion. Can be set when initialising (first creating) the accordion.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the disabled option specified. +
              +
              +
              $( ".selector" ).accordion({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).accordion( "option", "disabled" );
              +//setter
              +$( ".selector" ).accordion( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              active

              +
              +
              Type:
              +
              Selector, Element, jQuery, Boolean, Number
              + +
              Default:
              +
              first child
              + +
              +
              +
              +

              Selector for the active element. Set to false to display none at start. Needs collapsible: true.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the active option specified. +
              +
              +
              $( ".selector" ).accordion({ active: 2 });
              +
              + + +
              + Get or set the active option, after init. +
              +
              +
              //getter
              +var active = $( ".selector" ).accordion( "option", "active" );
              +//setter
              +$( ".selector" ).accordion( "option", "active", 2 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              animated

              +
              +
              Type:
              +
              Boolean, String
              + +
              Default:
              +
              "slide"
              + +
              +
              +
              +

              Choose your favorite animation, or disable them (set to false). In addition to the default, 'bounceslide' and all defined easing methods are supported ('bounceslide' requires UI Effects Core).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the animated option specified. +
              +
              +
              $( ".selector" ).accordion({ animated: 'bounceslide' });
              +
              + + +
              + Get or set the animated option, after init. +
              +
              +
              //getter
              +var animated = $( ".selector" ).accordion( "option", "animated" );
              +//setter
              +$( ".selector" ).accordion( "option", "animated", 'bounceslide' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              autoHeight

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If set, the highest content part is used as height reference for all other parts. Provides more consistent animations.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the autoHeight option specified. +
              +
              +
              $( ".selector" ).accordion({ autoHeight: false });
              +
              + + +
              + Get or set the autoHeight option, after init. +
              +
              +
              //getter
              +var autoHeight = $( ".selector" ).accordion( "option", "autoHeight" );
              +//setter
              +$( ".selector" ).accordion( "option", "autoHeight", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              clearStyle

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set, clears height and overflow styles after finishing animations. This enables accordions to work with dynamic content. Won't work together with autoHeight.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the clearStyle option specified. +
              +
              +
              $( ".selector" ).accordion({ clearStyle: true });
              +
              + + +
              + Get or set the clearStyle option, after init. +
              +
              +
              //getter
              +var clearStyle = $( ".selector" ).accordion( "option", "clearStyle" );
              +//setter
              +$( ".selector" ).accordion( "option", "clearStyle", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              collapsible

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Whether all the sections can be closed at once. Allows collapsing the active section by the triggering event (click is the default).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the collapsible option specified. +
              +
              +
              $( ".selector" ).accordion({ collapsible: true });
              +
              + + +
              + Get or set the collapsible option, after init. +
              +
              +
              //getter
              +var collapsible = $( ".selector" ).accordion( "option", "collapsible" );
              +//setter
              +$( ".selector" ).accordion( "option", "collapsible", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              event

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "click"
              + +
              +
              +
              +

              The event on which to trigger the accordion.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the event option specified. +
              +
              +
              $( ".selector" ).accordion({ event: 'mouseover' });
              +
              + + +
              + Get or set the event option, after init. +
              +
              +
              //getter
              +var event = $( ".selector" ).accordion( "option", "event" );
              +//setter
              +$( ".selector" ).accordion( "option", "event", 'mouseover' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              fillSpace

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set, the accordion completely fills the height of the parent element. Overrides autoheight.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the fillSpace option specified. +
              +
              +
              $( ".selector" ).accordion({ fillSpace: true });
              +
              + + +
              + Get or set the fillSpace option, after init. +
              +
              +
              //getter
              +var fillSpace = $( ".selector" ).accordion( "option", "fillSpace" );
              +//setter
              +$( ".selector" ).accordion( "option", "fillSpace", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              header

              +
              +
              Type:
              +
              Selector, jQuery
              + +
              Default:
              +
              "> li > :first-child,> :not(li):even"
              + +
              +
              +
              +

              Selector for the header element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the header option specified. +
              +
              +
              $( ".selector" ).accordion({ header: 'h3' });
              +
              + + +
              + Get or set the header option, after init. +
              +
              +
              //getter
              +var header = $( ".selector" ).accordion( "option", "header" );
              +//setter
              +$( ".selector" ).accordion( "option", "header", 'h3' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              icons

              +
              +
              Type:
              +
              Object
              + +
              Default:
              +
              { "header": "ui-icon-triangle-1-e", "headerSelected": "ui-icon-triangle-1-s" }
              + +
              +
              +
              +

              Icons to use for headers. Icons may be specified for 'header' and 'headerSelected', and we recommend using the icons native to the jQuery UI CSS Framework manipulated by jQuery UI ThemeRoller. Set to false to have no icons displayed.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the icons option specified. +
              +
              +
              $( ".selector" ).accordion({ icons: { "header": "ui-icon-plus", "headerSelected": "ui-icon-minus" } });
              +
              + + +
              + Get or set the icons option, after init. +
              +
              +
              //getter
              +var icons = $( ".selector" ).accordion( "option", "icons" );
              +//setter
              +$( ".selector" ).accordion( "option", "icons", { "header": "ui-icon-plus", "headerSelected": "ui-icon-minus" } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              navigation

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set, looks for the anchor that matches location.href and activates it. Great for href-based state-saving. Use navigationFilter to implement your own matcher.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the navigation option specified. +
              +
              +
              $( ".selector" ).accordion({ navigation: true });
              +
              + + +
              + Get or set the navigation option, after init. +
              +
              +
              //getter
              +var navigation = $( ".selector" ).accordion( "option", "navigation" );
              +//setter
              +$( ".selector" ).accordion( "option", "navigation", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              navigationFilter

              +
              +
              Type:
              +
              Function
              + +
              Default:
              +
              + +
              +
              +
              +

              Overwrite the default location.href-matching with your own matcher.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a accordion with the navigationFilter option specified. +
              +
              +
              $( ".selector" ).accordion({ navigationFilter: function(){ ... } });
              +
              + + +
              + Get or set the navigationFilter option, after init. +
              +
              +
              //getter
              +var navigationFilter = $( ".selector" ).accordion( "option", "navigationFilter" );
              +//setter
              +$( ".selector" ).accordion( "option", "navigationFilter", function(){ ... } );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              accordioncreate
              +
              +
              +
              +

              This event is triggered when accordion is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).accordion({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: accordioncreate. +
              +
              +
              $( ".selector" ).bind( "accordioncreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              change

              +
              +
              Type:
              +
              accordionchange
              +
              +
              +
              +

              This event is triggered every time the accordion changes. If the accordion is animated, the event will be triggered upon completion of the animation; otherwise, it is triggered immediately. +

              +
              $('.ui-accordion').bind('accordionchange', function(event, ui) {
              +  ui.newHeader // jQuery object, activated header
              +  ui.oldHeader // jQuery object, previous header
              +  ui.newContent // jQuery object, activated content
              +  ui.oldContent // jQuery object, previous content
              +});

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the change event as an init option. +
              +
              +
              $( ".selector" ).accordion({
              +   change: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the change event by type: accordionchange. +
              +
              +
              $( ".selector" ).bind( "accordionchange", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +

              +

            • +
              +

              changestart

              +
              +
              Type:
              +
              accordionchangestart
              +
              +
              +
              +

              This event is triggered every time the accordion starts to change. +

              +
              $('.ui-accordion').bind('accordionchangestart', function(event, ui) {
              +  ui.newHeader // jQuery object, activated header
              +  ui.oldHeader // jQuery object, previous header
              +  ui.newContent // jQuery object, activated content
              +  ui.oldContent // jQuery object, previous content
              +});

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the changestart event as an init option. +
              +
              +
              $( ".selector" ).accordion({
              +   changestart: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the changestart event by type: accordionchangestart. +
              +
              +
              $( ".selector" ).bind( "accordionchangestart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .accordion( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the accordion functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + +

              +

            • +
              +

              disable

              +
              +
              Signature:
              +
              .accordion( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the accordion.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .accordion( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the accordion.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .accordion( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any accordion option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .accordion( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple accordion options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .accordion( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-accordion element.

              +
              +
            • + + +
            • +
              +

              activate

              +
              +
              Signature:
              +
              .accordion( "activate" + +, index + + + + + +)
              +
              +
              +
              +

              Activate a content part of the Accordion programmatically. The index can be a zero-indexed number to match the position of the header to close or a Selector matching an element. Pass false to close all (only possible with collapsible:true).

              +
              +
            • + + +
            • +
              +

              resize

              +
              +
              Signature:
              +
              .accordion( "resize" + + + + + + + +)
              +
              +
              +
              +

              Recompute heights of the accordion contents when using the fillSpace option and the container height changed. For example, when the container is a resizable, this method should be called by its resize-event.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Accordion plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.accordion.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-accordion ui-widget ui-helper-reset">
            +  <h3 class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-top">
            +    <span class="ui-icon ui-icon-triangle-1-s"/>
            +    <a href="#">Section 1</a>
            +  </h3>
            +  <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
            +    Section 1 content
            +  </div>
            +  <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">
            +    <span class="ui-icon ui-icon-triangle-1-e"/>
            +    <a href="#">Section 2</a>
            +  </h3>
            +  <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
            +    Section 2 content
            +  </div>
            +  <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">
            +    <span class="ui-icon ui-icon-triangle-1-e"/>
            +    <a href="#">Section 3</a>
            +  </h3>
            +  <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
            +    Section 3 content
            +  </div>
            +</div>
            +

            + + Note: This is a sample of markup generated by the accordion plugin, not markup you should use to create a accordion. The only markup needed for that is
            <div>
            +   <h3><a href="#">Section 1</a></h3>
            +   <div>
            +      Section 1 content
            +   </div>
            +   <h3><a href="#">Section 2</a></h3>
            +   <div>
            +      Section 2 content
            +   </div>
            +   <h3><a href="#">Section 3</a></h3>
            +   <div>
            +      Section 3 content
            +   </div>
            +</div>. +
            +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/addClass.html b/static/grappelli_orig/js/ui/development-bundle/docs/addClass.html new file mode 100644 index 00000000..7af7d663 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/addClass.html @@ -0,0 +1,109 @@ + + +
            +

            jQuery UI addClass

            +
            +

            Overview

            +
            +

            addClass( class, [duration] )

            +

            Adds the specified class to each of the set of matched elements with an optional transition between the states.

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Adds the class 'selected' to the matched elements with a one second transition.
            +

            +
            $("p").click(function () {
            +      $(this).addClass("selected", 1000);
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<style type="text/css">
            +  p { cursor: pointer; font-size: 1.2em; }
            +  .selected { color:red; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $(this).addClass("selected", 1000);
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  <p>Click me to add a 'selected' class.</p>
            +<p>Click me to add a 'selected' class.</p>
            +<p>Click me to add a 'selected' class.</p>
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              class

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              One CSS class to add to the elements.

              +
              +
            • + + +
            • +
              +

              duration

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/animate.html b/static/grappelli_orig/js/ui/development-bundle/docs/animate.html new file mode 100644 index 00000000..b7d376d1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/animate.html @@ -0,0 +1,78 @@ +

            The jQuery UI effects core extends the animate function to be able to animate colors as well. It's heavily used by the class transition feature and it's able to color animate the following properties: +

            +
            • backgroundColor +
            • borderBottomColor +
            • borderLeftColor +
            • borderRightColor +
            • borderTopColor +
            • color +
            • outlineColor +
            +

            with one of the following combinations: +

            +
            • hex (#FF0000) +
            • rgb (rgb(255,255,255)) +
            • names ("black") +
            +


            +

            +
            NameType
            Example: +
            + +
            +A simple color animation.
            +

            +
            $(".block").toggle(function() {
            +    $(this).animate({ backgroundColor: "black" }, 1000);
            +},function() {
            +    $(this).animate({ backgroundColor: "#68BFEF" }, 500);
            +});
            +
            +
            +

            +

            +
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
            +                    "http://www.w3.org/TR/html4/loose.dtd">
            +<html>
            +<head>
            +  <script src="http://code.jquery.com/jquery-latest.js"></script>
            +  
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +
            +  <script>
            +  $(document).ready(function(){
            +    $(".block").toggle(function() {
            +    $(this).animate({ backgroundColor: "black" }, 1000);
            +},function() {
            +    $(this).animate({ backgroundColor: "#68BFEF" }, 500);
            +});
            +
            +  });
            +  </script>
            +  <style>
            +  .block { 
            +    color: white;
            +    background-color: #68BFEF;
            +    width: 150px; 
            +    height: 70px;
            +    margin: 10px; 
            +  }
            +  </style>
            +</head>
            +<body>
            +  <div class="block"> Click me</div>
            +</body>
            +</html>
            +
            +

            +

            +

            NameType
            +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/autocomplete.html b/static/grappelli_orig/js/ui/development-bundle/docs/autocomplete.html new file mode 100644 index 00000000..6247969c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/autocomplete.html @@ -0,0 +1,880 @@ + + +
            +

            jQuery UI Autocomplete

            +
            +

            Overview

            +
            +

            Autocomplete, when added to an input field, enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.

            +

            By giving an Autocomplete field focus or entering something into it, the plugin starts searching for entries that match and displays a list of values to choose from. By entering more characters, the user can filter down the list to better matches.

            +

            This can be used to enter previous selected values, for example you could use Autocomplete for entering tags, to complete an address, you could enter a city name and get the zip code, or maybe enter email addresses from an address book.

            +

            You can pull data in from a local and/or a remote source: Local is good for small data sets (like an address book with 50 entries), remote is necessary for big data sets, like a database with hundreds or millions of entries to select from.

            +

            Autocomplete can be customized to work with various data sources, by just specifying the source option. A data source can be:

            +
              +
            • an Array with local data
            • +
            • a String, specifying a URL
            • +
            • a Callback
            • +
            +

            Expected data format

            +

            The data from local data, a url or a callback can come in two variants:

            +
              +
            • An Array of Strings:
              [ "Choice1", "Choice2" ]
            • +
            • An Array of Objects with label and value properties:
              [ { label: "Choice1", value: "value1" }, ... ]
            • +
            +

            The label property is displayed in the suggestion menu. The value will be inserted into the input element after the user selected something from the menu. If just one property is specified, it will be used for both, eg. if you provide only value-properties, the value will also be used as the label.

            +

            When a String is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data. It can be on the same host or on a different one (must provide JSONP). The Autocomplete plugin does not filter the results, instead the request parameter "term" gets added to the URL, which the server-side script should use for filtering the results. The data itself can be in the same format as the local data described above.

            +

            The third variation, the callback, provides the most flexibility, and can be used to connect any data source to Autocomplete. The callback gets two arguments:

            +
              +
            • A request object, with a single property called "term", which refers to the value currently in the text input. For example, when the user entered "new yo" in a city field, the Autocomplete term will equal "new yo".
            • +
            • A response callback, which expects a single argument to contain the data to suggest to the user. This data should be filtered based on the provided term, and can be in any of the formats described above for simple local data (String-Array or Object-Array with label/value/both properties). It's important when providing a custom source callback to handle errors during the request. You must always call the response callback even if you encounter an error. This ensures that the widget always has the correct state.
            • +
            +

            The label is always treated as text, if you want the label to be treated as html you can use Scott González' html extension. The demos all focus on different variations of the source-option - look for the one that matches your use case, and take a look at the code.

            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            • UI Position
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Autocomplete.
            +

            +
            $("input#autocomplete").autocomplete({
            +    source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]
            +});
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("input#autocomplete").autocomplete({
            +    source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]
            +});
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<input id="autocomplete" />
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the autocomplete. Can be set when initialising (first creating) the autocomplete.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a autocomplete with the disabled option specified. +
              +
              +
              $( ".selector" ).autocomplete({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).autocomplete( "option", "disabled" );
              +//setter
              +$( ".selector" ).autocomplete( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              appendTo

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              "body"
              + +
              +
              +
              +

              Which element the menu should be appended to.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a autocomplete with the appendTo option specified. +
              +
              +
              $( ".selector" ).autocomplete({ appendTo: "#someElem" });
              +
              + + +
              + Get or set the appendTo option, after init. +
              +
              +
              //getter
              +var appendTo = $( ".selector" ).autocomplete( "option", "appendTo" );
              +//setter
              +$( ".selector" ).autocomplete( "option", "appendTo", "#someElem" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              autoFocus

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true the first item will be automatically focused.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a autocomplete with the autoFocus option specified. +
              +
              +
              $( ".selector" ).autocomplete({ autoFocus: true });
              +
              + + +
              + Get or set the autoFocus option, after init. +
              +
              +
              //getter
              +var autoFocus = $( ".selector" ).autocomplete( "option", "autoFocus" );
              +//setter
              +$( ".selector" ).autocomplete( "option", "autoFocus", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              delay

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              300
              + +
              +
              +
              +

              The delay in milliseconds the Autocomplete waits after a keystroke to activate itself. A zero-delay makes sense for local data (more responsive), but can produce a lot of load for remote data, while being less responsive.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a autocomplete with the delay option specified. +
              +
              +
              $( ".selector" ).autocomplete({ delay: 0 });
              +
              + + +
              + Get or set the delay option, after init. +
              +
              +
              //getter
              +var delay = $( ".selector" ).autocomplete( "option", "delay" );
              +//setter
              +$( ".selector" ).autocomplete( "option", "delay", 0 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              minLength

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              1
              + +
              +
              +
              +

              The minimum number of characters a user has to type before the Autocomplete activates. Zero is useful for local data with just a few items. Should be increased when there are a lot of items, where a single character would match a few thousand items.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a autocomplete with the minLength option specified. +
              +
              +
              $( ".selector" ).autocomplete({ minLength: 0 });
              +
              + + +
              + Get or set the minLength option, after init. +
              +
              +
              //getter
              +var minLength = $( ".selector" ).autocomplete( "option", "minLength" );
              +//setter
              +$( ".selector" ).autocomplete( "option", "minLength", 0 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              position

              +
              +
              Type:
              +
              Object
              + +
              Default:
              +
              { my: "left top", at: "left bottom", collision: "none" }
              + +
              +
              +
              +

              Identifies the position of the Autocomplete widget in relation to the associated input element. The "of" option defaults to the input element, but you can specify another element to position against. You can refer to the jQuery UI Position utility for more details about the various options.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a autocomplete with the position option specified. +
              +
              +
              $( ".selector" ).autocomplete({ position: { my : "right top", at: "right bottom" } });
              +
              + + +
              + Get or set the position option, after init. +
              +
              +
              //getter
              +var position = $( ".selector" ).autocomplete( "option", "position" );
              +//setter
              +$( ".selector" ).autocomplete( "option", "position", { my : "right top", at: "right bottom" } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              source

              +
              +
              Type:
              +
              String, Array, Callback
              + +
              Default:
              +
              none, must be specified
              + +
              +
              +
              +

              Defines the data to use, must be specified. See Overview section for more details, and look at the various demos.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a autocomplete with the source option specified. +
              +
              +
              $( ".selector" ).autocomplete({ source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"] });
              +
              + + +
              + Get or set the source option, after init. +
              +
              +
              //getter
              +var source = $( ".selector" ).autocomplete( "option", "source" );
              +//setter
              +$( ".selector" ).autocomplete( "option", "source", ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"] );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              autocompletecreate
              +
              +
              +
              +

              This event is triggered when autocomplete is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).autocomplete({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: autocompletecreate. +
              +
              +
              $( ".selector" ).bind( "autocompletecreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + + + + +
            • +
              +

              open

              +
              +
              Type:
              +
              autocompleteopen
              +
              +
              +
              +

              Triggered when the suggestion menu is opened.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the open event as an init option. +
              +
              +
              $( ".selector" ).autocomplete({
              +   open: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the open event by type: autocompleteopen. +
              +
              +
              $( ".selector" ).bind( "autocompleteopen", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              focus

              +
              +
              Type:
              +
              autocompletefocus
              +
              +
              +
              +

              Before focus is moved to an item (not selecting), ui.item refers to the focused item. The default action of focus is to replace the text field's value with the value of the focused item, though only if the focus event was triggered by a keyboard interaction. Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the focus event as an init option. +
              +
              +
              $( ".selector" ).autocomplete({
              +   focus: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the focus event by type: autocompletefocus. +
              +
              +
              $( ".selector" ).bind( "autocompletefocus", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              select

              +
              +
              Type:
              +
              autocompleteselect
              +
              +
              +
              +

              Triggered when an item is selected from the menu; ui.item refers to the selected item. The default action of select is to replace the text field's value with the value of the selected item. Canceling this event prevents the value from being updated, but does not prevent the menu from closing.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the select event as an init option. +
              +
              +
              $( ".selector" ).autocomplete({
              +   select: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the select event by type: autocompleteselect. +
              +
              +
              $( ".selector" ).bind( "autocompleteselect", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              close

              +
              +
              Type:
              +
              autocompleteclose
              +
              +
              +
              +

              When the list is hidden - doesn't have to occur together with a change.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the close event as an init option. +
              +
              +
              $( ".selector" ).autocomplete({
              +   close: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the close event by type: autocompleteclose. +
              +
              +
              $( ".selector" ).bind( "autocompleteclose", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              change

              +
              +
              Type:
              +
              autocompletechange
              +
              +
              +
              +

              Triggered when the field is blurred, if the value has changed; ui.item refers to the selected item.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the change event as an init option. +
              +
              +
              $( ".selector" ).autocomplete({
              +   change: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the change event by type: autocompletechange. +
              +
              +
              $( ".selector" ).bind( "autocompletechange", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .autocomplete( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the autocomplete functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .autocomplete( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the autocomplete.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .autocomplete( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the autocomplete.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .autocomplete( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any autocomplete option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .autocomplete( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple autocomplete options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .autocomplete( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-autocomplete element.

              +
              +
            • + + + + + +
            • +
              +

              close

              +
              +
              Signature:
              +
              .autocomplete( "close" + + + + + + + +)
              +
              +
              +
              +

              Close the Autocomplete menu. Useful in combination with the search method, to close the open menu.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Autocomplete plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.autocomplete.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <input class="ui-autocomplete-input"/>
            +<ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all">
            +  <li class="ui-menu-item">
            +    <a class="ui-corner-all">item 1</a>
            +  </li>
            +  <li class="ui-menu-item">
            +    <a class="ui-corner-all">item 2</a>
            +  </li>
            +  <li class="ui-menu-item">
            +    <a class="ui-corner-all">item 3</a>
            +  </li>
            +</ul> +

            + + Note: This is a sample of markup generated by the autocomplete plugin, not markup you should use to create a autocomplete. The only markup needed for that is <input/>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/button.html b/static/grappelli_orig/js/ui/development-bundle/docs/button.html new file mode 100644 index 00000000..9fbbd8b1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/button.html @@ -0,0 +1,500 @@ + + +
            +

            jQuery UI Button

            +
            +

            Overview

            +
            +

            Button enhances standard form elements like button, input of type submit or reset or anchors to themable buttons with appropiate mouseover and active styles.

            +

            In addition to basic push buttons, radio buttons and checkboxes (inputs of type radio and checkbox) can be converted to buttons: Their associated label is styled to appear as the button, while the underlying input is updated on click.

            +

            In order to group radio buttons, Button also provides an additional widget-method, called Buttonset. Its used by selecting a container element (which contains the radio buttons) and calling buttonset(). Buttonset will also provide visual grouping, and therefore should be used whenever you have a group of buttons. It works by selecting all descendents and applying button() to them. You can enable and disable a buttonset, which will enable and disable all contained buttons. Destroying a buttonset also calls the button's destroy method.

            +

            When using an input of type button, submit or reset, support is limited to plain text labels with no icons.

            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Button.
            +

            +
            $("button").button();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("button").button();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<button>Button label</button>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            + +
            +A simple jQuery UI Button.
            +

            +
            $("#radio").buttonset();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("#radio").buttonset();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="radio">
            +	<input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
            +	<input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
            +	<input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
            +</div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the button. Can be set when initialising (first creating) the button.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a button with the disabled option specified. +
              +
              +
              $( ".selector" ).button({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).button( "option", "disabled" );
              +//setter
              +$( ".selector" ).button( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              text

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              Whether to show any text - when set to false (display no text), icons (see icons option) must be enabled, otherwise it'll be ignored.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a button with the text option specified. +
              +
              +
              $( ".selector" ).button({ text: false });
              +
              + + +
              + Get or set the text option, after init. +
              +
              +
              //getter
              +var text = $( ".selector" ).button( "option", "text" );
              +//setter
              +$( ".selector" ).button( "option", "text", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              icons

              +
              +
              Type:
              +
              Options
              + +
              Default:
              +
              { primary: null, secondary: null }
              + +
              +
              +
              +

              Icons to display, with or without text (see text option). The primary icon is displayed by default on the left of the label text, the secondary by default is on the right. Value for the primary and secondary properties must be a classname (String), eg. "ui-icon-gear". For using only one icon: icons: {primary:'ui-icon-locked'}. For using two icons: icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a button with the icons option specified. +
              +
              +
              $( ".selector" ).button({ icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'} });
              +
              + + +
              + Get or set the icons option, after init. +
              +
              +
              //getter
              +var icons = $( ".selector" ).button( "option", "icons" );
              +//setter
              +$( ".selector" ).button( "option", "icons", {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'} );
              +
              + +
              +
              +
            • + + +
            • +
              +

              label

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              HTML content of the button, or value attribute
              + +
              +
              +
              +

              Text to show on the button. When not specified (null), the element's html content is used, or its value attribute when it's an input element of type submit or reset; or the html content of the associated label element if its an input of type radio or checkbox

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a button with the label option specified. +
              +
              +
              $( ".selector" ).button({ label: "custom label" });
              +
              + + +
              + Get or set the label option, after init. +
              +
              +
              //getter
              +var label = $( ".selector" ).button( "option", "label" );
              +//setter
              +$( ".selector" ).button( "option", "label", "custom label" );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              buttoncreate
              +
              +
              +
              +

              This event is triggered when button is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).button({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: buttoncreate. +
              +
              +
              $( ".selector" ).bind( "buttoncreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +

              +

              There are no events for this plugin.

              +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .button( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the button functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + +

              +

            • +
              +

              disable

              +
              +
              Signature:
              +
              .button( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the button.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .button( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the button.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .button( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any button option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .button( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple button options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .button( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-button element.

              +
              +
            • + + +
            • +
              +

              refresh

              +
              +
              Signature:
              +
              .button( "refresh" + + + + + + + +)
              +
              +
              +
              +

              Refreshes the visual state of the button. Useful for updating button state after the native element's checked or disabled state is changed programatically.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Button plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.button.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all">
            +   <span class="ui-button-text">Button Label</span>
            </button> +

            + + Note: This is a sample of markup generated by the button plugin, not markup you should use to create a button. The only markup needed for that is <button>Button Label</button>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/datepicker.html b/static/grappelli_orig/js/ui/development-bundle/docs/datepicker.html new file mode 100644 index 00000000..d62e1e5a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/datepicker.html @@ -0,0 +1,2532 @@ + + +
            +

            jQuery UI Datepicker

            +
            +

            Overview

            +
            +

            The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges and add in buttons and other navigation options easily.

            +

            By default, the datepicker calendar opens in a small overlay onFocus and closes automatically onBlur or when a date is selected. For an inline calendar, simply attach the datepicker to a div or span. +

            You can use keyboard shortcuts to drive the datepicker: +

            +
              +
            • page up/down - previous/next month
            • +
            • ctrl+page up/down - previous/next year
            • +
            • ctrl+home - current month or open when closed
            • +
            • ctrl+left/right - previous/next day
            • +
            • ctrl+up/down - previous/next week
            • +
            • enter - accept the selected date
            • +
            • ctrl+end - close and erase the date
            • +
            • escape - close the datepicker without selection
            • +
            +

            Utility functions

            + +

            Localization

            +

            Datepicker provides support for localizing its content to cater for different languages + and date formats. Each localization is contained within its own file with the + language code appended to the name, e.g. jquery.ui.datepicker-fr.js for French. + The desired localization file should be included after the main datepicker code. They add their settings to the set + of available localizations and automatically apply them as defaults for all instances.

            +

            The $.datepicker.regional attribute holds an array of localizations, + indexed by language code, with "" referring to the default (English). Each entry is + an object with the following attributes: closeText, prevText, + nextText, currentText, monthNames, + monthNamesShort, dayNames, dayNamesShort, + dayNamesMin, weekHeader, dateFormat, + firstDay, isRTL, showMonthAfterYear, + and yearSuffix.

            +

            You can restore the default localizations with:

            +

            $.datepicker.setDefaults($.datepicker.regional[""]); +

            +

            And can then override an individual datepicker for a specific locale:

            +

            $(selector).datepicker($.datepicker.regional['fr']); +

            +The localization files are also available in the UI svn: http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/ +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Datepicker.
            +

            +
            $("#datepicker").datepicker();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("#datepicker").datepicker();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="datepicker"></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the datepicker. Can be set when initialising (first creating) the datepicker.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the disabled option specified. +
              +
              +
              $( ".selector" ).datepicker({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).datepicker( "option", "disabled" );
              +//setter
              +$( ".selector" ).datepicker( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              altField

              +
              +
              Type:
              +
              Selector, jQuery, Element
              + +
              Default:
              +
              ""
              + +
              +
              +
              +

              The jQuery selector for another field that is to be updated with the selected date from the datepicker. Use the altFormat setting to change the format of the date within this field. Leave as blank for no alternate field.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the altField option specified. +
              +
              +
              $( ".selector" ).datepicker({ altField: "#actualDate" });
              +
              + + +
              + Get or set the altField option, after init. +
              +
              +
              //getter
              +var altField = $( ".selector" ).datepicker( "option", "altField" );
              +//setter
              +$( ".selector" ).datepicker( "option", "altField", "#actualDate" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              altFormat

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              ""
              + +
              +
              +
              +

              The dateFormat to be used for the altField option. This allows one date format to be shown to the user for selection purposes, while a different format is actually sent behind the scenes. For a full list of the possible formats see the formatDate function

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the altFormat option specified. +
              +
              +
              $( ".selector" ).datepicker({ altFormat: "yy-mm-dd" });
              +
              + + +
              + Get or set the altFormat option, after init. +
              +
              +
              //getter
              +var altFormat = $( ".selector" ).datepicker( "option", "altFormat" );
              +//setter
              +$( ".selector" ).datepicker( "option", "altFormat", "yy-mm-dd" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              appendText

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              ""
              + +
              +
              +
              +

              The text to display after each date field, e.g. to show the required format.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the appendText option specified. +
              +
              +
              $( ".selector" ).datepicker({ appendText: "(yyyy-mm-dd)" });
              +
              + + +
              + Get or set the appendText option, after init. +
              +
              +
              //getter
              +var appendText = $( ".selector" ).datepicker( "option", "appendText" );
              +//setter
              +$( ".selector" ).datepicker( "option", "appendText", "(yyyy-mm-dd)" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              autoSize

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Set to true to automatically resize the input field to accommodate dates in the current dateFormat.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the autoSize option specified. +
              +
              +
              $( ".selector" ).datepicker({ autoSize: true });
              +
              + + +
              + Get or set the autoSize option, after init. +
              +
              +
              //getter
              +var autoSize = $( ".selector" ).datepicker( "option", "autoSize" );
              +//setter
              +$( ".selector" ).datepicker( "option", "autoSize", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              buttonImage

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              ""
              + +
              +
              +
              +

              The URL for the popup button image. If set, buttonText becomes the alt value and is not directly displayed.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the buttonImage option specified. +
              +
              +
              $( ".selector" ).datepicker({ buttonImage: "/images/datepicker.gif" });
              +
              + + +
              + Get or set the buttonImage option, after init. +
              +
              +
              //getter
              +var buttonImage = $( ".selector" ).datepicker( "option", "buttonImage" );
              +//setter
              +$( ".selector" ).datepicker( "option", "buttonImage", "/images/datepicker.gif" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              buttonImageOnly

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Set to true to place an image after the field to use as the trigger without it appearing on a button.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the buttonImageOnly option specified. +
              +
              +
              $( ".selector" ).datepicker({ buttonImageOnly: true });
              +
              + + +
              + Get or set the buttonImageOnly option, after init. +
              +
              +
              //getter
              +var buttonImageOnly = $( ".selector" ).datepicker( "option", "buttonImageOnly" );
              +//setter
              +$( ".selector" ).datepicker( "option", "buttonImageOnly", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              buttonText

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "..."
              + +
              +
              +
              +

              The text to display on the trigger button. Use in conjunction with showOn equal to 'button' or 'both'.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the buttonText option specified. +
              +
              +
              $( ".selector" ).datepicker({ buttonText: "Choose" });
              +
              + + +
              + Get or set the buttonText option, after init. +
              +
              +
              //getter
              +var buttonText = $( ".selector" ).datepicker( "option", "buttonText" );
              +//setter
              +$( ".selector" ).datepicker( "option", "buttonText", "Choose" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              calculateWeek

              +
              +
              Type:
              +
              Function
              + +
              Default:
              +
              $.datepicker.iso8601Week
              + +
              +
              +
              +

              A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the calculateWeek option specified. +
              +
              +
              $( ".selector" ).datepicker({ calculateWeek: myWeekCalc });
              +
              + + +
              + Get or set the calculateWeek option, after init. +
              +
              +
              //getter
              +var calculateWeek = $( ".selector" ).datepicker( "option", "calculateWeek" );
              +//setter
              +$( ".selector" ).datepicker( "option", "calculateWeek", myWeekCalc );
              +
              + +
              +
              +
            • + + +
            • +
              +

              changeMonth

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Allows you to change the month by selecting from a drop-down list. You can enable this feature by setting the attribute to true.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the changeMonth option specified. +
              +
              +
              $( ".selector" ).datepicker({ changeMonth: true });
              +
              + + +
              + Get or set the changeMonth option, after init. +
              +
              +
              //getter
              +var changeMonth = $( ".selector" ).datepicker( "option", "changeMonth" );
              +//setter
              +$( ".selector" ).datepicker( "option", "changeMonth", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              changeYear

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Allows you to change the year by selecting from a drop-down list. You can enable this feature by setting the attribute to true. Use the yearRange option to control which years are made available for selection.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the changeYear option specified. +
              +
              +
              $( ".selector" ).datepicker({ changeYear: true });
              +
              + + +
              + Get or set the changeYear option, after init. +
              +
              +
              //getter
              +var changeYear = $( ".selector" ).datepicker( "option", "changeYear" );
              +//setter
              +$( ".selector" ).datepicker( "option", "changeYear", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              closeText

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "Done"
              + +
              +
              +
              +

              The text to display for the close link. This attribute is one of the regionalisation attributes. Use the showButtonPanel to display this button.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the closeText option specified. +
              +
              +
              $( ".selector" ).datepicker({ closeText: "X" });
              +
              + + +
              + Get or set the closeText option, after init. +
              +
              +
              //getter
              +var closeText = $( ".selector" ).datepicker( "option", "closeText" );
              +//setter
              +$( ".selector" ).datepicker( "option", "closeText", "X" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              constrainInput

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              When true entry in the input field is constrained to those characters allowed by the current dateFormat.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the constrainInput option specified. +
              +
              +
              $( ".selector" ).datepicker({ constrainInput: false });
              +
              + + +
              + Get or set the constrainInput option, after init. +
              +
              +
              //getter
              +var constrainInput = $( ".selector" ).datepicker( "option", "constrainInput" );
              +//setter
              +$( ".selector" ).datepicker( "option", "constrainInput", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              currentText

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "Today"
              + +
              +
              +
              +

              The text to display for the current day link. This attribute is one of the regionalisation attributes. Use the showButtonPanel to display this button.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the currentText option specified. +
              +
              +
              $( ".selector" ).datepicker({ currentText: "Now" });
              +
              + + +
              + Get or set the currentText option, after init. +
              +
              +
              //getter
              +var currentText = $( ".selector" ).datepicker( "option", "currentText" );
              +//setter
              +$( ".selector" ).datepicker( "option", "currentText", "Now" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              dateFormat

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "mm/dd/yy"
              + +
              +
              +
              +

              The format for parsed and displayed dates. This attribute is one of the regionalisation attributes. For a full list of the possible formats see the formatDate function.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the dateFormat option specified. +
              +
              +
              $( ".selector" ).datepicker({ dateFormat: "yy-mm-dd" });
              +
              + + +
              + Get or set the dateFormat option, after init. +
              +
              +
              //getter
              +var dateFormat = $( ".selector" ).datepicker( "option", "dateFormat" );
              +//setter
              +$( ".selector" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              dayNames

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
              + +
              +
              +
              +

              The list of long day names, starting from Sunday, for use as requested via the dateFormat setting. They also appear as popup hints when hovering over the corresponding column headings. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the dayNames option specified. +
              +
              +
              $( ".selector" ).datepicker({ dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] });
              +
              + + +
              + Get or set the dayNames option, after init. +
              +
              +
              //getter
              +var dayNames = $( ".selector" ).datepicker( "option", "dayNames" );
              +//setter
              +$( ".selector" ).datepicker( "option", "dayNames", ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              dayNamesMin

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
              + +
              +
              +
              +

              The list of minimised day names, starting from Sunday, for use as column headers within the datepicker. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the dayNamesMin option specified. +
              +
              +
              $( ".selector" ).datepicker({ dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"] });
              +
              + + +
              + Get or set the dayNamesMin option, after init. +
              +
              +
              //getter
              +var dayNamesMin = $( ".selector" ).datepicker( "option", "dayNamesMin" );
              +//setter
              +$( ".selector" ).datepicker( "option", "dayNamesMin", ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              dayNamesShort

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
              + +
              +
              +
              +

              The list of abbreviated day names, starting from Sunday, for use as requested via the dateFormat setting. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the dayNamesShort option specified. +
              +
              +
              $( ".selector" ).datepicker({ dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] });
              +
              + + +
              + Get or set the dayNamesShort option, after init. +
              +
              +
              //getter
              +var dayNamesShort = $( ".selector" ).datepicker( "option", "dayNamesShort" );
              +//setter
              +$( ".selector" ).datepicker( "option", "dayNamesShort", ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              defaultDate

              +
              +
              Type:
              +
              Date, Number, String
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              Set the date to highlight on first opening if the field is blank. Specify either an actual date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null for today.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the defaultDate option specified. +
              +
              +
              $( ".selector" ).datepicker({ defaultDate: +7 });
              +
              + + +
              + Get or set the defaultDate option, after init. +
              +
              +
              //getter
              +var defaultDate = $( ".selector" ).datepicker( "option", "defaultDate" );
              +//setter
              +$( ".selector" ).datepicker( "option", "defaultDate", +7 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              duration

              +
              +
              Type:
              +
              String, Number
              + +
              Default:
              +
              "normal"
              + +
              +
              +
              +

              Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast").

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the duration option specified. +
              +
              +
              $( ".selector" ).datepicker({ duration: "slow" });
              +
              + + +
              + Get or set the duration option, after init. +
              +
              +
              //getter
              +var duration = $( ".selector" ).datepicker( "option", "duration" );
              +//setter
              +$( ".selector" ).datepicker( "option", "duration", "slow" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              firstDay

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Set the first day of the week: Sunday is 0, Monday is 1, ... This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the firstDay option specified. +
              +
              +
              $( ".selector" ).datepicker({ firstDay: 1 });
              +
              + + +
              + Get or set the firstDay option, after init. +
              +
              +
              //getter
              +var firstDay = $( ".selector" ).datepicker( "option", "firstDay" );
              +//setter
              +$( ".selector" ).datepicker( "option", "firstDay", 1 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              gotoCurrent

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              When true the current day link moves to the currently selected date instead of today.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the gotoCurrent option specified. +
              +
              +
              $( ".selector" ).datepicker({ gotoCurrent: true });
              +
              + + +
              + Get or set the gotoCurrent option, after init. +
              +
              +
              //getter
              +var gotoCurrent = $( ".selector" ).datepicker( "option", "gotoCurrent" );
              +//setter
              +$( ".selector" ).datepicker( "option", "gotoCurrent", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              hideIfNoPrevNext

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Normally the previous and next links are disabled when not applicable (see minDate/maxDate). You can hide them altogether by setting this attribute to true.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the hideIfNoPrevNext option specified. +
              +
              +
              $( ".selector" ).datepicker({ hideIfNoPrevNext: true });
              +
              + + +
              + Get or set the hideIfNoPrevNext option, after init. +
              +
              +
              //getter
              +var hideIfNoPrevNext = $( ".selector" ).datepicker( "option", "hideIfNoPrevNext" );
              +//setter
              +$( ".selector" ).datepicker( "option", "hideIfNoPrevNext", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              isRTL

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              True if the current language is drawn from right to left. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the isRTL option specified. +
              +
              +
              $( ".selector" ).datepicker({ isRTL: true });
              +
              + + +
              + Get or set the isRTL option, after init. +
              +
              +
              //getter
              +var isRTL = $( ".selector" ).datepicker( "option", "isRTL" );
              +//setter
              +$( ".selector" ).datepicker( "option", "isRTL", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              maxDate

              +
              +
              Type:
              +
              Date, Number, String
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              Set a maximum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +1w'), or null for no limit.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the maxDate option specified. +
              +
              +
              $( ".selector" ).datepicker({ maxDate: "+1m +1w" });
              +
              + + +
              + Get or set the maxDate option, after init. +
              +
              +
              //getter
              +var maxDate = $( ".selector" ).datepicker( "option", "maxDate" );
              +//setter
              +$( ".selector" ).datepicker( "option", "maxDate", "+1m +1w" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              minDate

              +
              +
              Type:
              +
              Date, Number, String
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              Set a minimum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '-1y -1m'), or null for no limit.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the minDate option specified. +
              +
              +
              $( ".selector" ).datepicker({ minDate: new Date(2007, 1 - 1, 1) });
              +
              + + +
              + Get or set the minDate option, after init. +
              +
              +
              //getter
              +var minDate = $( ".selector" ).datepicker( "option", "minDate" );
              +//setter
              +$( ".selector" ).datepicker( "option", "minDate", new Date(2007, 1 - 1, 1) );
              +
              + +
              +
              +
            • + + +
            • +
              +

              monthNames

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
              + +
              +
              +
              +

              The list of full month names, for use as requested via the dateFormat setting. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the monthNames option specified. +
              +
              +
              $( ".selector" ).datepicker({ monthNames: ["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"] });
              +
              + + +
              + Get or set the monthNames option, after init. +
              +
              +
              //getter
              +var monthNames = $( ".selector" ).datepicker( "option", "monthNames" );
              +//setter
              +$( ".selector" ).datepicker( "option", "monthNames", ["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              monthNamesShort

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
              + +
              +
              +
              +

              The list of abbreviated month names, as used in the month header on each datepicker and as requested via the dateFormat setting. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the monthNamesShort option specified. +
              +
              +
              $( ".selector" ).datepicker({ monthNamesShort: ["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"] });
              +
              + + +
              + Get or set the monthNamesShort option, after init. +
              +
              +
              //getter
              +var monthNamesShort = $( ".selector" ).datepicker( "option", "monthNamesShort" );
              +//setter
              +$( ".selector" ).datepicker( "option", "monthNamesShort", ["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              navigationAsDateFormat

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              When true the formatDate function is applied to the prevText, nextText, and currentText values before display, allowing them to display the target month names for example.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the navigationAsDateFormat option specified. +
              +
              +
              $( ".selector" ).datepicker({ navigationAsDateFormat: true });
              +
              + + +
              + Get or set the navigationAsDateFormat option, after init. +
              +
              +
              //getter
              +var navigationAsDateFormat = $( ".selector" ).datepicker( "option", "navigationAsDateFormat" );
              +//setter
              +$( ".selector" ).datepicker( "option", "navigationAsDateFormat", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              nextText

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "Next"
              + +
              +
              +
              +

              The text to display for the next month link. This attribute is one of the regionalisation attributes. With the standard ThemeRoller styling, this value is replaced by an icon.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the nextText option specified. +
              +
              +
              $( ".selector" ).datepicker({ nextText: "Later" });
              +
              + + +
              + Get or set the nextText option, after init. +
              +
              +
              //getter
              +var nextText = $( ".selector" ).datepicker( "option", "nextText" );
              +//setter
              +$( ".selector" ).datepicker( "option", "nextText", "Later" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              numberOfMonths

              +
              +
              Type:
              +
              Number, Array
              + +
              Default:
              +
              1
              + +
              +
              +
              +

              Set how many months to show at once. The value can be a straight integer, or can be a two-element array to define the number of rows and columns to display.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the numberOfMonths option specified. +
              +
              +
              $( ".selector" ).datepicker({ numberOfMonths: [2, 3] });
              +
              + + +
              + Get or set the numberOfMonths option, after init. +
              +
              +
              //getter
              +var numberOfMonths = $( ".selector" ).datepicker( "option", "numberOfMonths" );
              +//setter
              +$( ".selector" ).datepicker( "option", "numberOfMonths", [2, 3] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              prevText

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "Prev"
              + +
              +
              +
              +

              The text to display for the previous month link. This attribute is one of the regionalisation attributes. With the standard ThemeRoller styling, this value is replaced by an icon.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the prevText option specified. +
              +
              +
              $( ".selector" ).datepicker({ prevText: "Earlier" });
              +
              + + +
              + Get or set the prevText option, after init. +
              +
              +
              //getter
              +var prevText = $( ".selector" ).datepicker( "option", "prevText" );
              +//setter
              +$( ".selector" ).datepicker( "option", "prevText", "Earlier" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              selectOtherMonths

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              When true days in other months shown before or after the current month are selectable. This only applies if showOtherMonths is also true.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the selectOtherMonths option specified. +
              +
              +
              $( ".selector" ).datepicker({ selectOtherMonths: true });
              +
              + + +
              + Get or set the selectOtherMonths option, after init. +
              +
              +
              //getter
              +var selectOtherMonths = $( ".selector" ).datepicker( "option", "selectOtherMonths" );
              +//setter
              +$( ".selector" ).datepicker( "option", "selectOtherMonths", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              shortYearCutoff

              +
              +
              Type:
              +
              String, Number
              + +
              Default:
              +
              "+10"
              + +
              +
              +
              +

              Set the cutoff year for determining the century for a date (used in conjunction with dateFormat 'y'). If a numeric value (0-99) is provided then this value is used directly. If a string value is provided then it is converted to a number and added to the current year. Once the cutoff year is calculated, any dates entered with a year value less than or equal to it are considered to be in the current century, while those greater than it are deemed to be in the previous century.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the shortYearCutoff option specified. +
              +
              +
              $( ".selector" ).datepicker({ shortYearCutoff: 50 });
              +
              + + +
              + Get or set the shortYearCutoff option, after init. +
              +
              +
              //getter
              +var shortYearCutoff = $( ".selector" ).datepicker( "option", "shortYearCutoff" );
              +//setter
              +$( ".selector" ).datepicker( "option", "shortYearCutoff", 50 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showAnim

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "show"
              + +
              +
              +
              +

              Set the name of the animation used to show/hide the datepicker. Use 'show' (the default), 'slideDown', 'fadeIn', any of the show/hide jQuery UI effects, or "" for no animation.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showAnim option specified. +
              +
              +
              $( ".selector" ).datepicker({ showAnim: "fold" });
              +
              + + +
              + Get or set the showAnim option, after init. +
              +
              +
              //getter
              +var showAnim = $( ".selector" ).datepicker( "option", "showAnim" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showAnim", "fold" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showButtonPanel

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Whether to show the button panel.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showButtonPanel option specified. +
              +
              +
              $( ".selector" ).datepicker({ showButtonPanel: true });
              +
              + + +
              + Get or set the showButtonPanel option, after init. +
              +
              +
              //getter
              +var showButtonPanel = $( ".selector" ).datepicker( "option", "showButtonPanel" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showButtonPanel", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showCurrentAtPos

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Specify where in a multi-month display the current month shows, starting from 0 at the top/left.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showCurrentAtPos option specified. +
              +
              +
              $( ".selector" ).datepicker({ showCurrentAtPos: 3 });
              +
              + + +
              + Get or set the showCurrentAtPos option, after init. +
              +
              +
              //getter
              +var showCurrentAtPos = $( ".selector" ).datepicker( "option", "showCurrentAtPos" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showCurrentAtPos", 3 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showMonthAfterYear

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Whether to show the month after the year in the header. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showMonthAfterYear option specified. +
              +
              +
              $( ".selector" ).datepicker({ showMonthAfterYear: true });
              +
              + + +
              + Get or set the showMonthAfterYear option, after init. +
              +
              +
              //getter
              +var showMonthAfterYear = $( ".selector" ).datepicker( "option", "showMonthAfterYear" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showMonthAfterYear", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showOn

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "focus"
              + +
              +
              +
              +

              Have the datepicker appear automatically when the field receives focus ("focus"), appear only when a button is clicked ("button"), or appear when either event taks place ("both").

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showOn option specified. +
              +
              +
              $( ".selector" ).datepicker({ showOn: "both" });
              +
              + + +
              + Get or set the showOn option, after init. +
              +
              +
              //getter
              +var showOn = $( ".selector" ).datepicker( "option", "showOn" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showOn", "both" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showOptions

              +
              +
              Type:
              +
              Options
              + +
              Default:
              +
              {}
              + +
              +
              +
              +

              If using one of the jQuery UI effects for showAnim, you can provide additional settings for that animation via this option.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showOptions option specified. +
              +
              +
              $( ".selector" ).datepicker({ showOptions: {direction: 'up'}  });
              +
              + + +
              + Get or set the showOptions option, after init. +
              +
              +
              //getter
              +var showOptions = $( ".selector" ).datepicker( "option", "showOptions" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showOptions", {direction: 'up'}  );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showOtherMonths

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use selectOtherMonths.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showOtherMonths option specified. +
              +
              +
              $( ".selector" ).datepicker({ showOtherMonths: true });
              +
              + + +
              + Get or set the showOtherMonths option, after init. +
              +
              +
              //getter
              +var showOtherMonths = $( ".selector" ).datepicker( "option", "showOtherMonths" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showOtherMonths", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              showWeek

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              When true a column is added to show the week of the year. The calculateWeek option determines how the week of the year is calculated. You may also want to change the firstDay option.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the showWeek option specified. +
              +
              +
              $( ".selector" ).datepicker({ showWeek: true });
              +
              + + +
              + Get or set the showWeek option, after init. +
              +
              +
              //getter
              +var showWeek = $( ".selector" ).datepicker( "option", "showWeek" );
              +//setter
              +$( ".selector" ).datepicker( "option", "showWeek", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              stepMonths

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              1
              + +
              +
              +
              +

              Set how many months to move when clicking the Previous/Next links.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the stepMonths option specified. +
              +
              +
              $( ".selector" ).datepicker({ stepMonths: 3 });
              +
              + + +
              + Get or set the stepMonths option, after init. +
              +
              +
              //getter
              +var stepMonths = $( ".selector" ).datepicker( "option", "stepMonths" );
              +//setter
              +$( ".selector" ).datepicker( "option", "stepMonths", 3 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              weekHeader

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "Wk"
              + +
              +
              +
              +

              The text to display for the week of the year column heading. This attribute is one of the regionalisation attributes. Use showWeek to display this column.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the weekHeader option specified. +
              +
              +
              $( ".selector" ).datepicker({ weekHeader: "W" });
              +
              + + +
              + Get or set the weekHeader option, after init. +
              +
              +
              //getter
              +var weekHeader = $( ".selector" ).datepicker( "option", "weekHeader" );
              +//setter
              +$( ".selector" ).datepicker( "option", "weekHeader", "W" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              yearRange

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "c-10:c+10"
              + +
              +
              +
              +

              Control the range of years displayed in the year drop-down: either relative to today's year (-nn:+nn), relative to the currently selected year (c-nn:c+nn), absolute (nnnn:nnnn), or combinations of these formats (nnnn:-nn). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the yearRange option specified. +
              +
              +
              $( ".selector" ).datepicker({ yearRange: "2000:2010" });
              +
              + + +
              + Get or set the yearRange option, after init. +
              +
              +
              //getter
              +var yearRange = $( ".selector" ).datepicker( "option", "yearRange" );
              +//setter
              +$( ".selector" ).datepicker( "option", "yearRange", "2000:2010" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              yearSuffix

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              ""
              + +
              +
              +
              +

              Additional text to display after the year in the month headers. This attribute is one of the regionalisation attributes.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a datepicker with the yearSuffix option specified. +
              +
              +
              $( ".selector" ).datepicker({ yearSuffix: "CE" });
              +
              + + +
              + Get or set the yearSuffix option, after init. +
              +
              +
              //getter
              +var yearSuffix = $( ".selector" ).datepicker( "option", "yearSuffix" );
              +//setter
              +

              +$( ".selector" ).datepicker( "option", "yearSuffix", "CE" );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              +

              Known issue: Datepicker does not trigger a create event.

              +
            • +
              +

              beforeShow

              +
              +
              +
              function(input, inst)
              +
              +
              +
              +

              Can be a function that takes an input field and current datepicker instance and returns an options object to update the datepicker with. It is called just before the datepicker is displayed.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the beforeShow event as an init option. +
              +
              +
              $('.selector').datepicker({
              +   beforeShow: function(input, inst) { ... }
              +});
              +
              + +
              +
              +
            • + +

              +

            • +
              +

              beforeShowDay

              +
              +
              +
              function(date)
              +
              +
              +
              +

              The function takes a date as a parameter and must return an array with [0] equal to true/false indicating whether or not this date is selectable, [1] equal to a CSS class name(s) or "" for the default presentation, and [2] an optional popup tooltip for this date. It is called for each day in the datepicker before it is displayed.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the beforeShowDay event as an init option. +
              +
              +
              $('.selector').datepicker({
              +   beforeShowDay: function(date) { ... }
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              onChangeMonthYear

              +
              +
              +
              function(year, month, inst)
              +
              +
              +
              +

              Allows you to define your own event when the datepicker moves to a new month and/or year. The function receives the selected year, month (1-12), and the datepicker instance as parameters. this refers to the associated input field.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the onChangeMonthYear event as an init option. +
              +
              +
              $('.selector').datepicker({
              +   onChangeMonthYear: function(year, month, inst) { ... }
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              onClose

              +
              +
              +
              function(dateText, inst)
              +
              +
              +
              +

              Allows you to define your own event when the datepicker is closed, whether or not a date is selected. The function receives the selected date as text ("" if none) and the datepicker instance as parameters. this refers to the associated input field.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the onClose event as an init option. +
              +
              +
              $('.selector').datepicker({
              +   onClose: function(dateText, inst) { ... }
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              onSelect

              +
              +
              +
              function(dateText, inst)
              +
              +
              +
              +

              Allows you to define your own event when the datepicker is selected. The function receives the selected date as text and the datepicker instance as parameters. this refers to the associated input field.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the onSelect event as an init option. +
              +
              +
              $('.selector').datepicker({
              +   onSelect: function(dateText, inst) { ... }
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .datepicker( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the datepicker functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .datepicker( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the datepicker.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .datepicker( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the datepicker.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .datepicker( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any datepicker option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .datepicker( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple datepicker options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .datepicker( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-datepicker element.

              +
              +
            • + + +
            • +
              +

              dialog

              +
              +
              Signature:
              +
              .datepicker( "dialog" + +, date + +, [onSelect] + +, [settings] + +, [pos] )
              +
              +
              +
              +

              Open a datepicker in a "dialog" box. +

              dateText: the initial date for the date picker as either a Date or a string in the current date format. +

              onSelect: A callback function when a date is selected. The function receives the date text and date picker instance as parameters. +

              settings: The new settings for the date picker. +

              pos: The position of the top/left of the dialog as [x, y] or a MouseEvent that contains the coordinates. If not specified the dialog is centered on the screen.

              +
              +
            • + + +
            • +
              +

              isDisabled

              +
              +
              Signature:
              +
              .datepicker( "isDisabled" + + + + + + + +)
              +
              +
              +
              +

              Determine whether a date picker has been disabled.

              +
              +
            • + + +
            • +
              +

              hide

              +
              +
              Signature:
              +
              .datepicker( "hide" + + + + + + + +)
              +
              +
              +
              +

              Close a previously opened date picker.

              +
              +
            • + + +
            • +
              +

              show

              +
              +
              Signature:
              +
              .datepicker( "show" + + + + + + + +)
              +
              +
              +
              +

              Call up a previously attached date picker. If the datepicker is attached to an input, the input must be visible for the datepicker to be shown.

              +
              +
            • + + +
            • +
              +

              refresh

              +
              +
              Signature:
              +
              .datepicker( "refresh" + + + + + + + +)
              +
              +
              +
              +

              Redraw a date picker, after having made some external modifications.

              +
              +
            • + + +
            • +
              +

              getDate

              +
              +
              Signature:
              +
              .datepicker( "getDate" + + + + + + + +)
              +
              +
              +
              +

              Returns the current date for the datepicker or null if no date has been selected.

              +
              +
            • + + +
            • +
              +

              setDate

              +
              +
              Signature:
              +
              .datepicker( "setDate" + +, date + + + + + +)
              +
              +
              +
              +

              Sets the current date for the datepicker. The new date may be a Date object or a string in the current date format (e.g. '01/26/2009'), a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null to clear the selected date.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Datepicker plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.datepicker.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible">
            +   <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
            +      <a class="ui-datepicker-prev ui-corner-all" title="Prev"><span class="ui-icon ui-icon-circle-triangle-w">Prev</span></a>
            +      <a class="ui-datepicker-next ui-corner-all" title="Next"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a>
            +      <div class="ui-datepicker-title">
            +         <span class="ui-datepicker-month">January</span><span class="ui-datepicker-year">2009</span>
            +      </div>
            +   </div>
            +   <table class="ui-datepicker-calendar">
            +      <thead>
            +      <tr>
            +         <th class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
            +         ...
            +      </tr>
            +      </thead>
            +      <tbody><tr>
            +         <td class="ui-datepicker-week-end ui-datepicker-other-month "> 1 </td>
            +         ...
            +      </tr>
            +      </tbody>
            +   </table>
            +   <div class="ui-datepicker-buttonpane ui-widget-content">
            +      <button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all">Today</button>
            +      <button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all">Done</button>
            +   </div>
            +</div>
            +

            + + Note: This is a sample of markup generated by the datepicker plugin, not markup you should use to create a datepicker. The only markup needed for that is <input type="text" /> or <div></div>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/dialog.html b/static/grappelli_orig/js/ui/development-bundle/docs/dialog.html new file mode 100644 index 00000000..4b947db1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/dialog.html @@ -0,0 +1,1782 @@ + + +
            +

            jQuery UI Dialog

            +
            +

            Overview

            +
            +

            A dialog is a floating window that contains a title bar and a content area. The dialog window can be moved, resized and closed with the 'x' icon by default.

            +

            If the content length exceeds the maximum height, a scrollbar will automatically appear.

            +

            A bottom button bar and semi-transparent modal overlay layer are common options that can be added.

            +

            A call to $(foo).dialog() will initialize a dialog instance and will auto-open the dialog by default. If you want to reuse a dialog, the easiest way is to disable the "auto-open" option with: $(foo).dialog({ autoOpen: false }) and open it with $(foo).dialog('open'). To close it, use $(foo).dialog('close'). A more in-depth explanation with a full demo is available on the Nemikor blog.

            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Position
            • +
            • UI Widget
            • +
            • UI Mouse (Optional; only needed if using UI Draggable or UI Resizable)
            • +
            • UI Draggable (Optional)
            • +
            • UI Resizable (Optional)
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Dialog.
            +

            +
            $("#dialog").dialog();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("#dialog").dialog();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="dialog" title="Dialog Title">I'm in a dialog</div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the dialog. Can be set when initialising (first creating) the dialog.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the disabled option specified. +
              +
              +
              $( ".selector" ).dialog({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).dialog( "option", "disabled" );
              +//setter
              +$( ".selector" ).dialog( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              autoOpen

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              When autoOpen is true the dialog will open automatically when dialog is called. If false it will stay hidden until .dialog("open") is called on it.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the autoOpen option specified. +
              +
              +
              $( ".selector" ).dialog({ autoOpen: false });
              +
              + + +
              + Get or set the autoOpen option, after init. +
              +
              +
              //getter
              +var autoOpen = $( ".selector" ).dialog( "option", "autoOpen" );
              +//setter
              +$( ".selector" ).dialog( "option", "autoOpen", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              buttons

              +
              +
              Type:
              +
              Object
              + +
              Default:
              +
              { }
              + +
              +
              +
              +

              Specifies which buttons should be displayed on the dialog. The property key is the text of the button. The value is the callback function for when the button is clicked. The context of the callback is the dialog element; if you need access to the button, it is available as the target of the event object. +

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the buttons option specified. +
              +
              +
              $( ".selector" ).dialog({ buttons: { "Ok": function() { $(this).dialog("close"); } } });
              +
              + + +
              + Get or set the buttons option, after init. +
              +
              +
              //getter
              +var buttons = $( ".selector" ).dialog( "option", "buttons" );
              +//setter
              +$( ".selector" ).dialog( "option", "buttons", { "Ok": function() { $(this).dialog("close"); } } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              buttons

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              [ ]
              + +
              +
              +
              +

              Specifies which buttons should be displayed on the dialog. Each element of the array must be an Object defining the properties to set on the button. +

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the buttons option specified. +
              +
              +
              $( ".selector" ).dialog({ buttons: [
              +    {
              +        text: "Ok",
              +        click: function() { $(this).dialog("close"); }
              +    }
              +] });
              +
              + + +
              + Get or set the buttons option, after init. +
              +
              +
              //getter
              +var buttons = $( ".selector" ).dialog( "option", "buttons" );
              +//setter
              +$( ".selector" ).dialog( "option", "buttons", [
              +    {
              +        text: "Ok",
              +        click: function() { $(this).dialog("close"); }
              +    }
              +] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              closeOnEscape

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              Specifies whether the dialog should close when it has focus and the user presses the esacpe (ESC) key.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the closeOnEscape option specified. +
              +
              +
              $( ".selector" ).dialog({ closeOnEscape: false });
              +
              + + +
              + Get or set the closeOnEscape option, after init. +
              +
              +
              //getter
              +var closeOnEscape = $( ".selector" ).dialog( "option", "closeOnEscape" );
              +//setter
              +$( ".selector" ).dialog( "option", "closeOnEscape", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              closeText

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "close"
              + +
              +
              +
              +

              Specifies the text for the close button. Note that the close text is visibly hidden when using a standard theme.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the closeText option specified. +
              +
              +
              $( ".selector" ).dialog({ closeText: 'hide' });
              +
              + + +
              + Get or set the closeText option, after init. +
              +
              +
              //getter
              +var closeText = $( ".selector" ).dialog( "option", "closeText" );
              +//setter
              +$( ".selector" ).dialog( "option", "closeText", 'hide' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              dialogClass

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              ""
              + +
              +
              +
              +

              The specified class name(s) will be added to the dialog, for additional theming.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the dialogClass option specified. +
              +
              +
              $( ".selector" ).dialog({ dialogClass: "alert" });
              +
              + + +
              + Get or set the dialogClass option, after init. +
              +
              +
              //getter
              +var dialogClass = $( ".selector" ).dialog( "option", "dialogClass" );
              +//setter
              +$( ".selector" ).dialog( "option", "dialogClass", "alert" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              draggable

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If set to true, the dialog will be draggable will be draggable by the titlebar.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the draggable option specified. +
              +
              +
              $( ".selector" ).dialog({ draggable: false });
              +
              + + +
              + Get or set the draggable option, after init. +
              +
              +
              //getter
              +var draggable = $( ".selector" ).dialog( "option", "draggable" );
              +//setter
              +$( ".selector" ).dialog( "option", "draggable", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              height

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              "auto"
              + +
              +
              +
              +

              The height of the dialog, in pixels. Specifying 'auto' is also supported to make the dialog adjust based on its content.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the height option specified. +
              +
              +
              $( ".selector" ).dialog({ height: 530 });
              +
              + + +
              + Get or set the height option, after init. +
              +
              +
              //getter
              +var height = $( ".selector" ).dialog( "option", "height" );
              +//setter
              +$( ".selector" ).dialog( "option", "height", 530 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              hide

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              The effect to be used when the dialog is closed.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the hide option specified. +
              +
              +
              $( ".selector" ).dialog({ hide: "slide" });
              +
              + + +
              + Get or set the hide option, after init. +
              +
              +
              //getter
              +var hide = $( ".selector" ).dialog( "option", "hide" );
              +//setter
              +$( ".selector" ).dialog( "option", "hide", "slide" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              hide

              +
              +
              Type:
              +
              Object
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              The effect to be used when the dialog is closed.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the hide option specified. +
              +
              +
              $( ".selector" ).dialog({ hide: { effect: 'drop', direction: "down" } });
              +
              + + +
              + Get or set the hide option, after init. +
              +
              +
              //getter
              +var hide = $( ".selector" ).dialog( "option", "hide" );
              +//setter
              +$( ".selector" ).dialog( "option", "hide", { effect: 'drop', direction: "down" } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              maxHeight

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              The maximum height to which the dialog can be resized, in pixels.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the maxHeight option specified. +
              +
              +
              $( ".selector" ).dialog({ maxHeight: 400 });
              +
              + + +
              + Get or set the maxHeight option, after init. +
              +
              +
              //getter
              +var maxHeight = $( ".selector" ).dialog( "option", "maxHeight" );
              +//setter
              +$( ".selector" ).dialog( "option", "maxHeight", 400 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              maxWidth

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              The maximum width to which the dialog can be resized, in pixels.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the maxWidth option specified. +
              +
              +
              $( ".selector" ).dialog({ maxWidth: 600 });
              +
              + + +
              + Get or set the maxWidth option, after init. +
              +
              +
              //getter
              +var maxWidth = $( ".selector" ).dialog( "option", "maxWidth" );
              +//setter
              +$( ".selector" ).dialog( "option", "maxWidth", 600 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              minHeight

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              150
              + +
              +
              +
              +

              The minimum height to which the dialog can be resized, in pixels.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the minHeight option specified. +
              +
              +
              $( ".selector" ).dialog({ minHeight: 300 });
              +
              + + +
              + Get or set the minHeight option, after init. +
              +
              +
              //getter
              +var minHeight = $( ".selector" ).dialog( "option", "minHeight" );
              +//setter
              +$( ".selector" ).dialog( "option", "minHeight", 300 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              minWidth

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              150
              + +
              +
              +
              +

              The minimum width to which the dialog can be resized, in pixels.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the minWidth option specified. +
              +
              +
              $( ".selector" ).dialog({ minWidth: 400 });
              +
              + + +
              + Get or set the minWidth option, after init. +
              +
              +
              //getter
              +var minWidth = $( ".selector" ).dialog( "option", "minWidth" );
              +//setter
              +$( ".selector" ).dialog( "option", "minWidth", 400 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              modal

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, the dialog will have modal behavior; other items on the page will be disabled (i.e. cannot be interacted with). Modal dialogs create an overlay below the dialog but above other page elements.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the modal option specified. +
              +
              +
              $( ".selector" ).dialog({ modal: true });
              +
              + + +
              + Get or set the modal option, after init. +
              +
              +
              //getter
              +var modal = $( ".selector" ).dialog( "option", "modal" );
              +//setter
              +$( ".selector" ).dialog( "option", "modal", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              position

              +
              +
              Type:
              +
              String, Array
              + +
              Default:
              +
              "center"
              + +
              +
              +
              +

              Specifies where the dialog should be displayed. Possible values:
              1) a single string representing position within viewport: 'center', 'left', 'right', 'top', 'bottom'.
              2) an array containing an x,y coordinate pair in pixel offset from left, top corner of viewport (e.g. [350,100])
              3) an array containing x,y position string values (e.g. ['right','top'] for top right corner).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the position option specified. +
              +
              +
              $( ".selector" ).dialog({ position: "top" });
              +
              + + +
              + Get or set the position option, after init. +
              +
              +
              //getter
              +var position = $( ".selector" ).dialog( "option", "position" );
              +//setter
              +$( ".selector" ).dialog( "option", "position", "top" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              resizable

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If set to true, the dialog will be resizable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the resizable option specified. +
              +
              +
              $( ".selector" ).dialog({ resizable: false });
              +
              + + +
              + Get or set the resizable option, after init. +
              +
              +
              //getter
              +var resizable = $( ".selector" ).dialog( "option", "resizable" );
              +//setter
              +$( ".selector" ).dialog( "option", "resizable", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              show

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              The effect to be used when the dialog is opened.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the show option specified. +
              +
              +
              $( ".selector" ).dialog({ show: "slide" });
              +
              + + +
              + Get or set the show option, after init. +
              +
              +
              //getter
              +var show = $( ".selector" ).dialog( "option", "show" );
              +//setter
              +$( ".selector" ).dialog( "option", "show", "slide" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              show

              +
              +
              Type:
              +
              Object
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              The effect to be used when the dialog is opened.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the show option specified. +
              +
              +
              $( ".selector" ).dialog({ show: { effect: 'drop', direction: "up" } });
              +
              + + +
              + Get or set the show option, after init. +
              +
              +
              //getter
              +var show = $( ".selector" ).dialog( "option", "show" );
              +//setter
              +$( ".selector" ).dialog( "option", "show", { effect: 'drop', direction: "up" } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              stack

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              Specifies whether the dialog will stack on top of other dialogs. This will cause the dialog to move to the front of other dialogs when it gains focus.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the stack option specified. +
              +
              +
              $( ".selector" ).dialog({ stack: false });
              +
              + + +
              + Get or set the stack option, after init. +
              +
              +
              //getter
              +var stack = $( ".selector" ).dialog( "option", "stack" );
              +//setter
              +$( ".selector" ).dialog( "option", "stack", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              title

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              ""
              + +
              +
              +
              +

              Specifies the title of the dialog. Any valid HTML may be set as the title. The title can also be specified by the title attribute on the dialog source element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the title option specified. +
              +
              +
              $( ".selector" ).dialog({ title: "Dialog Title" });
              +
              + + +
              + Get or set the title option, after init. +
              +
              +
              //getter
              +var title = $( ".selector" ).dialog( "option", "title" );
              +//setter
              +$( ".selector" ).dialog( "option", "title", "Dialog Title" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              width

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              300
              + +
              +
              +
              +

              The width of the dialog, in pixels.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the width option specified. +
              +
              +
              $( ".selector" ).dialog({ width: 460 });
              +
              + + +
              + Get or set the width option, after init. +
              +
              +
              //getter
              +var width = $( ".selector" ).dialog( "option", "width" );
              +//setter
              +$( ".selector" ).dialog( "option", "width", 460 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              zIndex

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              1000
              + +
              +
              +
              +

              The starting z-index for the dialog.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a dialog with the zIndex option specified. +
              +
              +
              $( ".selector" ).dialog({ zIndex: 3999 });
              +
              + + +
              + Get or set the zIndex option, after init. +
              +
              +
              //getter
              +var zIndex = $( ".selector" ).dialog( "option", "zIndex" );
              +//setter
              +$( ".selector" ).dialog( "option", "zIndex", 3999 );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              dialogcreate
              +
              +
              +
              +

              This event is triggered when dialog is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: dialogcreate. +
              +
              +
              $( ".selector" ).bind( "dialogcreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              beforeClose

              +
              +
              Type:
              +
              dialogbeforeclose
              +
              +
              +
              +

              This event is triggered when a dialog attempts to close. If the beforeClose event handler (callback function) returns false, the close will be prevented.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the beforeClose event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   beforeClose: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the beforeClose event by type: dialogbeforeclose. +
              +
              +
              $( ".selector" ).bind( "dialogbeforeclose", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              open

              +
              +
              Type:
              +
              dialogopen
              +
              +
              +
              +

              This event is triggered when dialog is opened.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the open event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   open: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the open event by type: dialogopen. +
              +
              +
              $( ".selector" ).bind( "dialogopen", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              focus

              +
              +
              Type:
              +
              dialogfocus
              +
              +
              +
              +

              This event is triggered when the dialog gains focus.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the focus event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   focus: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the focus event by type: dialogfocus. +
              +
              +
              $( ".selector" ).bind( "dialogfocus", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              dragStart

              +
              +
              Type:
              +
              dialogdragstart
              +
              +
              +
              +

              This event is triggered at the beginning of the dialog being dragged.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the dragStart event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   dragStart: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the dragStart event by type: dialogdragstart. +
              +
              +
              $( ".selector" ).bind( "dialogdragstart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              drag

              +
              +
              Type:
              +
              dialogdrag
              +
              +
              +
              +

              This event is triggered when the dialog is dragged.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the drag event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   drag: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the drag event by type: dialogdrag. +
              +
              +
              $( ".selector" ).bind( "dialogdrag", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              dragStop

              +
              +
              Type:
              +
              dialogdragstop
              +
              +
              +
              +

              This event is triggered after the dialog has been dragged.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the dragStop event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   dragStop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the dragStop event by type: dialogdragstop. +
              +
              +
              $( ".selector" ).bind( "dialogdragstop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              resizeStart

              +
              +
              Type:
              +
              dialogresizestart
              +
              +
              +
              +

              This event is triggered at the beginning of the dialog being resized.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the resizeStart event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   resizeStart: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the resizeStart event by type: dialogresizestart. +
              +
              +
              $( ".selector" ).bind( "dialogresizestart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              resize

              +
              +
              Type:
              +
              dialogresize
              +
              +
              +
              +

              This event is triggered when the dialog is resized. demo

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the resize event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   resize: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the resize event by type: dialogresize. +
              +
              +
              $( ".selector" ).bind( "dialogresize", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              resizeStop

              +
              +
              Type:
              +
              dialogresizestop
              +
              +
              +
              +

              This event is triggered after the dialog has been resized.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the resizeStop event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   resizeStop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the resizeStop event by type: dialogresizestop. +
              +
              +
              $( ".selector" ).bind( "dialogresizestop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              close

              +
              +
              Type:
              +
              dialogclose
              +
              +
              +
              +

              This event is triggered when the dialog is closed.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the close event as an init option. +
              +
              +
              $( ".selector" ).dialog({
              +   close: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the close event by type: dialogclose. +
              +
              +
              $( ".selector" ).bind( "dialogclose", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .dialog( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the dialog functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .dialog( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the dialog.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .dialog( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the dialog.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .dialog( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any dialog option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .dialog( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple dialog options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .dialog( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-dialog element.

              +
              +
            • + + +
            • +
              +

              close

              +
              +
              Signature:
              +
              .dialog( "close" + + + + + + + +)
              +
              +
              +
              +

              Close the dialog.

              +
              +
            • + + +
            • +
              +

              isOpen

              +
              +
              Signature:
              +
              .dialog( "isOpen" + + + + + + + +)
              +
              +
              +
              +

              Returns true if the dialog is currently open.

              +
              +
            • + + +
            • +
              +

              moveToTop

              +
              +
              Signature:
              +
              .dialog( "moveToTop" + + + + + + + +)
              +
              +
              +
              +

              Move the dialog to the top of the dialogs stack.

              +
              +
            • + + +
            • +
              +

              open

              +
              +
              Signature:
              +
              .dialog( "open" + + + + + + + +)
              +
              +
              +
              +

              Open the dialog.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Dialog plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.dialog.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable">
            +   <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
            +      <span id="ui-dialog-title-dialog" class="ui-dialog-title">Dialog title</span>
            +      <a class="ui-dialog-titlebar-close ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a>
            +   </div>
            +   <div style="height: 200px; min-height: 109px; width: auto;" class="ui-dialog-content ui-widget-content" id="dialog">
            +      <p>Dialog content goes here.</p>
            +   </div>
            +</div>
            +

            + + Note: This is a sample of markup generated by the dialog plugin, not markup you should use to create a dialog. The only markup needed for that is <div></div>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/draggable.html b/static/grappelli_orig/js/ui/development-bundle/docs/draggable.html new file mode 100644 index 00000000..3bfd5123 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/draggable.html @@ -0,0 +1,1577 @@ + + +
            +

            jQuery UI Draggable

            +
            +

            Overview

            +
            +

            The jQuery UI Draggable plugin makes selected elements draggable by mouse.

            +

            Draggable elements gets a class of ui-draggable. During drag the element also gets a class of ui-draggable-dragging. If you want not just drag, but drag-and-drop, see the jQuery UI Droppable plugin, which provides a drop target for draggables.

            +

            All callbacks (start, stop, drag) receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

            +
              +
            • ui.helper - the jQuery object representing the helper that's being dragged
            • +
            • ui.position - current position of the helper as { top, left } object, relative to the offset element
            • +
            • ui.offset - current absolute position of the helper as { top, left } object, relative to page
            • +
            +


            +

            +

            To manipulate the position of a draggable during drag, you can either use a wrapper as the draggable helper and position the wrapped element with absolute positioning, or you can correct internal values like so: $(this).data('draggable').offset.click.top -= x.

            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            • UI Mouse
            • +
            +
            +
            +

            Example

            +
            + +

            +Initialize a draggable with default options.
            +

            +
            $("#draggable").draggable();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <style type="text/css">
            +    #draggable { width: 100px; height: 70px; background: silver; }
            +  </style>
            +  <script>
            +  $(document).ready(function() {
            +    $("#draggable").draggable();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="draggable">Drag me</div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the draggable. Can be set when initialising (first creating) the draggable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the disabled option specified. +
              +
              +
              $( ".selector" ).draggable({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).draggable( "option", "disabled" );
              +//setter
              +$( ".selector" ).draggable( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              addClasses

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If set to false, will prevent the ui-draggable class from being added. This may be desired as a performance optimization when calling .draggable() init on many hundreds of elements.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the addClasses option specified. +
              +
              +
              $( ".selector" ).draggable({ addClasses: false });
              +
              + + +
              + Get or set the addClasses option, after init. +
              +
              +
              //getter
              +var addClasses = $( ".selector" ).draggable( "option", "addClasses" );
              +//setter
              +$( ".selector" ).draggable( "option", "addClasses", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              appendTo

              +
              +
              Type:
              +
              Element, Selector
              + +
              Default:
              +
              "parent"
              + +
              +
              +
              +

              The element passed to or selected by the appendTo option will be used as the draggable helper's container during dragging. By default, the helper is appended to the same container as the draggable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the appendTo option specified. +
              +
              +
              $( ".selector" ).draggable({ appendTo: "body" });
              +
              + + +
              + Get or set the appendTo option, after init. +
              +
              +
              //getter
              +var appendTo = $( ".selector" ).draggable( "option", "appendTo" );
              +//setter
              +$( ".selector" ).draggable( "option", "appendTo", "body" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              axis

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Constrains dragging to either the horizontal (x) or vertical (y) axis. Possible values: 'x', 'y'.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the axis option specified. +
              +
              +
              $( ".selector" ).draggable({ axis: "x" });
              +
              + + +
              + Get or set the axis option, after init. +
              +
              +
              //getter
              +var axis = $( ".selector" ).draggable( "option", "axis" );
              +//setter
              +$( ".selector" ).draggable( "option", "axis", "x" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cancel

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              ":input,option"
              + +
              +
              +
              +

              Prevents dragging from starting on specified elements.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the cancel option specified. +
              +
              +
              $( ".selector" ).draggable({ cancel: "button" });
              +
              + + +
              + Get or set the cancel option, after init. +
              +
              +
              //getter
              +var cancel = $( ".selector" ).draggable( "option", "cancel" );
              +//setter
              +$( ".selector" ).draggable( "option", "cancel", "button" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              connectToSortable

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Allows the draggable to be dropped onto the specified sortables. If this option is used (helper must be set to 'clone' in order to work flawlessly), a draggable can be dropped onto a sortable list and then becomes part of it. +

              Note: Specifying this option as an array of selectors has been removed.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the connectToSortable option specified. +
              +
              +
              $( ".selector" ).draggable({ connectToSortable: "ul#myList" });
              +
              + + +
              + Get or set the connectToSortable option, after init. +
              +
              +
              //getter
              +var connectToSortable = $( ".selector" ).draggable( "option", "connectToSortable" );
              +//setter
              +$( ".selector" ).draggable( "option", "connectToSortable", "ul#myList" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              containment

              +
              +
              Type:
              +
              Selector, Element, String, Array
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Constrains dragging to within the bounds of the specified element or region. Possible string values: 'parent', 'document', 'window', [x1, y1, x2, y2].

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the containment option specified. +
              +
              +
              $( ".selector" ).draggable({ containment: "parent" });
              +
              + + +
              + Get or set the containment option, after init. +
              +
              +
              //getter
              +var containment = $( ".selector" ).draggable( "option", "containment" );
              +//setter
              +$( ".selector" ).draggable( "option", "containment", "parent" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cursor

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "auto"
              + +
              +
              +
              +

              The css cursor during the drag operation.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the cursor option specified. +
              +
              +
              $( ".selector" ).draggable({ cursor: "crosshair" });
              +
              + + +
              + Get or set the cursor option, after init. +
              +
              +
              //getter
              +var cursor = $( ".selector" ).draggable( "option", "cursor" );
              +//setter
              +$( ".selector" ).draggable( "option", "cursor", "crosshair" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cursorAt

              +
              +
              Type:
              +
              Object
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Sets the offset of the dragging helper relative to the mouse cursor. Coordinates can be given as a hash using a combination of one or two keys: { top, left, right, bottom }.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the cursorAt option specified. +
              +
              +
              $( ".selector" ).draggable({ cursorAt: { left: 5 } });
              +
              + + +
              + Get or set the cursorAt option, after init. +
              +
              +
              //getter
              +var cursorAt = $( ".selector" ).draggable( "option", "cursorAt" );
              +//setter
              +$( ".selector" ).draggable( "option", "cursorAt", { left: 5 } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              delay

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Time in milliseconds after mousedown until dragging should start. This option can be used to prevent unwanted drags when clicking on an element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the delay option specified. +
              +
              +
              $( ".selector" ).draggable({ delay: 500 });
              +
              + + +
              + Get or set the delay option, after init. +
              +
              +
              //getter
              +var delay = $( ".selector" ).draggable( "option", "delay" );
              +//setter
              +$( ".selector" ).draggable( "option", "delay", 500 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              distance

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              1
              + +
              +
              +
              +

              Distance in pixels after mousedown the mouse must move before dragging should start. This option can be used to prevent unwanted drags when clicking on an element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the distance option specified. +
              +
              +
              $( ".selector" ).draggable({ distance: 30 });
              +
              + + +
              + Get or set the distance option, after init. +
              +
              +
              //getter
              +var distance = $( ".selector" ).draggable( "option", "distance" );
              +//setter
              +$( ".selector" ).draggable( "option", "distance", 30 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              grid

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Snaps the dragging helper to a grid, every x and y pixels. Array values: [x, y]

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the grid option specified. +
              +
              +
              $( ".selector" ).draggable({ grid: [50, 20] });
              +
              + + +
              + Get or set the grid option, after init. +
              +
              +
              //getter
              +var grid = $( ".selector" ).draggable( "option", "grid" );
              +//setter
              +$( ".selector" ).draggable( "option", "grid", [50, 20] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              handle

              +
              +
              Type:
              +
              Element, Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If specified, restricts drag start click to the specified element(s).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the handle option specified. +
              +
              +
              $( ".selector" ).draggable({ handle: "h2" });
              +
              + + +
              + Get or set the handle option, after init. +
              +
              +
              //getter
              +var handle = $( ".selector" ).draggable( "option", "handle" );
              +//setter
              +$( ".selector" ).draggable( "option", "handle", "h2" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              helper

              +
              +
              Type:
              +
              String, Function
              + +
              Default:
              +
              "original"
              + +
              +
              +
              +

              Allows for a helper element to be used for dragging display. Possible values: 'original', 'clone', Function. If a function is specified, it must return a DOMElement.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the helper option specified. +
              +
              +
              $( ".selector" ).draggable({ helper: "clone" });
              +
              + + +
              + Get or set the helper option, after init. +
              +
              +
              //getter
              +var helper = $( ".selector" ).draggable( "option", "helper" );
              +//setter
              +$( ".selector" ).draggable( "option", "helper", "clone" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              iframeFix

              +
              +
              Type:
              +
              Boolean, Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Prevent iframes from capturing the mousemove events during a drag. Useful in combination with cursorAt, or in any case, if the mouse cursor is not over the helper. If set to true, transparent overlays will be placed over all iframes on the page. If a selector is supplied, the matched iframes will have an overlay placed over them.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the iframeFix option specified. +
              +
              +
              $( ".selector" ).draggable({ iframeFix: true });
              +
              + + +
              + Get or set the iframeFix option, after init. +
              +
              +
              //getter
              +var iframeFix = $( ".selector" ).draggable( "option", "iframeFix" );
              +//setter
              +$( ".selector" ).draggable( "option", "iframeFix", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              opacity

              +
              +
              Type:
              +
              Float
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Opacity for the helper while being dragged.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the opacity option specified. +
              +
              +
              $( ".selector" ).draggable({ opacity: 0.35 });
              +
              + + +
              + Get or set the opacity option, after init. +
              +
              +
              //getter
              +var opacity = $( ".selector" ).draggable( "option", "opacity" );
              +//setter
              +$( ".selector" ).draggable( "option", "opacity", 0.35 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              refreshPositions

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, all droppable positions are calculated on every mousemove. Caution: This solves issues on highly dynamic pages, but dramatically decreases performance.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the refreshPositions option specified. +
              +
              +
              $( ".selector" ).draggable({ refreshPositions: true });
              +
              + + +
              + Get or set the refreshPositions option, after init. +
              +
              +
              //getter
              +var refreshPositions = $( ".selector" ).draggable( "option", "refreshPositions" );
              +//setter
              +$( ".selector" ).draggable( "option", "refreshPositions", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              revert

              +
              +
              Type:
              +
              Boolean, String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, the element will return to its start position when dragging stops. Possible string values: 'valid', 'invalid'. If set to invalid, revert will only occur if the draggable has not been dropped on a droppable. For valid, it's the other way around.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the revert option specified. +
              +
              +
              $( ".selector" ).draggable({ revert: true });
              +
              + + +
              + Get or set the revert option, after init. +
              +
              +
              //getter
              +var revert = $( ".selector" ).draggable( "option", "revert" );
              +//setter
              +$( ".selector" ).draggable( "option", "revert", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              revertDuration

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              500
              + +
              +
              +
              +

              The duration of the revert animation, in milliseconds. Ignored if revert is false.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the revertDuration option specified. +
              +
              +
              $( ".selector" ).draggable({ revertDuration: 1000 });
              +
              + + +
              + Get or set the revertDuration option, after init. +
              +
              +
              //getter
              +var revertDuration = $( ".selector" ).draggable( "option", "revertDuration" );
              +//setter
              +$( ".selector" ).draggable( "option", "revertDuration", 1000 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scope

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "default"
              + +
              +
              +
              +

              Used to group sets of draggable and droppable items, in addition to droppable's accept option. A draggable with the same scope value as a droppable will be accepted by the droppable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the scope option specified. +
              +
              +
              $( ".selector" ).draggable({ scope: "tasks" });
              +
              + + +
              + Get or set the scope option, after init. +
              +
              +
              //getter
              +var scope = $( ".selector" ).draggable( "option", "scope" );
              +//setter
              +$( ".selector" ).draggable( "option", "scope", "tasks" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scroll

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If set to true, container auto-scrolls while dragging.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the scroll option specified. +
              +
              +
              $( ".selector" ).draggable({ scroll: false });
              +
              + + +
              + Get or set the scroll option, after init. +
              +
              +
              //getter
              +var scroll = $( ".selector" ).draggable( "option", "scroll" );
              +//setter
              +$( ".selector" ).draggable( "option", "scroll", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scrollSensitivity

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              20
              + +
              +
              +
              +

              Distance in pixels from the edge of the viewport after which the viewport should scroll. Distance is relative to pointer, not the draggable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the scrollSensitivity option specified. +
              +
              +
              $( ".selector" ).draggable({ scrollSensitivity: 40 });
              +
              + + +
              + Get or set the scrollSensitivity option, after init. +
              +
              +
              //getter
              +var scrollSensitivity = $( ".selector" ).draggable( "option", "scrollSensitivity" );
              +//setter
              +$( ".selector" ).draggable( "option", "scrollSensitivity", 40 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scrollSpeed

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              20
              + +
              +
              +
              +

              The speed at which the window should scroll once the mouse pointer gets within the scrollSensitivity distance.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the scrollSpeed option specified. +
              +
              +
              $( ".selector" ).draggable({ scrollSpeed: 40 });
              +
              + + +
              + Get or set the scrollSpeed option, after init. +
              +
              +
              //getter
              +var scrollSpeed = $( ".selector" ).draggable( "option", "scrollSpeed" );
              +//setter
              +$( ".selector" ).draggable( "option", "scrollSpeed", 40 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              snap

              +
              +
              Type:
              +
              Boolean, Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to a selector or to true (equivalent to '.ui-draggable'), the draggable will snap to the edges of the selected elements when near an edge of the element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the snap option specified. +
              +
              +
              $( ".selector" ).draggable({ snap: true });
              +
              + + +
              + Get or set the snap option, after init. +
              +
              +
              //getter
              +var snap = $( ".selector" ).draggable( "option", "snap" );
              +//setter
              +$( ".selector" ).draggable( "option", "snap", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              snapMode

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "both"
              + +
              +
              +
              +

              Determines which edges of snap elements the draggable will snap to. Ignored if snap is false. Possible values: 'inner', 'outer', 'both'

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the snapMode option specified. +
              +
              +
              $( ".selector" ).draggable({ snapMode: "outer" });
              +
              + + +
              + Get or set the snapMode option, after init. +
              +
              +
              //getter
              +var snapMode = $( ".selector" ).draggable( "option", "snapMode" );
              +//setter
              +$( ".selector" ).draggable( "option", "snapMode", "outer" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              snapTolerance

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              20
              + +
              +
              +
              +

              The distance in pixels from the snap element edges at which snapping should occur. Ignored if snap is false.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the snapTolerance option specified. +
              +
              +
              $( ".selector" ).draggable({ snapTolerance: 40 });
              +
              + + +
              + Get or set the snapTolerance option, after init. +
              +
              +
              //getter
              +var snapTolerance = $( ".selector" ).draggable( "option", "snapTolerance" );
              +//setter
              +$( ".selector" ).draggable( "option", "snapTolerance", 40 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              stack

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Controls the z-Index of the set of elements that match the selector, always brings to front the dragged item. Very useful in things like window managers.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the stack option specified. +
              +
              +
              $( ".selector" ).draggable({ stack: ".products" });
              +
              + + +
              + Get or set the stack option, after init. +
              +
              +
              //getter
              +var stack = $( ".selector" ).draggable( "option", "stack" );
              +//setter
              +$( ".selector" ).draggable( "option", "stack", ".products" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              zIndex

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              z-index for the helper while being dragged.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a draggable with the zIndex option specified. +
              +
              +
              $( ".selector" ).draggable({ zIndex: 2700 });
              +
              + + +
              + Get or set the zIndex option, after init. +
              +
              +
              //getter
              +var zIndex = $( ".selector" ).draggable( "option", "zIndex" );
              +//setter
              +$( ".selector" ).draggable( "option", "zIndex", 2700 );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              dragcreate
              +
              +
              +
              +

              This event is triggered when draggable is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).draggable({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: dragcreate. +
              +
              +
              $( ".selector" ).bind( "dragcreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              start

              +
              +
              Type:
              +
              dragstart
              +
              +
              +
              +

              This event is triggered when dragging starts.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the start event as an init option. +
              +
              +
              $( ".selector" ).draggable({
              +   start: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the start event by type: dragstart. +
              +
              +
              $( ".selector" ).bind( "dragstart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              drag

              +
              +
              Type:
              +
              drag
              +
              +
              +
              +

              This event is triggered when the mouse is moved during the dragging.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the drag event as an init option. +
              +
              +
              $( ".selector" ).draggable({
              +   drag: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the drag event by type: drag. +
              +
              +
              $( ".selector" ).bind( "drag", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              stop

              +
              +
              Type:
              +
              dragstop
              +
              +
              +
              +

              This event is triggered when dragging stops.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the stop event as an init option. +
              +
              +
              $( ".selector" ).draggable({
              +   stop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the stop event by type: dragstop. +
              +
              +
              $( ".selector" ).bind( "dragstop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .draggable( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the draggable functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .draggable( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the draggable.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .draggable( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the draggable.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .draggable( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any draggable option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .draggable( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple draggable options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .draggable( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-draggable element.

              +
              +
            • + + +
            +
            +
            +

            Theming

            +

            The jQuery UI Draggable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.draggable.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-draggable"></div> +

            + + Note: This is a sample of markup generated by the draggable plugin, not markup you should use to create a draggable. The only markup needed for that is <div></div>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/droppable.html b/static/grappelli_orig/js/ui/development-bundle/docs/droppable.html new file mode 100644 index 00000000..881ce4f7 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/droppable.html @@ -0,0 +1,829 @@ + + +
            +

            jQuery UI Droppable

            +
            +

            Overview

            +
            +

            The jQuery UI Droppable plugin makes selected elements droppable (meaning they accept being dropped on by draggables). You can specify which (individually) or which kind of draggables each will accept.

            +

            All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

            +
              +
            • ui.draggable - current draggable element, a jQuery object.
            • +
            • ui.helper - current draggable helper, a jQuery object
            • +
            • ui.position - current position of the draggable helper { top: , left: }
            • +
            • ui.offset - current absolute position of the draggable helper { top: , left: }
            • +
            +
            +
            +

            Dependencies

            + +
            +
            +

            Example

            +
            + +

            +Makes the div droppable (a drop target for a draggable).
            +

            +
            $("#draggable").draggable();
            +    $("#droppable").droppable({
            +      drop: function() { alert('dropped'); }
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <style type="text/css">
            +    #draggable { width: 75px; height: 25px; background: silver; padding: 10px; }
            +    #droppable { position: absolute; left: 250px; top: 0; width: 125px; height: 75px; background: gray; color: white; padding: 10px; }
            +  </style>
            +  <script>
            +  $(document).ready(function() {
            +    $("#draggable").draggable();
            +    $("#droppable").droppable({
            +      drop: function() { alert('dropped'); }
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="droppable">Drop here</div>
            +<div id="draggable">Drag me</div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the droppable. Can be set when initialising (first creating) the droppable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the disabled option specified. +
              +
              +
              $( ".selector" ).droppable({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).droppable( "option", "disabled" );
              +//setter
              +$( ".selector" ).droppable( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              accept

              +
              +
              Type:
              +
              Selector, Function
              + +
              Default:
              +
              "*"
              + +
              +
              +
              +

              All draggables that match the selector will be accepted. If a function is specified, the function will be called for each draggable on the page (passed as the first argument to the function), to provide a custom filter. The function should return true if the draggable should be accepted.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the accept option specified. +
              +
              +
              $( ".selector" ).droppable({ accept: ".special" });
              +
              + + +
              + Get or set the accept option, after init. +
              +
              +
              //getter
              +var accept = $( ".selector" ).droppable( "option", "accept" );
              +//setter
              +$( ".selector" ).droppable( "option", "accept", ".special" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              activeClass

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If specified, the class will be added to the droppable while an acceptable draggable is being dragged.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the activeClass option specified. +
              +
              +
              $( ".selector" ).droppable({ activeClass: "ui-state-highlight" });
              +
              + + +
              + Get or set the activeClass option, after init. +
              +
              +
              //getter
              +var activeClass = $( ".selector" ).droppable( "option", "activeClass" );
              +//setter
              +$( ".selector" ).droppable( "option", "activeClass", "ui-state-highlight" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              addClasses

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If set to false, will prevent the ui-droppable class from being added. This may be desired as a performance optimization when calling .droppable() init on many hundreds of elements.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the addClasses option specified. +
              +
              +
              $( ".selector" ).droppable({ addClasses: false });
              +
              + + +
              + Get or set the addClasses option, after init. +
              +
              +
              //getter
              +var addClasses = $( ".selector" ).droppable( "option", "addClasses" );
              +//setter
              +$( ".selector" ).droppable( "option", "addClasses", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              greedy

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If true, will prevent event propagation on nested droppables.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the greedy option specified. +
              +
              +
              $( ".selector" ).droppable({ greedy: true });
              +
              + + +
              + Get or set the greedy option, after init. +
              +
              +
              //getter
              +var greedy = $( ".selector" ).droppable( "option", "greedy" );
              +//setter
              +$( ".selector" ).droppable( "option", "greedy", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              hoverClass

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If specified, the class will be added to the droppable while an acceptable draggable is being hovered.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the hoverClass option specified. +
              +
              +
              $( ".selector" ).droppable({ hoverClass: "drophover" });
              +
              + + +
              + Get or set the hoverClass option, after init. +
              +
              +
              //getter
              +var hoverClass = $( ".selector" ).droppable( "option", "hoverClass" );
              +//setter
              +$( ".selector" ).droppable( "option", "hoverClass", "drophover" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scope

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "default"
              + +
              +
              +
              +

              Used to group sets of draggable and droppable items, in addition to droppable's accept option. A draggable with the same scope value as a droppable will be accepted.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the scope option specified. +
              +
              +
              $( ".selector" ).droppable({ scope: "tasks" });
              +
              + + +
              + Get or set the scope option, after init. +
              +
              +
              //getter
              +var scope = $( ".selector" ).droppable( "option", "scope" );
              +//setter
              +$( ".selector" ).droppable( "option", "scope", "tasks" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              tolerance

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "intersect"
              + +
              +
              +
              +

              Specifies which mode to use for testing whether a draggable is 'over' a droppable. Possible values: 'fit', 'intersect', 'pointer', 'touch'. +

              +
                +
              • fit: draggable overlaps the droppable entirely
              • +
              • intersect: draggable overlaps the droppable at least 50%
              • +
              • pointer: mouse pointer overlaps the droppable
              • +
              • touch: draggable overlaps the droppable any amount
              • +
              +

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a droppable with the tolerance option specified. +
              +
              +
              $( ".selector" ).droppable({ tolerance: "fit" });
              +
              + + +
              + Get or set the tolerance option, after init. +
              +
              +
              //getter
              +var tolerance = $( ".selector" ).droppable( "option", "tolerance" );
              +//setter
              +$( ".selector" ).droppable( "option", "tolerance", "fit" );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              dropcreate
              +
              +
              +
              +

              This event is triggered when droppable is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).droppable({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: dropcreate. +
              +
              +
              $( ".selector" ).bind( "dropcreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              activate

              +
              +
              Type:
              +
              dropactivate
              +
              +
              +
              +

              This event is triggered any time an accepted draggable starts dragging. This can be useful if you want to make the droppable 'light up' when it can be dropped on.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the activate event as an init option. +
              +
              +
              $( ".selector" ).droppable({
              +   activate: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the activate event by type: dropactivate. +
              +
              +
              $( ".selector" ).bind( "dropactivate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              deactivate

              +
              +
              Type:
              +
              dropdeactivate
              +
              +
              +
              +

              This event is triggered any time an accepted draggable stops dragging.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the deactivate event as an init option. +
              +
              +
              $( ".selector" ).droppable({
              +   deactivate: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the deactivate event by type: dropdeactivate. +
              +
              +
              $( ".selector" ).bind( "dropdeactivate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              over

              +
              +
              Type:
              +
              dropover
              +
              +
              +
              +

              This event is triggered as an accepted draggable is dragged 'over' (within the tolerance of) this droppable.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the over event as an init option. +
              +
              +
              $( ".selector" ).droppable({
              +   over: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the over event by type: dropover. +
              +
              +
              $( ".selector" ).bind( "dropover", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              out

              +
              +
              Type:
              +
              dropout
              +
              +
              +
              +

              This event is triggered when an accepted draggable is dragged out (within the tolerance of) this droppable.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the out event as an init option. +
              +
              +
              $( ".selector" ).droppable({
              +   out: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the out event by type: dropout. +
              +
              +
              $( ".selector" ).bind( "dropout", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              drop

              +
              +
              Type:
              +
              drop
              +
              +
              +
              +

              This event is triggered when an accepted draggable is dropped 'over' (within the tolerance of) this droppable. In the callback, $(this) represents the droppable the draggable is dropped on. +ui.draggable represents the draggable.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the drop event as an init option. +
              +
              +
              $( ".selector" ).droppable({
              +   drop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the drop event by type: drop. +
              +
              +
              $( ".selector" ).bind( "drop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .droppable( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the droppable functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .droppable( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the droppable.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .droppable( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the droppable.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .droppable( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any droppable option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .droppable( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple droppable options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .droppable( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-droppable element.

              +
              +
            • + + +
            +
            +
            +

            Theming

            +

            The jQuery UI Droppable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.droppable.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-droppable"></div> +

            + + Note: This is a sample of markup generated by the droppable plugin, not markup you should use to create a droppable. The only markup needed for that is <div></div>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/effect.html b/static/grappelli_orig/js/ui/development-bundle/docs/effect.html new file mode 100644 index 00000000..415cf675 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/effect.html @@ -0,0 +1,143 @@ + + +
            +

            jQuery UI effect

            +
            +

            Overview

            +
            +

            effect( effect, [options], [speed], [callback] )

            +

            Uses a specific effect on an element (without the show/hide logic).

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Apply the effect explode if you click on the element.
            +

            +
            $("p").click(function () {
            +      $("div").effect("explode");
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<script src="http://ui.jquery.com/latest/ui/effects.explode.js"></script>
            +<style type="text/css">
            +  div { margin: 0 auto; width: 100px; height: 80px; background: blue; position: relative; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $("div").effect("explode");
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<p>Click me</p><div></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              effect

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              The effect to be used. Possible values: 'blind', 'bounce', 'clip', 'drop', 'explode', 'fold', 'highlight', 'puff', 'pulsate', 'scale', 'shake', 'size', 'slide', 'transfer'.

              +
              +
            • + + +
            • +
              +

              options

              +
              +
              Type:
              +
              Hash
              + +
              Optional
              + +
              +
              +
              +

              A object/hash including specific options for the effect.

              +
              +
            • + + +
            • +
              +

              speed

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + + +
            • +
              +

              callback

              +
              +
              Type:
              +
              Function
              + +
              Optional
              + +
              +
              +
              +

              A function that is called after the effect is completed.

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/hide.html b/static/grappelli_orig/js/ui/development-bundle/docs/hide.html new file mode 100644 index 00000000..0da10bd2 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/hide.html @@ -0,0 +1,144 @@ + + +
            +

            jQuery UI hide

            +
            +

            Overview

            +
            +

            hide( effect, [options], [speed], [callback] )

            +

            The enhanced hide method optionally accepts jQuery UI advanced effects.

            +

            Uses a specific effect on an element to hide the element if the first argument is an effect string.

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Apply the effect slide if you click on the p to hide a div.
            +

            +
            $("p").click(function () {
            +      $("div").hide("slide", {}, 1000);
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<script src="http://ui.jquery.com/latest/ui/effects.slide.js"></script>
            +<style type="text/css">
            +  div { margin: 0px; width: 100px; height: 80px; background: blue; position: relative; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $("div").hide("slide", {}, 1000);
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<p>Click me</p><div></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              effect

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              The effect to be used. Possible values: 'blind', 'clip', 'drop', 'explode', 'fold', 'puff', 'slide', 'scale', 'size', 'pulsate'.

              +
              +
            • + + +
            • +
              +

              options

              +
              +
              Type:
              +
              Hash
              + +
              Optional
              + +
              +
              +
              +

              A object/hash including specific options for the effect.

              +
              +
            • + + +
            • +
              +

              speed

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the predefined speeds ("slow" or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + + +
            • +
              +

              callback

              +
              +
              Type:
              +
              Function
              + +
              Optional
              + +
              +
              +
              +

              A function that is called after the effect is completed.

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/position.html b/static/grappelli_orig/js/ui/development-bundle/docs/position.html new file mode 100644 index 00000000..7f67a3fa --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/position.html @@ -0,0 +1,245 @@ + + +
            +

            jQuery UI Position Utility

            +
            +

            Overview

            +
            +

            Utility script for positioning any widget relative to the window, document, a particular element, or the cursor/mouse.

            +

            Note: jQuery UI does not support positioning hidden elements.

            +

            Does not need ui.core.js or effects.core.js.

            +
            +
            +

            Dependencies

            +
              +
            • none (only jQuery core)
            • +
            +
            +
            +

            Example

            +
            + +

            +Clicking on the green element transfers to the other.
            +

            +
            +$("#position1").position({
            +  my: "center",
            +  at: "center",
            +  of: "#targetElement"
            +});
            +$("#position2").position({
            +  my: "left top",
            +  at: "left top",
            +  of: "#targetElement"
            +});
            +$("#position3").position({
            +  my: "right center",
            +  at: "right bottom",
            +  of: "#targetElement"
            +});
            +$(document).mousemove(function(ev){
            +  $("#position4").position({
            +    my: "left bottom",
            +    of: ev,
            +    offset: "3 -3",
            +    collision: "fit"
            +  });
            +});
            +
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <style type="text/css">
            +#targetElement { width:240px;height:200px;background-color:#999;margin:30px auto; }
            +.positionDiv { width:50px;height:50px;opacity:0.6; }
            +#position1 {background-color:#F00;}
            +#position2 {background-color:#0F0;}
            +#position3 {background-color:#00F;}
            +#position4 {background-color:#FF0;}
            +</style>
            +
            +  <script>
            +  $(document).ready(function() {
            +    
            +$("#position1").position({
            +  my: "center",
            +  at: "center",
            +  of: "#targetElement"
            +});
            +$("#position2").position({
            +  my: "left top",
            +  at: "left top",
            +  of: "#targetElement"
            +});
            +$("#position3").position({
            +  my: "right center",
            +  at: "right bottom",
            +  of: "#targetElement"
            +});
            +$(document).mousemove(function(ev){
            +  $("#position4").position({
            +    my: "left bottom",
            +    of: ev,
            +    offset: "3 -3",
            +    collision: "fit"
            +  });
            +});
            +
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="targetElement">
            +  <div class="positionDiv" id="position1"></div>
            +  <div class="positionDiv" id="position2"></div>
            +  <div class="positionDiv" id="position3"></div>
            +  <div class="positionDiv" id="position4"></div>
            +</div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              my

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "center"
              + +
              +
              +
              +

              Defines which position on the element being positioned to align with the target element: "horizontal vertical" alignment. A single value such as "right" will default to "right center", "top" will default to "center top" (following CSS convention). Acceptable values: "top", "center", "bottom", "left", "right". Example: "left top" or "center center"

              +
              +
            • + + +
            • +
              +

              at

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "center"
              + +
              +
              +
              +

              Defines which position on the target element to align the positioned element against: "horizontal vertical" alignment. A single value such as "right" will default to "right center", "top" will default to "center top" (following CSS convention). Acceptable values: "top", "center", "bottom", "left", "right". Example: "left top" or "center center"

              +
              +
            • + + +
            • +
              +

              of

              +
              +
              Type:
              +
              Selector, Element, jQuery, Event
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              Element to position against. If you provide a selector, the first matching element will be used. If you provide a jQuery object, the first element will be used. If you provide an event object, the pageX and pageY properties will be used. Example: "#top-menu"

              +
              +
            • + + +
            • +
              +

              offset

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              Add these left-top values to the calculated position, eg. "50 50" (left top) A single value such as "50" will apply to both.

              +
              +
            • + + +
            • +
              +

              collision

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "flip"
              + +
              +
              +
              +

              When the positioned element overflows the window in some direction, move it to an alternative position. Similar to my and at, this accepts a single value or a pair for horizontal/vertical, eg. "flip", "fit", "fit flip", "fit none". +

              +
              • flip: to the opposite side and the collision detection is run again to see if it will fit. Whichever side allows more of the element to be visible will be used. +
              • fit: so the element keeps in the desired direction, but is re-positioned so it fits. +
              • none: not do collision detection. +
              +

              +
              +
            • + + +
            • +
              +

              using

              +
              +
              Type:
              +
              Function
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              When specified the actual property setting is delegated to this callback. Receives a single parameter which is a hash of top and left values for the position that should be set.

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/progressbar.html b/static/grappelli_orig/js/ui/development-bundle/docs/progressbar.html new file mode 100644 index 00000000..bab31c9a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/progressbar.html @@ -0,0 +1,460 @@ + + +
            +

            jQuery UI Progressbar

            +
            +

            Overview

            +
            +

            +The progress bar is designed to simply display the current % complete for a process. The bar is coded to be flexibly sized through CSS and will scale to fit inside it's parent container by default. +

            +

            +This is a determinate progress bar, meaning that it should only be used in situations where the system can accurately update the current status complete. A determinate progress bar should never fill from left to right, then loop back to empty for a single process -- if the actual percent complete status cannot be calculated, an indeterminate progress bar (coming soon) or spinner animation is a better way to provide user feedback. +

            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Progressbar.
            +

            +
            $("#progressbar").progressbar({ value: 37 });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("#progressbar").progressbar({ value: 37 });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="progressbar"></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the progressbar. Can be set when initialising (first creating) the progressbar.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a progressbar with the disabled option specified. +
              +
              +
              $( ".selector" ).progressbar({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).progressbar( "option", "disabled" );
              +//setter
              +$( ".selector" ).progressbar( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              value

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              The value of the progressbar.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a progressbar with the value option specified. +
              +
              +
              $( ".selector" ).progressbar({ value: 37 });
              +
              + + +
              + Get or set the value option, after init. +
              +
              +
              //getter
              +var value = $( ".selector" ).progressbar( "option", "value" );
              +//setter
              +$( ".selector" ).progressbar( "option", "value", 37 );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              progressbarcreate
              +
              +
              +
              +

              This event is triggered when progressbar is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).progressbar({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: progressbarcreate. +
              +
              +
              $( ".selector" ).bind( "progressbarcreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              change

              +
              +
              Type:
              +
              progressbarchange
              +
              +
              +
              +

              This event is triggered when the value of the progressbar changes.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the change event as an init option. +
              +
              +
              $( ".selector" ).progressbar({
              +   change: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the change event by type: progressbarchange. +
              +
              +
              $( ".selector" ).bind( "progressbarchange", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              complete

              +
              +
              Type:
              +
              progressbarcomplete
              +
              +
              +
              +

              This event is triggered when the value of the progressbar reaches the maximum value of 100.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the complete event as an init option. +
              +
              +
              $( ".selector" ).progressbar({
              +   complete: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the complete event by type: progressbarcomplete. +
              +
              +
              $( ".selector" ).bind( "progressbarcomplete", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .progressbar( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the progressbar functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .progressbar( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the progressbar.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .progressbar( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the progressbar.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .progressbar( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any progressbar option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .progressbar( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple progressbar options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .progressbar( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-progressbar element.

              +
              +
            • + + +
            • +
              +

              value

              +
              +
              Signature:
              +
              .progressbar( "value" + +, [value] + + + + + +)
              +
              +
              +
              +

              This method gets or sets the current value of the progressbar.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Progressbar plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.progressbar.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-progressbar ui-widget ui-widget-content ui-corner-all">
            +    <div style="width: 37%;" class="ui-progressbar-value ui-widget-header ui-corner-left"></div>
            + </div> +

            + + Note: This is a sample of markup generated by the progressbar plugin, not markup you should use to create a progressbar. The only markup needed for that is <div></div>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/removeClass.html b/static/grappelli_orig/js/ui/development-bundle/docs/removeClass.html new file mode 100644 index 00000000..d2182574 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/removeClass.html @@ -0,0 +1,113 @@ + + +
            +

            jQuery UI removeClass

            +
            +

            Overview

            +
            +

            removeClass( [class], [duration] )

            +

            Removes all or specified class from each of the set of matched elements with an optional transition between the states.

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Removes the class 'selected' from the matched elements with a one second transition.
            +

            +
            $("p").click(function () {
            +      $(this).removeClass("selected", 1000);
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<style type="text/css">
            +  p { cursor: pointer; font-size: 1.2em; }
            +  .selected { color:red; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $(this).removeClass("selected", 1000);
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<p class="selected">Click me to remove 'selected' class.</p>
            +<p class="selected">Click me to remove 'selected' class.</p>
            +<p class="selected">Click me to remove 'selected' class.</p>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              class

              +
              +
              Type:
              +
              String
              + +
              Optional
              + +
              +
              +
              +

              CSS classes to remove from the elements.

              +
              +
            • + + +
            • +
              +

              duration

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/resizable.html b/static/grappelli_orig/js/ui/development-bundle/docs/resizable.html new file mode 100644 index 00000000..a9b58a62 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/resizable.html @@ -0,0 +1,1201 @@ + + +
            +

            jQuery UI Resizable

            +
            +

            Overview

            +
            +

            The jQuery UI Resizable plugin makes selected elements resizable (meaning they have draggable resize handles). You can specify one or more handles as well as min and max width and height.

            +

            All callbacks (start,stop,resize) receive two arguments: The original browser event and a prepared ui object. The ui object has the following fields:

            +
              +
            • ui.helper - a jQuery object containing the helper element
            • +
            • ui.originalPosition - {top, left} before resizing started
            • +
            • ui.originalSize - {width, height} before resizing started
            • +
            • ui.position - {top, left} current position
            • +
            • ui.size - {width, height} current size
            • +
            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            • UI Mouse
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Resizable.
            +

            +
            $("#resizable").resizable();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <style type="text/css">
            +    #resizable { width: 100px; height: 100px; background: silver; }
            +  </style>
            +  <script>
            +  $(document).ready(function() {
            +    $("#resizable").resizable();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="resizable"></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the resizable. Can be set when initialising (first creating) the resizable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the disabled option specified. +
              +
              +
              $( ".selector" ).resizable({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).resizable( "option", "disabled" );
              +//setter
              +$( ".selector" ).resizable( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              alsoResize

              +
              +
              Type:
              +
              Selector, jQuery, Element
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Resize these elements synchronous when resizing.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the alsoResize option specified. +
              +
              +
              $( ".selector" ).resizable({ alsoResize: ".other" });
              +
              + + +
              + Get or set the alsoResize option, after init. +
              +
              +
              //getter
              +var alsoResize = $( ".selector" ).resizable( "option", "alsoResize" );
              +//setter
              +$( ".selector" ).resizable( "option", "alsoResize", ".other" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              animate

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Animates to the final size after resizing.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the animate option specified. +
              +
              +
              $( ".selector" ).resizable({ animate: true });
              +
              + + +
              + Get or set the animate option, after init. +
              +
              +
              //getter
              +var animate = $( ".selector" ).resizable( "option", "animate" );
              +//setter
              +$( ".selector" ).resizable( "option", "animate", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              animateDuration

              +
              +
              Type:
              +
              Integer, String
              + +
              Default:
              +
              "slow"
              + +
              +
              +
              +

              Duration time for animating, in milliseconds. Other possible values: 'slow', 'normal', 'fast'.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the animateDuration option specified. +
              +
              +
              $( ".selector" ).resizable({ animateDuration: 500 });
              +
              + + +
              + Get or set the animateDuration option, after init. +
              +
              +
              //getter
              +var animateDuration = $( ".selector" ).resizable( "option", "animateDuration" );
              +//setter
              +$( ".selector" ).resizable( "option", "animateDuration", 500 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              animateEasing

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "swing"
              + +
              +
              +
              +

              Easing effect for animating.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the animateEasing option specified. +
              +
              +
              $( ".selector" ).resizable({ animateEasing: "swing" });
              +
              + + +
              + Get or set the animateEasing option, after init. +
              +
              +
              //getter
              +var animateEasing = $( ".selector" ).resizable( "option", "animateEasing" );
              +//setter
              +$( ".selector" ).resizable( "option", "animateEasing", "swing" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              aspectRatio

              +
              +
              Type:
              +
              Boolean, Float
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, resizing is constrained by the original aspect ratio. Otherwise a custom aspect ratio can be specified, such as 9 / 16, or 0.5.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the aspectRatio option specified. +
              +
              +
              $( ".selector" ).resizable({ aspectRatio: .75 });
              +
              + + +
              + Get or set the aspectRatio option, after init. +
              +
              +
              //getter
              +var aspectRatio = $( ".selector" ).resizable( "option", "aspectRatio" );
              +//setter
              +$( ".selector" ).resizable( "option", "aspectRatio", .75 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              autoHide

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, automatically hides the handles except when the mouse hovers over the element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the autoHide option specified. +
              +
              +
              $( ".selector" ).resizable({ autoHide: true });
              +
              + + +
              + Get or set the autoHide option, after init. +
              +
              +
              //getter
              +var autoHide = $( ".selector" ).resizable( "option", "autoHide" );
              +//setter
              +$( ".selector" ).resizable( "option", "autoHide", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cancel

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              ":input,option"
              + +
              +
              +
              +

              Prevents resizing if you start on elements matching the selector.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the cancel option specified. +
              +
              +
              $( ".selector" ).resizable({ cancel: ":input,option" });
              +
              + + +
              + Get or set the cancel option, after init. +
              +
              +
              //getter
              +var cancel = $( ".selector" ).resizable( "option", "cancel" );
              +//setter
              +$( ".selector" ).resizable( "option", "cancel", ":input,option" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              containment

              +
              +
              Type:
              +
              String, Element, Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Constrains resizing to within the bounds of the specified element. Possible values: 'parent', 'document', a DOMElement, or a Selector.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the containment option specified. +
              +
              +
              $( ".selector" ).resizable({ containment: "parent" });
              +
              + + +
              + Get or set the containment option, after init. +
              +
              +
              //getter
              +var containment = $( ".selector" ).resizable( "option", "containment" );
              +//setter
              +$( ".selector" ).resizable( "option", "containment", "parent" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              delay

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Tolerance, in milliseconds, for when resizing should start. If specified, resizing will not start until after mouse is moved beyond duration. This can help prevent unintended resizing when clicking on an element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the delay option specified. +
              +
              +
              $( ".selector" ).resizable({ delay: 20 });
              +
              + + +
              + Get or set the delay option, after init. +
              +
              +
              //getter
              +var delay = $( ".selector" ).resizable( "option", "delay" );
              +//setter
              +$( ".selector" ).resizable( "option", "delay", 20 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              distance

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              1
              + +
              +
              +
              +

              Tolerance, in pixels, for when resizing should start. If specified, resizing will not start until after mouse is moved beyond distance. This can help prevent unintended resizing when clicking on an element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the distance option specified. +
              +
              +
              $( ".selector" ).resizable({ distance: 20 });
              +
              + + +
              + Get or set the distance option, after init. +
              +
              +
              //getter
              +var distance = $( ".selector" ).resizable( "option", "distance" );
              +//setter
              +$( ".selector" ).resizable( "option", "distance", 20 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              ghost

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, a semi-transparent helper element is shown for resizing.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the ghost option specified. +
              +
              +
              $( ".selector" ).resizable({ ghost: true });
              +
              + + +
              + Get or set the ghost option, after init. +
              +
              +
              //getter
              +var ghost = $( ".selector" ).resizable( "option", "ghost" );
              +//setter
              +$( ".selector" ).resizable( "option", "ghost", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              grid

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Snaps the resizing element to a grid, every x and y pixels. Array values: [x, y]

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the grid option specified. +
              +
              +
              $( ".selector" ).resizable({ grid: [50, 50] });
              +
              + + +
              + Get or set the grid option, after init. +
              +
              +
              //getter
              +var grid = $( ".selector" ).resizable( "option", "grid" );
              +//setter
              +$( ".selector" ).resizable( "option", "grid", [50, 50] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              handles

              +
              +
              Type:
              +
              String, Object
              + +
              Default:
              +
              "e, s, se"
              + +
              +
              +
              +

              If specified as a string, should be a comma-split list of any of the following: 'n, e, s, w, ne, se, sw, nw, all'. The necessary handles will be auto-generated by the plugin. +

              If specified as an object, the following keys are supported: { n, e, s, w, ne, se, sw, nw }. The value of any specified should be a jQuery selector matching the child element of the resizable to use as that handle. If the handle is not a child of the resizable, you can pass in the DOMElement or a valid jQuery object directly.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the handles option specified. +
              +
              +
              $( ".selector" ).resizable({ handles: "n, e, s, w" });
              +
              + + +
              + Get or set the handles option, after init. +
              +
              +
              //getter
              +var handles = $( ".selector" ).resizable( "option", "handles" );
              +//setter
              +$( ".selector" ).resizable( "option", "handles", "n, e, s, w" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              helper

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              This is the css class that will be added to a proxy element to outline the resize during the drag of the resize handle. Once the resize is complete, the original element is sized.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the helper option specified. +
              +
              +
              $( ".selector" ).resizable({ helper: "ui-state-highlight" });
              +
              + + +
              + Get or set the helper option, after init. +
              +
              +
              //getter
              +var helper = $( ".selector" ).resizable( "option", "helper" );
              +//setter
              +$( ".selector" ).resizable( "option", "helper", "ui-state-highlight" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              maxHeight

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              This is the maximum height the resizable should be allowed to resize to.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the maxHeight option specified. +
              +
              +
              $( ".selector" ).resizable({ maxHeight: 300 });
              +
              + + +
              + Get or set the maxHeight option, after init. +
              +
              +
              //getter
              +var maxHeight = $( ".selector" ).resizable( "option", "maxHeight" );
              +//setter
              +$( ".selector" ).resizable( "option", "maxHeight", 300 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              maxWidth

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              This is the maximum width the resizable should be allowed to resize to.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the maxWidth option specified. +
              +
              +
              $( ".selector" ).resizable({ maxWidth: 250 });
              +
              + + +
              + Get or set the maxWidth option, after init. +
              +
              +
              //getter
              +var maxWidth = $( ".selector" ).resizable( "option", "maxWidth" );
              +//setter
              +$( ".selector" ).resizable( "option", "maxWidth", 250 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              minHeight

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              10
              + +
              +
              +
              +

              This is the minimum height the resizable should be allowed to resize to.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the minHeight option specified. +
              +
              +
              $( ".selector" ).resizable({ minHeight: 150 });
              +
              + + +
              + Get or set the minHeight option, after init. +
              +
              +
              //getter
              +var minHeight = $( ".selector" ).resizable( "option", "minHeight" );
              +//setter
              +$( ".selector" ).resizable( "option", "minHeight", 150 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              minWidth

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              10
              + +
              +
              +
              +

              This is the minimum width the resizable should be allowed to resize to.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a resizable with the minWidth option specified. +
              +
              +
              $( ".selector" ).resizable({ minWidth: 75 });
              +
              + + +
              + Get or set the minWidth option, after init. +
              +
              +
              //getter
              +var minWidth = $( ".selector" ).resizable( "option", "minWidth" );
              +//setter
              +$( ".selector" ).resizable( "option", "minWidth", 75 );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              resizecreate
              +
              +
              +
              +

              This event is triggered when resizable is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).resizable({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: resizecreate. +
              +
              +
              $( ".selector" ).bind( "resizecreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              start

              +
              +
              Type:
              +
              resizestart
              +
              +
              +
              +

              This event is triggered at the start of a resize operation.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the start event as an init option. +
              +
              +
              $( ".selector" ).resizable({
              +   start: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the start event by type: resizestart. +
              +
              +
              $( ".selector" ).bind( "resizestart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              resize

              +
              +
              Type:
              +
              resize
              +
              +
              +
              +

              This event is triggered during the resize, on the drag of the resize handler.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the resize event as an init option. +
              +
              +
              $( ".selector" ).resizable({
              +   resize: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the resize event by type: resize. +
              +
              +
              $( ".selector" ).bind( "resize", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              stop

              +
              +
              Type:
              +
              resizestop
              +
              +
              +
              +

              This event is triggered at the end of a resize operation.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the stop event as an init option. +
              +
              +
              $( ".selector" ).resizable({
              +   stop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the stop event by type: resizestop. +
              +
              +
              $( ".selector" ).bind( "resizestop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .resizable( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the resizable functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .resizable( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the resizable.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .resizable( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the resizable.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .resizable( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any resizable option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .resizable( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple resizable options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .resizable( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-resizable element.

              +
              +
            • + + +
            +
            +
            +

            Theming

            +

            The jQuery UI Resizable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.resizable.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-resizable">
            +   <div style="-moz-user-select: none;" unselectable="on" class="ui-resizable-handle ui-resizable-e"></div>
            +   <div style="-moz-user-select: none;" unselectable="on" class="ui-resizable-handle ui-resizable-s"></div>
            +   <div unselectable="on" style="z-index: 1001; -moz-user-select: none;" class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"></div>
            +</div> +

            + + Note: This is a sample of markup generated by the resizable plugin, not markup you should use to create a resizable. The only markup needed for that is <div></div>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/selectable.html b/static/grappelli_orig/js/ui/development-bundle/docs/selectable.html new file mode 100644 index 00000000..c0466d84 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/selectable.html @@ -0,0 +1,848 @@ + + +
            +

            jQuery UI Selectable

            +
            +

            Overview

            +
            +

            The jQuery UI Selectable plugin allows for elements to be selected by dragging a box (sometimes called a lasso) with the mouse over the elements. Also, elements can be selected by click or drag while holding the Ctrl/Meta key, allowing for multiple (non-contiguous) selections.

            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            • UI Mouse
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Selectable.
            +

            +
            $("#selectable").selectable();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <style type="text/css">
            +#selectable .ui-selecting {
            +	background: silver;
            +}
            +#selectable .ui-selected {
            +	background: gray;
            +}
            +</style>
            +
            +  <script>
            +  $(document).ready(function() {
            +    $("#selectable").selectable();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<ul id="selectable">
            +<li>Item 1</li>
            +<li>Item 2</li>
            +<li>Item 3</li>
            +<li>Item 4</li>
            +<li>Item 5</li>
            +</ul>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the selectable. Can be set when initialising (first creating) the selectable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a selectable with the disabled option specified. +
              +
              +
              $( ".selector" ).selectable({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).selectable( "option", "disabled" );
              +//setter
              +$( ".selector" ).selectable( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              autoRefresh

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              This determines whether to refresh (recalculate) the position and size of each selectee at the beginning of each select operation. If you have many many items, you may want to set this to false and call the refresh method manually.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a selectable with the autoRefresh option specified. +
              +
              +
              $( ".selector" ).selectable({ autoRefresh: false });
              +
              + + +
              + Get or set the autoRefresh option, after init. +
              +
              +
              //getter
              +var autoRefresh = $( ".selector" ).selectable( "option", "autoRefresh" );
              +//setter
              +$( ".selector" ).selectable( "option", "autoRefresh", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cancel

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              ":input,option"
              + +
              +
              +
              +

              Prevents selecting if you start on elements matching the selector.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a selectable with the cancel option specified. +
              +
              +
              $( ".selector" ).selectable({ cancel: ":input,option" });
              +
              + + +
              + Get or set the cancel option, after init. +
              +
              +
              //getter
              +var cancel = $( ".selector" ).selectable( "option", "cancel" );
              +//setter
              +$( ".selector" ).selectable( "option", "cancel", ":input,option" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              delay

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Time in milliseconds to define when the selecting should start. It helps preventing unwanted selections when clicking on an element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a selectable with the delay option specified. +
              +
              +
              $( ".selector" ).selectable({ delay: 20 });
              +
              + + +
              + Get or set the delay option, after init. +
              +
              +
              //getter
              +var delay = $( ".selector" ).selectable( "option", "delay" );
              +//setter
              +$( ".selector" ).selectable( "option", "delay", 20 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              distance

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Tolerance, in pixels, for when selecting should start. If specified, selecting will not start until after mouse is dragged beyond distance.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a selectable with the distance option specified. +
              +
              +
              $( ".selector" ).selectable({ distance: 20 });
              +
              + + +
              + Get or set the distance option, after init. +
              +
              +
              //getter
              +var distance = $( ".selector" ).selectable( "option", "distance" );
              +//setter
              +$( ".selector" ).selectable( "option", "distance", 20 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              filter

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              "*"
              + +
              +
              +
              +

              The matching child elements will be made selectees (able to be selected).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a selectable with the filter option specified. +
              +
              +
              $( ".selector" ).selectable({ filter: "li" });
              +
              + + +
              + Get or set the filter option, after init. +
              +
              +
              //getter
              +var filter = $( ".selector" ).selectable( "option", "filter" );
              +//setter
              +$( ".selector" ).selectable( "option", "filter", "li" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              tolerance

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "touch"
              + +
              +
              +
              +

              Possible values: 'touch', 'fit'. +

              +
                +
              • fit: draggable overlaps the droppable entirely
              • +
              • touch: draggable overlaps the droppable any amount
              • +
              +

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a selectable with the tolerance option specified. +
              +
              +
              $( ".selector" ).selectable({ tolerance: "fit" });
              +
              + + +
              + Get or set the tolerance option, after init. +
              +
              +
              //getter
              +var tolerance = $( ".selector" ).selectable( "option", "tolerance" );
              +//setter
              +$( ".selector" ).selectable( "option", "tolerance", "fit" );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              selectablecreate
              +
              +
              +
              +

              This event is triggered when selectable is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).selectable({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: selectablecreate. +
              +
              +
              $( ".selector" ).bind( "selectablecreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              selected

              +
              +
              Type:
              +
              selectableselected
              +
              +
              +
              +

              This event is triggered at the end of the select operation, on each element added to the selection.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the selected event as an init option. +
              +
              +
              $( ".selector" ).selectable({
              +   selected: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the selected event by type: selectableselected. +
              +
              +
              $( ".selector" ).bind( "selectableselected", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              selecting

              +
              +
              Type:
              +
              selectableselecting
              +
              +
              +
              +

              This event is triggered during the select operation, on each element added to the selection.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the selecting event as an init option. +
              +
              +
              $( ".selector" ).selectable({
              +   selecting: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the selecting event by type: selectableselecting. +
              +
              +
              $( ".selector" ).bind( "selectableselecting", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              start

              +
              +
              Type:
              +
              selectablestart
              +
              +
              +
              +

              This event is triggered at the beginning of the select operation.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the start event as an init option. +
              +
              +
              $( ".selector" ).selectable({
              +   start: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the start event by type: selectablestart. +
              +
              +
              $( ".selector" ).bind( "selectablestart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              stop

              +
              +
              Type:
              +
              selectablestop
              +
              +
              +
              +

              This event is triggered at the end of the select operation.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the stop event as an init option. +
              +
              +
              $( ".selector" ).selectable({
              +   stop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the stop event by type: selectablestop. +
              +
              +
              $( ".selector" ).bind( "selectablestop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              unselected

              +
              +
              Type:
              +
              selectableunselected
              +
              +
              +
              +

              This event is triggered at the end of the select operation, on each element removed from the selection.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the unselected event as an init option. +
              +
              +
              $( ".selector" ).selectable({
              +   unselected: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the unselected event by type: selectableunselected. +
              +
              +
              $( ".selector" ).bind( "selectableunselected", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              unselecting

              +
              +
              Type:
              +
              selectableunselecting
              +
              +
              +
              +

              This event is triggered during the select operation, on each element removed from the selection.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the unselecting event as an init option. +
              +
              +
              $( ".selector" ).selectable({
              +   unselecting: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the unselecting event by type: selectableunselecting. +
              +
              +
              $( ".selector" ).bind( "selectableunselecting", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .selectable( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the selectable functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .selectable( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the selectable.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .selectable( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the selectable.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .selectable( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any selectable option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .selectable( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple selectable options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .selectable( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-selectable element.

              +
              +
            • + + +
            • +
              +

              refresh

              +
              +
              Signature:
              +
              .selectable( "refresh" + + + + + + + +)
              +
              +
              +
              +

              Refresh the position and size of each selectee element. This method can be used to manually recalculate the position and size of each selectee element. Very useful if autoRefresh is set to false.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Selectable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.selectable.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <ul class="ui-selectable">
            +   <li class="ui-selectee"></li>
            +   <li class="ui-selectee"></li>
            +   <li class="ui-selectee"></li>
            +</ul> +

            + + Note: This is a sample of markup generated by the selectable plugin, not markup you should use to create a selectable. The only markup needed for that is
            <ul>
            +   <li></li>
            +   <li></li>
            +   <li></li>
            +</ul>. +
            +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/show.html b/static/grappelli_orig/js/ui/development-bundle/docs/show.html new file mode 100644 index 00000000..5c56cbc1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/show.html @@ -0,0 +1,144 @@ + + +
            +

            jQuery UI show

            +
            +

            Overview

            +
            +

            show( effect, [options], [speed], [callback] )

            +

            The enhanced show method optionally accepts jQuery UI advanced effects.

            +

            Uses a specific effect on an element to show the element if the first argument is a effect string.

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Apply the effect slide if you click on the p to show a div.
            +

            +
            $("p").click(function () {
            +      $("div").show("slide", {}, 1000);
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<script src="http://ui.jquery.com/latest/ui/effects.slide.js"></script>
            +<style type="text/css">
            +  div { display: none; margin: 0px; width: 100px; height: 80px; background: blue; position: relative; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $("div").show("slide", {}, 1000);
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<p>Click me</p><div></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              effect

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              The effect to be used. Possible values: 'blind', 'clip', 'drop', 'explode', 'fold', 'puff', 'slide', 'scale', 'size', 'pulsate'.

              +
              +
            • + + +
            • +
              +

              options

              +
              +
              Type:
              +
              Hash
              + +
              Optional
              + +
              +
              +
              +

              A object/hash including specific options for the effect.

              +
              +
            • + + +
            • +
              +

              speed

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the predefined speeds ("slow" or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + + +
            • +
              +

              callback

              +
              +
              Type:
              +
              Function
              + +
              Optional
              + +
              +
              +
              +

              A function that is called after the effect is completed.

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/slider.html b/static/grappelli_orig/js/ui/development-bundle/docs/slider.html new file mode 100644 index 00000000..35c7b070 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/slider.html @@ -0,0 +1,860 @@ + + +
            +

            jQuery UI Slider

            +
            +

            Overview

            +
            +

            The jQuery UI Slider plugin makes selected elements into sliders. There are various options such as multiple handles, and ranges. The handle can be moved with the mouse or the arrow keys.

            +

            The start, slide, and stop callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'): +

            The slider widget will create handle elements with the class 'ui-slider-handle' on initialization. You can specify custom handle elements by creating and appending the elements and adding the 'ui-slider-handle' class before init. It will only create the number of handles needed to match the length of value/values. For example, if you specify 'values: [1, 5, 18]' and create one custom handle, the plugin will create the other two. +

            +
              +
            • ui.handle: DOMElement - the current focused handle
            • +
            • ui.value: Integer - the current handle's value
            • +
            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            • UI Mouse
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Slider.
            +

            +
            $("#slider").slider();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +    <style type="text/css">
            +    #slider { margin: 10px; }
            +  </style>
            +  <script>
            +  $(document).ready(function() {
            +    $("#slider").slider();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="slider"></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the slider. Can be set when initialising (first creating) the slider.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the disabled option specified. +
              +
              +
              $( ".selector" ).slider({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).slider( "option", "disabled" );
              +//setter
              +$( ".selector" ).slider( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              animate

              +
              +
              Type:
              +
              Boolean, String, Number
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Whether to slide handle smoothly when user click outside handle on the bar. Will also accept a string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the animate option specified. +
              +
              +
              $( ".selector" ).slider({ animate: true });
              +
              + + +
              + Get or set the animate option, after init. +
              +
              +
              //getter
              +var animate = $( ".selector" ).slider( "option", "animate" );
              +//setter
              +$( ".selector" ).slider( "option", "animate", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              max

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              100
              + +
              +
              +
              +

              The maximum value of the slider.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the max option specified. +
              +
              +
              $( ".selector" ).slider({ max: 7 });
              +
              + + +
              + Get or set the max option, after init. +
              +
              +
              //getter
              +var max = $( ".selector" ).slider( "option", "max" );
              +//setter
              +$( ".selector" ).slider( "option", "max", 7 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              min

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              The minimum value of the slider.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the min option specified. +
              +
              +
              $( ".selector" ).slider({ min: -7 });
              +
              + + +
              + Get or set the min option, after init. +
              +
              +
              //getter
              +var min = $( ".selector" ).slider( "option", "min" );
              +//setter
              +$( ".selector" ).slider( "option", "min", -7 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              orientation

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "horizontal"
              + +
              +
              +
              +

              This option determines whether the slider has the min at the left, the max at the right or the min at the bottom, the max at the top. Possible values: 'horizontal', 'vertical'.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the orientation option specified. +
              +
              +
              $( ".selector" ).slider({ orientation: "vertical" });
              +
              + + +
              + Get or set the orientation option, after init. +
              +
              +
              //getter
              +var orientation = $( ".selector" ).slider( "option", "orientation" );
              +//setter
              +$( ".selector" ).slider( "option", "orientation", "vertical" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              range

              +
              +
              Type:
              +
              Boolean, String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, the slider will detect if you have two handles and create a stylable range element between these two. Two other possible values are 'min' and 'max'. A min range goes from the slider min to one handle. A max range goes from one handle to the slider max.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the range option specified. +
              +
              +
              $( ".selector" ).slider({ range: 'min' });
              +
              + + +
              + Get or set the range option, after init. +
              +
              +
              //getter
              +var range = $( ".selector" ).slider( "option", "range" );
              +//setter
              +$( ".selector" ).slider( "option", "range", 'min' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              step

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              1
              + +
              +
              +
              +

              Determines the size or amount of each interval or step the slider takes between min and max. The full specified value range of the slider (max - min) needs to be evenly divisible by the step.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the step option specified. +
              +
              +
              $( ".selector" ).slider({ step: 5 });
              +
              + + +
              + Get or set the step option, after init. +
              +
              +
              //getter
              +var step = $( ".selector" ).slider( "option", "step" );
              +//setter
              +$( ".selector" ).slider( "option", "step", 5 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              value

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Determines the value of the slider, if there's only one handle. If there is more than one handle, determines the value of the first handle.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the value option specified. +
              +
              +
              $( ".selector" ).slider({ value: 37 });
              +
              + + +
              + Get or set the value option, after init. +
              +
              +
              //getter
              +var value = $( ".selector" ).slider( "option", "value" );
              +//setter
              +$( ".selector" ).slider( "option", "value", 37 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              values

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              This option can be used to specify multiple handles. If range is set to true, the length of 'values' should be 2.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a slider with the values option specified. +
              +
              +
              $( ".selector" ).slider({ values: [1,5,9] });
              +
              + + +
              + Get or set the values option, after init. +
              +
              +
              //getter
              +var values = $( ".selector" ).slider( "option", "values" );
              +//setter
              +$( ".selector" ).slider( "option", "values", [1,5,9] );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              slidecreate
              +
              +
              +
              +

              This event is triggered when slider is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).slider({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: slidecreate. +
              +
              +
              $( ".selector" ).bind( "slidecreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              start

              +
              +
              Type:
              +
              slidestart
              +
              +
              +
              +

              This event is triggered when the user starts sliding.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the start event as an init option. +
              +
              +
              $( ".selector" ).slider({
              +   start: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the start event by type: slidestart. +
              +
              +
              $( ".selector" ).bind( "slidestart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              slide

              +
              +
              Type:
              +
              slide
              +
              +
              +
              +

              This event is triggered on every mouse move during slide. Use ui.value (single-handled sliders) to obtain the value of the current handle, $(..).slider('value', index) to get another handles' value. +

              Return false in order to prevent a slide, based on ui.value.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the slide event as an init option. +
              +
              +
              $( ".selector" ).slider({
              +   slide: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the slide event by type: slide. +
              +
              +
              $( ".selector" ).bind( "slide", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              change

              +
              +
              Type:
              +
              slidechange
              +
              +
              +
              +

              This event is triggered on slide stop, or if the value is changed programmatically (by the value method). Takes arguments event and ui. Use event.originalEvent to detect whether the value changed by mouse, keyboard, or programmatically. Use ui.value (single-handled sliders) to obtain the value of the current handle, $(this).slider('values', index) to get another handle's value.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the change event as an init option. +
              +
              +
              $( ".selector" ).slider({
              +   change: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the change event by type: slidechange. +
              +
              +
              $( ".selector" ).bind( "slidechange", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              stop

              +
              +
              Type:
              +
              slidestop
              +
              +
              +
              +

              This event is triggered when the user stops sliding.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the stop event as an init option. +
              +
              +
              $( ".selector" ).slider({
              +   stop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the stop event by type: slidestop. +
              +
              +
              $( ".selector" ).bind( "slidestop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .slider( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the slider functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .slider( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the slider.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .slider( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the slider.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .slider( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any slider option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .slider( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple slider options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .slider( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-slider element.

              +
              +
            • + + +
            • +
              +

              value

              +
              +
              Signature:
              +
              .slider( "value" + +, [value] + + + + + +)
              +
              +
              +
              +

              Gets or sets the value of the slider. For single handle sliders.

              +
              +
            • + + +
            • +
              +

              values

              +
              +
              Signature:
              +
              .slider( "values" + +, index + +, [value] + + + +)
              +
              +
              +
              +

              Gets or sets the values of the slider. For multiple handle or range sliders.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Slider plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.slider.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
            +   <a style="left: 0%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a>
            +</div>
            +

            + + Note: This is a sample of markup generated by the slider plugin, not markup you should use to create a slider. The only markup needed for that is <div><div>. + +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/sortable.html b/static/grappelli_orig/js/ui/development-bundle/docs/sortable.html new file mode 100644 index 00000000..65d199e3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/sortable.html @@ -0,0 +1,1953 @@ + + +
            +

            jQuery UI Sortable

            +
            +

            Overview

            +
            +

            The jQuery UI Sortable plugin makes selected elements sortable by dragging with the mouse.

            +

            All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

            +
              +
            • ui.helper - the current helper element (most often a clone of the item)
            • +
            • ui.position - current position of the helper
            • +
            • ui.offset - current absolute position of the helper
            • +
            • ui.item - the current dragged element
            • +
            • ui.placeholder - the placeholder (if you defined one)
            • +
            • ui.sender - the sortable where the item comes from (only exists if you move from one connected list to another)
            • +
            +
            +
            +

            Dependencies

            +
              +
            • UI Core
            • +
            • UI Widget
            • +
            • UI Mouse
            • +
            +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Sortable.
            +

            +
            $("#sortable").sortable();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("#sortable").sortable();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<ul id="sortable">
            +<li>Item 1</li>
            +<li>Item 2</li>
            +<li>Item 3</li>
            +<li>Item 4</li>
            +<li>Item 5</li>
            +</ul>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the sortable. Can be set when initialising (first creating) the sortable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the disabled option specified. +
              +
              +
              $( ".selector" ).sortable({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).sortable( "option", "disabled" );
              +//setter
              +$( ".selector" ).sortable( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              appendTo

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              'parent'
              + +
              +
              +
              +

              Defines where the helper that moves with the mouse is being appended to during the drag (for example, to resolve overlap/zIndex issues).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the appendTo option specified. +
              +
              +
              $( ".selector" ).sortable({ appendTo: 'body' });
              +
              + + +
              + Get or set the appendTo option, after init. +
              +
              +
              //getter
              +var appendTo = $( ".selector" ).sortable( "option", "appendTo" );
              +//setter
              +$( ".selector" ).sortable( "option", "appendTo", 'body' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              axis

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If defined, the items can be dragged only horizontally or vertically. Possible values:'x', 'y'.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the axis option specified. +
              +
              +
              $( ".selector" ).sortable({ axis: 'x' });
              +
              + + +
              + Get or set the axis option, after init. +
              +
              +
              //getter
              +var axis = $( ".selector" ).sortable( "option", "axis" );
              +//setter
              +$( ".selector" ).sortable( "option", "axis", 'x' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cancel

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              ':input,button'
              + +
              +
              +
              +

              Prevents sorting if you start on elements matching the selector.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the cancel option specified. +
              +
              +
              $( ".selector" ).sortable({ cancel: 'button' });
              +
              + + +
              + Get or set the cancel option, after init. +
              +
              +
              //getter
              +var cancel = $( ".selector" ).sortable( "option", "cancel" );
              +//setter
              +$( ".selector" ).sortable( "option", "cancel", 'button' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              connectWith

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Takes a jQuery selector with items that also have sortables applied. If used, the sortable is now connected to the other one-way, so you can drag from this sortable to the other.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the connectWith option specified. +
              +
              +
              $( ".selector" ).sortable({ connectWith: '.otherlist' });
              +
              + + +
              + Get or set the connectWith option, after init. +
              +
              +
              //getter
              +var connectWith = $( ".selector" ).sortable( "option", "connectWith" );
              +//setter
              +$( ".selector" ).sortable( "option", "connectWith", '.otherlist' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              containment

              +
              +
              Type:
              +
              Element, String, Selector
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Constrains dragging to within the bounds of the specified element - can be a DOM element, 'parent', 'document', 'window', or a jQuery selector. +

              Note: the element specified for containment must have a calculated width and height (though it need not be explicit), so for example, if you have float:left sortable children and specify containment:'parent' be sure to have float:left on the sortable/parent container as well or it will have height: 0, causing undefined behavior.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the containment option specified. +
              +
              +
              $( ".selector" ).sortable({ containment: 'parent' });
              +
              + + +
              + Get or set the containment option, after init. +
              +
              +
              //getter
              +var containment = $( ".selector" ).sortable( "option", "containment" );
              +//setter
              +$( ".selector" ).sortable( "option", "containment", 'parent' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cursor

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              'auto'
              + +
              +
              +
              +

              Defines the cursor that is being shown while sorting.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the cursor option specified. +
              +
              +
              $( ".selector" ).sortable({ cursor: 'crosshair' });
              +
              + + +
              + Get or set the cursor option, after init. +
              +
              +
              //getter
              +var cursor = $( ".selector" ).sortable( "option", "cursor" );
              +//setter
              +$( ".selector" ).sortable( "option", "cursor", 'crosshair' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cursorAt

              +
              +
              Type:
              +
              Object
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Moves the sorting element or helper so the cursor always appears to drag from the same position. Coordinates can be given as a hash using a combination of one or two keys: { top, left, right, bottom }.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the cursorAt option specified. +
              +
              +
              $( ".selector" ).sortable({ cursorAt: { left: 5 } });
              +
              + + +
              + Get or set the cursorAt option, after init. +
              +
              +
              //getter
              +var cursorAt = $( ".selector" ).sortable( "option", "cursorAt" );
              +//setter
              +$( ".selector" ).sortable( "option", "cursorAt", { left: 5 } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              delay

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Time in milliseconds to define when the sorting should start. It helps preventing unwanted drags when clicking on an element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the delay option specified. +
              +
              +
              $( ".selector" ).sortable({ delay: 500 });
              +
              + + +
              + Get or set the delay option, after init. +
              +
              +
              //getter
              +var delay = $( ".selector" ).sortable( "option", "delay" );
              +//setter
              +$( ".selector" ).sortable( "option", "delay", 500 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              distance

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              1
              + +
              +
              +
              +

              Tolerance, in pixels, for when sorting should start. If specified, sorting will not start until after mouse is dragged beyond distance. Can be used to allow for clicks on elements within a handle.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the distance option specified. +
              +
              +
              $( ".selector" ).sortable({ distance: 30 });
              +
              + + +
              + Get or set the distance option, after init. +
              +
              +
              //getter
              +var distance = $( ".selector" ).sortable( "option", "distance" );
              +//setter
              +$( ".selector" ).sortable( "option", "distance", 30 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              dropOnEmpty

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If false items from this sortable can't be dropped to an empty linked sortable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the dropOnEmpty option specified. +
              +
              +
              $( ".selector" ).sortable({ dropOnEmpty: false });
              +
              + + +
              + Get or set the dropOnEmpty option, after init. +
              +
              +
              //getter
              +var dropOnEmpty = $( ".selector" ).sortable( "option", "dropOnEmpty" );
              +//setter
              +$( ".selector" ).sortable( "option", "dropOnEmpty", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              forceHelperSize

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If true, forces the helper to have a size.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the forceHelperSize option specified. +
              +
              +
              $( ".selector" ).sortable({ forceHelperSize: true });
              +
              + + +
              + Get or set the forceHelperSize option, after init. +
              +
              +
              //getter
              +var forceHelperSize = $( ".selector" ).sortable( "option", "forceHelperSize" );
              +//setter
              +$( ".selector" ).sortable( "option", "forceHelperSize", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              forcePlaceholderSize

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If true, forces the placeholder to have a size.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the forcePlaceholderSize option specified. +
              +
              +
              $( ".selector" ).sortable({ forcePlaceholderSize: true });
              +
              + + +
              + Get or set the forcePlaceholderSize option, after init. +
              +
              +
              //getter
              +var forcePlaceholderSize = $( ".selector" ).sortable( "option", "forcePlaceholderSize" );
              +//setter
              +$( ".selector" ).sortable( "option", "forcePlaceholderSize", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              grid

              +
              +
              Type:
              +
              Array
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Snaps the sorting element or helper to a grid, every x and y pixels. Array values: [x, y]

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the grid option specified. +
              +
              +
              $( ".selector" ).sortable({ grid: [50, 20] });
              +
              + + +
              + Get or set the grid option, after init. +
              +
              +
              //getter
              +var grid = $( ".selector" ).sortable( "option", "grid" );
              +//setter
              +$( ".selector" ).sortable( "option", "grid", [50, 20] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              handle

              +
              +
              Type:
              +
              Selector, Element
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Restricts sort start click to the specified element.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the handle option specified. +
              +
              +
              $( ".selector" ).sortable({ handle: 'h2' });
              +
              + + +
              + Get or set the handle option, after init. +
              +
              +
              //getter
              +var handle = $( ".selector" ).sortable( "option", "handle" );
              +//setter
              +$( ".selector" ).sortable( "option", "handle", 'h2' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              helper

              +
              +
              Type:
              +
              String, Function
              + +
              Default:
              +
              'original'
              + +
              +
              +
              +

              Allows for a helper element to be used for dragging display. The supplied function receives the event and the element being sorted, and should return a DOMElement to be used as a custom proxy helper. Possible values: 'original', 'clone'

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the helper option specified. +
              +
              +
              $( ".selector" ).sortable({ helper: 'clone' });
              +
              + + +
              + Get or set the helper option, after init. +
              +
              +
              //getter
              +var helper = $( ".selector" ).sortable( "option", "helper" );
              +//setter
              +$( ".selector" ).sortable( "option", "helper", 'clone' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              items

              +
              +
              Type:
              +
              Selector
              + +
              Default:
              +
              '> *'
              + +
              +
              +
              +

              Specifies which items inside the element should be sortable.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the items option specified. +
              +
              +
              $( ".selector" ).sortable({ items: 'li' });
              +
              + + +
              + Get or set the items option, after init. +
              +
              +
              //getter
              +var items = $( ".selector" ).sortable( "option", "items" );
              +//setter
              +$( ".selector" ).sortable( "option", "items", 'li' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              opacity

              +
              +
              Type:
              +
              Float
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Defines the opacity of the helper while sorting. From 0.01 to 1

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the opacity option specified. +
              +
              +
              $( ".selector" ).sortable({ opacity: 0.6 });
              +
              + + +
              + Get or set the opacity option, after init. +
              +
              +
              //getter
              +var opacity = $( ".selector" ).sortable( "option", "opacity" );
              +//setter
              +$( ".selector" ).sortable( "option", "opacity", 0.6 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              placeholder

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Class that gets applied to the otherwise white space.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the placeholder option specified. +
              +
              +
              $( ".selector" ).sortable({ placeholder: 'ui-state-highlight' });
              +
              + + +
              + Get or set the placeholder option, after init. +
              +
              +
              //getter
              +var placeholder = $( ".selector" ).sortable( "option", "placeholder" );
              +//setter
              +$( ".selector" ).sortable( "option", "placeholder", 'ui-state-highlight' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              revert

              +
              +
              Type:
              +
              Boolean/Integer
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              If set to true, the item will be reverted to its new DOM position with a smooth animation. Optionally, it can also be set to a number that controls the duration of the animation in ms.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the revert option specified. +
              +
              +
              $( ".selector" ).sortable({ revert: true });
              +
              + + +
              + Get or set the revert option, after init. +
              +
              +
              //getter
              +var revert = $( ".selector" ).sortable( "option", "revert" );
              +//setter
              +$( ".selector" ).sortable( "option", "revert", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scroll

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              true
              + +
              +
              +
              +

              If set to true, the page scrolls when coming to an edge.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the scroll option specified. +
              +
              +
              $( ".selector" ).sortable({ scroll: false });
              +
              + + +
              + Get or set the scroll option, after init. +
              +
              +
              //getter
              +var scroll = $( ".selector" ).sortable( "option", "scroll" );
              +//setter
              +$( ".selector" ).sortable( "option", "scroll", false );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scrollSensitivity

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              20
              + +
              +
              +
              +

              Defines how near the mouse must be to an edge to start scrolling.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the scrollSensitivity option specified. +
              +
              +
              $( ".selector" ).sortable({ scrollSensitivity: 40 });
              +
              + + +
              + Get or set the scrollSensitivity option, after init. +
              +
              +
              //getter
              +var scrollSensitivity = $( ".selector" ).sortable( "option", "scrollSensitivity" );
              +//setter
              +$( ".selector" ).sortable( "option", "scrollSensitivity", 40 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              scrollSpeed

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              20
              + +
              +
              +
              +

              The speed at which the window should scroll once the mouse pointer gets within the scrollSensitivity distance.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the scrollSpeed option specified. +
              +
              +
              $( ".selector" ).sortable({ scrollSpeed: 40 });
              +
              + + +
              + Get or set the scrollSpeed option, after init. +
              +
              +
              //getter
              +var scrollSpeed = $( ".selector" ).sortable( "option", "scrollSpeed" );
              +//setter
              +$( ".selector" ).sortable( "option", "scrollSpeed", 40 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              tolerance

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              'intersect'
              + +
              +
              +
              +

              This is the way the reordering behaves during drag. Possible values: 'intersect', 'pointer'. In some setups, 'pointer' is more natural. +

              +
                +
              • intersect: draggable overlaps the droppable at least 50%
              • +
              • pointer: mouse pointer overlaps the droppable
              • +
              +

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the tolerance option specified. +
              +
              +
              $( ".selector" ).sortable({ tolerance: 'pointer' });
              +
              + + +
              + Get or set the tolerance option, after init. +
              +
              +
              //getter
              +var tolerance = $( ".selector" ).sortable( "option", "tolerance" );
              +//setter
              +$( ".selector" ).sortable( "option", "tolerance", 'pointer' );
              +
              + +
              +
              +
            • + + +
            • +
              +

              zIndex

              +
              +
              Type:
              +
              Integer
              + +
              Default:
              +
              1000
              + +
              +
              +
              +

              Z-index for element/helper while being sorted.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a sortable with the zIndex option specified. +
              +
              +
              $( ".selector" ).sortable({ zIndex: 5 });
              +
              + + +
              + Get or set the zIndex option, after init. +
              +
              +
              //getter
              +var zIndex = $( ".selector" ).sortable( "option", "zIndex" );
              +//setter
              +$( ".selector" ).sortable( "option", "zIndex", 5 );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              sortcreate
              +
              +
              +
              +

              This event is triggered when sortable is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: sortcreate. +
              +
              +
              $( ".selector" ).bind( "sortcreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              start

              +
              +
              Type:
              +
              sortstart
              +
              +
              +
              +

              This event is triggered when sorting starts.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the start event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   start: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the start event by type: sortstart. +
              +
              +
              $( ".selector" ).bind( "sortstart", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              sort

              +
              +
              Type:
              +
              sort
              +
              +
              +
              +

              This event is triggered during sorting.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the sort event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   sort: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the sort event by type: sort. +
              +
              +
              $( ".selector" ).bind( "sort", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              change

              +
              +
              Type:
              +
              sortchange
              +
              +
              +
              +

              This event is triggered during sorting, but only when the DOM position has changed.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the change event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   change: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the change event by type: sortchange. +
              +
              +
              $( ".selector" ).bind( "sortchange", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              beforeStop

              +
              +
              Type:
              +
              sortbeforestop
              +
              +
              +
              +

              This event is triggered when sorting stops, but when the placeholder/helper is still available.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the beforeStop event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   beforeStop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the beforeStop event by type: sortbeforestop. +
              +
              +
              $( ".selector" ).bind( "sortbeforestop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              stop

              +
              +
              Type:
              +
              sortstop
              +
              +
              +
              +

              This event is triggered when sorting has stopped.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the stop event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   stop: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the stop event by type: sortstop. +
              +
              +
              $( ".selector" ).bind( "sortstop", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              update

              +
              +
              Type:
              +
              sortupdate
              +
              +
              +
              +

              This event is triggered when the user stopped sorting and the DOM position has changed.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the update event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   update: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the update event by type: sortupdate. +
              +
              +
              $( ".selector" ).bind( "sortupdate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              receive

              +
              +
              Type:
              +
              sortreceive
              +
              +
              +
              +

              This event is triggered when a connected sortable list has received an item from another list.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the receive event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   receive: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the receive event by type: sortreceive. +
              +
              +
              $( ".selector" ).bind( "sortreceive", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              remove

              +
              +
              Type:
              +
              sortremove
              +
              +
              +
              +

              This event is triggered when a sortable item has been dragged out from the list and into another.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the remove event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   remove: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the remove event by type: sortremove. +
              +
              +
              $( ".selector" ).bind( "sortremove", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              over

              +
              +
              Type:
              +
              sortover
              +
              +
              +
              +

              This event is triggered when a sortable item is moved into a connected list.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the over event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   over: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the over event by type: sortover. +
              +
              +
              $( ".selector" ).bind( "sortover", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              out

              +
              +
              Type:
              +
              sortout
              +
              +
              +
              +

              This event is triggered when a sortable item is moved away from a connected list.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the out event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   out: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the out event by type: sortout. +
              +
              +
              $( ".selector" ).bind( "sortout", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              activate

              +
              +
              Type:
              +
              sortactivate
              +
              +
              +
              +

              This event is triggered when using connected lists, every connected list on drag start receives it.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the activate event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   activate: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the activate event by type: sortactivate. +
              +
              +
              $( ".selector" ).bind( "sortactivate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              deactivate

              +
              +
              Type:
              +
              sortdeactivate
              +
              +
              +
              +

              This event is triggered when sorting was stopped, is propagated to all possible connected lists.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the deactivate event as an init option. +
              +
              +
              $( ".selector" ).sortable({
              +   deactivate: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the deactivate event by type: sortdeactivate. +
              +
              +
              $( ".selector" ).bind( "sortdeactivate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .sortable( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the sortable functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .sortable( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the sortable.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .sortable( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the sortable.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .sortable( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any sortable option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .sortable( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple sortable options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .sortable( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-sortable element.

              +
              +
            • + + +
            • +
              +

              serialize

              +
              +
              Signature:
              +
              .sortable( "serialize" + +, [options] + + + + + +)
              +
              +
              +
              +

              Serializes the sortable's item id's into a form/ajax submittable string. Calling this method produces a hash that can be appended to any url to easily submit a new item order back to the server. +

              It works by default by looking at the id of each item in the format 'setname_number', and it spits out a hash like "setname[]=number&setname[]=number". +

              You can also give in a option hash as second argument to custom define how the function works. The possible options are: 'key' (replaces part1[] with whatever you want), 'attribute' (test another attribute than 'id') and 'expression' (use your own regexp). +

              If serialize returns an empty string, make sure the id attributes include an underscore. They must be in the form: "set_number" For example, a 3 element list with id attributes foo_1, foo_5, foo_2 will serialize to foo[]=1&foo[]=5&foo[]=2. You can use an underscore, equal sign or hyphen to separate the set and number. For example foo=1 or foo-1 or foo_1 all serialize to foo[]=1.

              +
              +
            • + + +
            • +
              +

              toArray

              +
              +
              Signature:
              +
              .sortable( "toArray" + + + + + + + +)
              +
              +
              +
              +

              Serializes the sortable's item id's into an array of string. If you have +

              +
              +<ul id="a_sortable"><br>
              +<li id="hello">Hello</li><br>
              +<li id="goodbye">Good bye</li><br>
              +</ul>
              +
              +

              and do +

              +
              var result = $('#a_sortable').sortable('toArray');
              +

              then +

              +
              result[0] will contain "hello" and result[1] will contain "goodbye".

              +
              +
            • + +

              +

            • +
              +

              refresh

              +
              +
              Signature:
              +
              .sortable( "refresh" + + + + + + + +)
              +
              +
              +
              +

              Refresh the sortable items. Custom trigger the reloading of all sortable items, causing new items to be recognized.

              +
              +
            • + + +
            • +
              +

              refreshPositions

              +
              +
              Signature:
              +
              .sortable( "refreshPositions" + + + + + + + +)
              +
              +
              +
              +

              Refresh the cached positions of the sortables' items. Calling this method refreshes the cached item positions of all sortables. This is usually done automatically by the script and slows down performance. Use wisely.

              +
              +
            • + + +
            • +
              +

              cancel

              +
              +
              Signature:
              +
              .sortable( "cancel" + + + + + + + +)
              +
              +
              +
              +

              Cancels a change in the current sortable and reverts it back to how it was before the current sort started. Useful in the stop and receive callback functions. +

              If the sortable item is not being moved from one connected sortable to another: +

              +
              $(this).sortable('cancel');
              +

              will cancel the change. +

              If the sortable item is being moved from one connected sortable to another: +

              +
              $(ui.sender).sortable('cancel');
              +

              will cancel the change. Useful in the 'receive' callback.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Sortable plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.sortable.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <ul class="ui-sortable">
            +   <li></li>
            +   <li class="ui-sortable-helper"></li>
            +   <li class="ui-sortable-placeholder"></li>
            +   <li></li>
            +</ul> +

            + + Note: This is a sample of markup generated by the sortable plugin, not markup you should use to create a sortable. The only markup needed for that is
            <ul>
            +   <li></li>
            +   <li></li>
            +   <li></li>
            +</ul>. +
            +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/switchClass.html b/static/grappelli_orig/js/ui/development-bundle/docs/switchClass.html new file mode 100644 index 00000000..3de5a085 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/switchClass.html @@ -0,0 +1,129 @@ + + +
            +

            jQuery UI switchClass

            +
            +

            Overview

            +
            +

            switchClass( remove, add, [duration] )

            +

            Switches from the class defined in the first argument to the class defined as second argument, using an optional transition.

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Switch the class 'highlight' to 'blue' when a paragraph is clicked with a one second transition.
            +

            +
            $("p").click(function () {
            +      $(this).switchClass("highlight", "blue", 1000);
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<style type="text/css">
            +  p { margin: 4px; font-size:16px; font-weight:bolder; 
            +      cursor:pointer; }
            +  .blue { background: blue; }
            +  .highlight { background:yellow; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $(this).switchClass("highlight", "blue", 1000);
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<p class="highlight">Click to switch</p>
            +<p class="highlight">to blue</p>
            +<p class="highlight">on these</p>
            +<p class="highlight">paragraphs</p>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              remove

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              The CSS class that will be removed.

              +
              +
            • + + +
            • +
              +

              add

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              The CSS class that will be added.

              +
              +
            • + + +
            • +
              +

              duration

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/tabs.html b/static/grappelli_orig/js/ui/development-bundle/docs/tabs.html new file mode 100644 index 00000000..c481142a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/tabs.html @@ -0,0 +1,1532 @@ + + +
            +

            jQuery UI Tabs

            +
            +

            Overview

            +
            +

            Tabs are generally used to break content into multiple sections that can be swapped to save space, much like an accordion.

            +

            By default a tab widget will swap between tabbed sections onClick, but the events can be changed to onHover through an option. Tab content can be loaded via Ajax by setting an href on a tab.

            +

            NOTE: Tabs created dynamically using .tabs( "add", ... ) are given an id of ui-tabs-NUM, where NUM is an auto-incrementing id. If you use this naming convention for your own elements, you may encounter problems.

            +

            Contents

            + +
            +

            Events

            +

            A series of events fire when interacting with a tabs interface: +

            +
            • tabsselect, tabsload, tabsshow (in that order) +
            • tabsadd, tabsremove +
            • tabsenable, tabsdisable +
            +

            Event binding example: +

            +
            $('#example').bind('tabsselect', function(event, ui) {
            +
            +    // Objects available in the function context:
            +    ui.tab     // anchor element of the selected (clicked) tab
            +    ui.panel   // element, that contains the selected/clicked tab contents
            +    ui.index   // zero-based index of the selected (clicked) tab
            +
            +});
            +

            Note that if a handler for the tabsselect event returns false, the clicked tab will not become selected (useful for example if switching to the next tab requires a form validation). +

            +

            Ajax mode

            +

            Tabs supports loading tab content via Ajax in an unobtrusive manner. +

            The HTML you need is slightly different from the one that is used for static tabs: A list of links pointing to existing resources (from where the content gets loaded) and no additional containers at all (unobtrusive!). The containers' markup is going to be created on the fly: +

            +
            +<div id="example">
            +     <ul>
            +         <li><a href="ahah_1.html"><span>Content 1</span></a></li>
            +         <li><a href="ahah_2.html"><span>Content 2</span></a></li>
            +         <li><a href="ahah_3.html"><span>Content 3</span></a></li>
            +     </ul>
            +</div>
            +
            +

            Obviously this degrades gracefully - the links, e.g. the content, will still be accessible with JavaScript disabled. +

            Note that if you wish to reuse an existing container, you +could do so by matching a title attribute and the container's id: +

            +
            +<li><a href="hello/world.html" title="Todo Overview"> ... </a></li>
            +
            +

            and a container like: +

            +
            +<div id="Todo_Overview"> ... </div>
            +
            +

            (Note how white space is replaced with an underscore) +

            This is useful if you want a human readable hash in the URL instead of +a cryptic generated one. +

            +

            Back button and bookmarking

            +

            Tabs 2 already supported this functionality, although the history plugin needs a rewrite first (it doesn't support Safari 3 and is in general a little inflexible) before it can be build back into the tabs. It is planned and Klaus is working on it whenever he finds the time. Actual bugs in the UI Tabs plugin itself always have higher priority though. +

            +

            How to...

            +

            ...retrieve the index of the currently selected tab

            +
            var $tabs = $('#example').tabs();
            +var selected = $tabs.tabs('option', 'selected'); // => 0
            +

            ...open links in the current tab instead of leaving the page

            +

            "Hijax" links after tab content has been loaded: +

            +
            $('#example').tabs({
            +    load: function(event, ui) {
            +        $(ui.panel).delegate('a', 'click', function(event) {
            +            $(ui.panel).load(this.href);
            +            event.preventDefault();
            +        });
            +    }
            +});
            +

            ...select a tab from a text link instead of clicking a tab itself

            +
            var $tabs = $('#example').tabs(); // first tab selected
            +
            +$('#my-text-link').click(function() { // bind click event to link
            +    $tabs.tabs('select', 2); // switch to third tab
            +    return false;
            +});
            +

            ...prevent switching to the tab on click depending on form validation

            +

            Returning false in the tabs select handler prevents the clicked tab from becoming selected. +

            +
            $('#example').tabs({
            +    select: function(event, ui) {
            +        var isValid = ... // form validation returning true or false
            +        return isValid;
            +    }
            +});
            +

            ...immediately select a just added tab

            +
            var $tabs = $('#example').tabs({
            +    add: function(event, ui) {
            +        $tabs.tabs('select', '#' + ui.panel.id);
            +    }
            +});
            +

            ...prevent a FOUC (Flash of Unstyled Content) before tabs are initialized

            +

            Add the necessary classes to hide an inactive tab panel to the HTML right away - note that this will not degrade gracefully with JavaScript being disabled: +

            +
            <div id="example" class="ui-tabs">
            +  ...
            +  <div id="a-tab-panel" class="ui-tabs-hide"> </div>
            +  ...
            +</div>
            +

            Why does...

            +

            ...my slider, Google Map, sIFR etc. not work when placed in a hidden (inactive) tab?

            +

            Any component that requires some dimensional computation for its initialization won't work in a hidden tab, because the tab panel itself is hidden via display: none so that any elements inside won't report their actual width and height (0 in most browsers). +

            There's an easy workaround. Use the off-left technique for hiding inactive tab panels. E.g. in your style sheet replace the rule for the class selector ".ui-tabs .ui-tabs-hide" with +

            +
            .ui-tabs .ui-tabs-hide {
            +    position: absolute;
            +    left: -10000px;
            +}
            +

            For Google maps you can also resize the map once the tab is displayed like this: +

            +
            $('#example').bind('tabsshow', function(event, ui) {
            +    if (ui.panel.id == "map-tab") {
            +        resizeMap();
            +    }
            +});
            +resizeMap() will call Google Maps' checkResize() on the particular map. +
            +
            +

            Dependencies

            + +
            +
            +

            Example

            +
            + +

            +A simple jQuery UI Tabs.
            +

            +
            $("#tabs").tabs();
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  
            +  <script>
            +  $(document).ready(function() {
            +    $("#tabs").tabs();
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<div id="tabs">
            +    <ul>
            +        <li><a href="#fragment-1"><span>One</span></a></li>
            +        <li><a href="#fragment-2"><span>Two</span></a></li>
            +        <li><a href="#fragment-3"><span>Three</span></a></li>
            +    </ul>
            +    <div id="fragment-1">
            +        <p>First tab is active by default:</p>
            +        <pre><code>$('#example').tabs();</code></pre>
            +    </div>
            +    <div id="fragment-2">
            +        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
            +        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
            +    </div>
            +    <div id="fragment-3">
            +        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
            +        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
            +        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
            +    </div>
            +</div>
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Options

            +
              + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Disables (true) or enables (false) the tabs. Can be set when initialising (first creating) the tabs.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the disabled option specified. +
              +
              +
              $( ".selector" ).tabs({ disabled: true });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).tabs( "option", "disabled" );
              +//setter
              +$( ".selector" ).tabs( "option", "disabled", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              ajaxOptions

              +
              +
              Type:
              +
              Options
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              Additional Ajax options to consider when loading tab content (see $.ajax).

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the ajaxOptions option specified. +
              +
              +
              $( ".selector" ).tabs({ ajaxOptions: { async: false } });
              +
              + + +
              + Get or set the ajaxOptions option, after init. +
              +
              +
              //getter
              +var ajaxOptions = $( ".selector" ).tabs( "option", "ajaxOptions" );
              +//setter
              +$( ".selector" ).tabs( "option", "ajaxOptions", { async: false } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              cache

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Whether or not to cache remote tabs content, e.g. load only once or with every click. Cached content is being lazy loaded, e.g once and only once for the first click. Note that to prevent the actual Ajax requests from being cached by the browser you need to provide an extra cache: false flag to ajaxOptions.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the cache option specified. +
              +
              +
              $( ".selector" ).tabs({ cache: true });
              +
              + + +
              + Get or set the cache option, after init. +
              +
              +
              //getter
              +var cache = $( ".selector" ).tabs( "option", "cache" );
              +//setter
              +$( ".selector" ).tabs( "option", "cache", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              collapsible

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              Set to true to allow an already selected tab to become unselected again upon reselection.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the collapsible option specified. +
              +
              +
              $( ".selector" ).tabs({ collapsible: true });
              +
              + + +
              + Get or set the collapsible option, after init. +
              +
              +
              //getter
              +var collapsible = $( ".selector" ).tabs( "option", "collapsible" );
              +//setter
              +$( ".selector" ).tabs( "option", "collapsible", true );
              +
              + +
              +
              +
            • + + + + + +
            • +
              +

              deselectable

              +
              +
              Type:
              +
              Boolean
              + +
              Default:
              +
              false
              + +
              +
              +
              +

              deprecated in jQuery UI 1.7, use collapsible.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the deselectable option specified. +
              +
              +
              $( ".selector" ).tabs({ deselectable: true });
              +
              + + +
              + Get or set the deselectable option, after init. +
              +
              +
              //getter
              +var deselectable = $( ".selector" ).tabs( "option", "deselectable" );
              +//setter
              +$( ".selector" ).tabs( "option", "deselectable", true );
              +
              + +
              +
              +
            • + + +
            • +
              +

              disabled

              +
              +
              Type:
              +
              Array<Number>
              + +
              Default:
              +
              []
              + +
              +
              +
              +

              An array containing the position of the tabs (zero-based index) that should be disabled on initialization.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the disabled option specified. +
              +
              +
              $( ".selector" ).tabs({ disabled: [1, 2] });
              +
              + + +
              + Get or set the disabled option, after init. +
              +
              +
              //getter
              +var disabled = $( ".selector" ).tabs( "option", "disabled" );
              +//setter
              +$( ".selector" ).tabs( "option", "disabled", [1, 2] );
              +
              + +
              +
              +
            • + + +
            • +
              +

              event

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "click"
              + +
              +
              +
              +

              The type of event to be used for selecting a tab.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the event option specified. +
              +
              +
              $( ".selector" ).tabs({ event: "mouseover" });
              +
              + + +
              + Get or set the event option, after init. +
              +
              +
              //getter
              +var event = $( ".selector" ).tabs( "option", "event" );
              +//setter
              +$( ".selector" ).tabs( "option", "event", "mouseover" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              fx

              +
              +
              Type:
              +
              Options, Array<Options>
              + +
              Default:
              +
              null
              + +
              +
              +
              +

              Enable animations for hiding and showing tab panels. The duration option can be a string representing one of the three predefined speeds ("slow", "normal", "fast") or the duration in milliseconds to run an animation (default is "normal").

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the fx option specified. +
              +
              +
              $( ".selector" ).tabs({ fx: { opacity: 'toggle' } });
              +
              + + +
              + Get or set the fx option, after init. +
              +
              +
              //getter
              +var fx = $( ".selector" ).tabs( "option", "fx" );
              +//setter
              +$( ".selector" ).tabs( "option", "fx", { opacity: 'toggle' } );
              +
              + +
              +
              +
            • + + +
            • +
              +

              idPrefix

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "ui-tabs-"
              + +
              +
              +
              +

              If the remote tab, its anchor element that is, has no title attribute to generate an id from, an id/fragment identifier is created from this prefix and a unique id returned by $.data(el), for example "ui-tabs-54".

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the idPrefix option specified. +
              +
              +
              $( ".selector" ).tabs({ idPrefix: "ui-tabs-primary" });
              +
              + + +
              + Get or set the idPrefix option, after init. +
              +
              +
              //getter
              +var idPrefix = $( ".selector" ).tabs( "option", "idPrefix" );
              +//setter
              +$( ".selector" ).tabs( "option", "idPrefix", "ui-tabs-primary" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              panelTemplate

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "<div></div>"
              + +
              +
              +
              +

              HTML template from which a new tab panel is created in case of adding a tab with the add method or when creating a panel for a remote tab on the fly.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the panelTemplate option specified. +
              +
              +
              $( ".selector" ).tabs({ panelTemplate: "<li></li>" });
              +
              + + +
              + Get or set the panelTemplate option, after init. +
              +
              +
              //getter
              +var panelTemplate = $( ".selector" ).tabs( "option", "panelTemplate" );
              +//setter
              +$( ".selector" ).tabs( "option", "panelTemplate", "<li></li>" );
              +
              + +
              +
              +
            • + + +
            • +
              +

              selected

              +
              +
              Type:
              +
              Number
              + +
              Default:
              +
              0
              + +
              +
              +
              +

              Zero-based index of the tab to be selected on initialization. To set all tabs to unselected pass -1 as value.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the selected option specified. +
              +
              +
              $( ".selector" ).tabs({ selected: 3 });
              +
              + + +
              + Get or set the selected option, after init. +
              +
              +
              //getter
              +var selected = $( ".selector" ).tabs( "option", "selected" );
              +//setter
              +$( ".selector" ).tabs( "option", "selected", 3 );
              +
              + +
              +
              +
            • + + +
            • +
              +

              spinner

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "<em>Loading&#8230;</em>"
              + +
              +
              +
              +

              The HTML content of this string is shown in a tab title while remote content is loading. Pass in empty string to deactivate that behavior. An span element must be present in the A tag of the title, for the spinner content to be visible.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the spinner option specified. +
              +
              +
              $( ".selector" ).tabs({ spinner: "Retrieving data..." });
              +
              + + +
              + Get or set the spinner option, after init. +
              +
              +
              //getter
              +var spinner = $( ".selector" ).tabs( "option", "spinner" );
              +//setter
              +$( ".selector" ).tabs( "option", "spinner", "Retrieving data..." );
              +
              + +
              +
              +
            • + + +
            • +
              +

              tabTemplate

              +
              +
              Type:
              +
              String
              + +
              Default:
              +
              "<li><a href="#{href}"><span>#{label}</span></a></li>"
              + +
              +
              +
              +

              HTML template from which a new tab is created and added. The placeholders #{href} and #{label} are replaced with the url and tab label that are passed as arguments to the add method.

              +
              +
              +

              Code examples

              +
              + +
              + Initialize a tabs with the tabTemplate option specified. +
              +
              +
              $( ".selector" ).tabs({ tabTemplate: "<div><a href="#{href}"><span>#{label}</span></a></div>" });
              +
              + + +
              + Get or set the tabTemplate option, after init. +
              +
              +
              //getter
              +var tabTemplate = $( ".selector" ).tabs( "option", "tabTemplate" );
              +//setter
              +$( ".selector" ).tabs( "option", "tabTemplate", "<div><a href="#{href}"><span>#{label}</span></a></div>" );
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Events

            +
              + +
            • +
              +

              create

              +
              +
              Type:
              +
              tabscreate
              +
              +
              +
              +

              This event is triggered when tabs is created.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the create event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   create: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the create event by type: tabscreate. +
              +
              +
              $( ".selector" ).bind( "tabscreate", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              select

              +
              +
              Type:
              +
              tabsselect
              +
              +
              +
              +

              This event is triggered when clicking a tab.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the select event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   select: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the select event by type: tabsselect. +
              +
              +
              $( ".selector" ).bind( "tabsselect", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              load

              +
              +
              Type:
              +
              tabsload
              +
              +
              +
              +

              This event is triggered after the content of a remote tab has been loaded.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the load event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   load: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the load event by type: tabsload. +
              +
              +
              $( ".selector" ).bind( "tabsload", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              show

              +
              +
              Type:
              +
              tabsshow
              +
              +
              +
              +

              This event is triggered when a tab is shown.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the show event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   show: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the show event by type: tabsshow. +
              +
              +
              $( ".selector" ).bind( "tabsshow", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              add

              +
              +
              Type:
              +
              tabsadd
              +
              +
              +
              +

              This event is triggered when a tab is added.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the add event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   add: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the add event by type: tabsadd. +
              +
              +
              $( ".selector" ).bind( "tabsadd", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              remove

              +
              +
              Type:
              +
              tabsremove
              +
              +
              +
              +

              This event is triggered when a tab is removed.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the remove event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   remove: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the remove event by type: tabsremove. +
              +
              +
              $( ".selector" ).bind( "tabsremove", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Type:
              +
              tabsenable
              +
              +
              +
              +

              This event is triggered when a tab is enabled.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the enable event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   enable: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the enable event by type: tabsenable. +
              +
              +
              $( ".selector" ).bind( "tabsenable", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Type:
              +
              tabsdisable
              +
              +
              +
              +

              This event is triggered when a tab is disabled.

              +
              +
              +

              Code examples

              +
              + +
              + Supply a callback function to handle the disable event as an init option. +
              +
              +
              $( ".selector" ).tabs({
              +   disable: function(event, ui) { ... }
              +});
              +
              + + +
              + Bind to the disable event by type: tabsdisable. +
              +
              +
              $( ".selector" ).bind( "tabsdisable", function(event, ui) {
              +  ...
              +});
              +
              + +
              +
              +
            • + +
            +
            +
            +

            Methods

            +
              + +
            • +
              +

              destroy

              +
              +
              Signature:
              +
              .tabs( "destroy" + + + + + + + +)
              +
              +
              +
              +

              Remove the tabs functionality completely. This will return the element back to its pre-init state.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .tabs( "disable" + + + + + + + +)
              +
              +
              +
              +

              Disable the tabs.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .tabs( "enable" + + + + + + + +)
              +
              +
              +
              +

              Enable the tabs.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .tabs( "option" + +, optionName + +, [value] + + + +)
              +
              +
              +
              +

              Get or set any tabs option. If no value is specified, will act as a getter.

              +
              +
            • + + +
            • +
              +

              option

              +
              +
              Signature:
              +
              .tabs( "option" + +, options + + + + + +)
              +
              +
              +
              +

              Set multiple tabs options at once by providing an options object.

              +
              +
            • + + +
            • +
              +

              widget

              +
              +
              Signature:
              +
              .tabs( "widget" + + + + + + + +)
              +
              +
              +
              +

              Returns the .ui-tabs element.

              +
              +
            • + + +
            • +
              +

              add

              +
              +
              Signature:
              +
              .tabs( "add" + +, url + +, label + +, [index] + +)
              +
              +
              +
              +

              Add a new tab. The second argument is either a URL consisting of a fragment identifier only to create an in-page tab or a full url (relative or absolute, no cross-domain support) to turn the new tab into an Ajax (remote) tab. The third is the zero-based position where to insert the new tab. Optional, by default a new tab is appended at the end.

              +
              +
            • + + +
            • +
              +

              remove

              +
              +
              Signature:
              +
              .tabs( "remove" + +, index + + + + + +)
              +
              +
              +
              +

              Remove a tab. The second argument is the zero-based index of the tab to be removed. Instead of an index, the href of the tab may be passed.

              +
              +
            • + + +
            • +
              +

              enable

              +
              +
              Signature:
              +
              .tabs( "enable" + +, index + + + + + +)
              +
              +
              +
              +

              Enable a disabled tab. To enable more than one tab at once reset the disabled property like: $('#example').tabs("option","disabled",[]);. The second argument is the zero-based index of the tab to be enabled. Instead of an index, the href of the tab may be passed.

              +
              +
            • + + +
            • +
              +

              disable

              +
              +
              Signature:
              +
              .tabs( "disable" + +, index + + + + + +)
              +
              +
              +
              +

              Disable a tab. The selected tab cannot be disabled. To disable more than one tab at once use: $('#example').tabs("option","disabled", [1, 2, 3]); The second argument is the zero-based index of the tab to be disabled. Instead of an index, the href of the tab may be passed.

              +
              +
            • + + +
            • +
              +

              select

              +
              +
              Signature:
              +
              .tabs( "select" + +, index + + + + + +)
              +
              +
              +
              +

              Select a tab, as if it were clicked. The second argument is the zero-based index of the tab to be selected or the id selector of the panel the tab is associated with (the tab's href fragment identifier, e.g. hash, points to the panel's id).

              +
              +
            • + + +
            • +
              +

              load

              +
              +
              Signature:
              +
              .tabs( "load" + +, index + + + + + +)
              +
              +
              +
              +

              Reload the content of an Ajax tab programmatically. This method always loads the tab content from the remote location, even if cache is set to true. The second argument is the zero-based index of the tab to be reloaded.

              +
              +
            • + + +
            • +
              +

              url

              +
              +
              Signature:
              +
              .tabs( "url" + +, index + +, url + + + +)
              +
              +
              +
              +

              Change the url from which an Ajax (remote) tab will be loaded. The specified URL will be used for subsequent loads. Note that you can not only change the URL for an existing remote tab with this method, but also turn an in-page tab into a remote tab. The second argument is the zero-based index of the tab of which its URL is to be updated. The third is a URL the content of the tab is loaded from.

              +
              +
            • + + +
            • +
              +

              length

              +
              +
              Signature:
              +
              .tabs( "length" + + + + + + + +)
              +
              +
              +
              +

              Retrieve the number of tabs of the first matched tab pane.

              +
              +
            • + + +
            • +
              +

              abort

              +
              +
              Signature:
              +
              .tabs( "abort" + + + + + + + +)
              +
              +
              +
              +

              Terminate all running tab ajax requests and animations.

              +
              +
            • + + +
            • +
              +

              rotate

              +
              +
              Signature:
              +
              .tabs( "rotate" + +, ms + +, [continuing] + + + +)
              +
              +
              +
              +

              Set up an automatic rotation through tabs of a tab pane. The second argument is an amount of time in milliseconds until the next tab in the cycle gets activated. Use 0 or null to stop the rotation. The third controls whether or not to continue the rotation after a tab has been selected by a user. Default: false.

              +
              +
            • + +
            +
            +
            +

            Theming

            +

            The jQuery UI Tabs plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain. +

            +

            If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.tabs.css stylesheet that can be modified. These classes are highlighed in bold below. +

            + +

            Sample markup with jQuery UI CSS Framework classes

            + <div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
            +   <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
            +     <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#tabs-1">Nunc tincidunt</a></li>
            +      <li class="ui-state-default ui-corner-top"><a href="#tabs-2">Proin dolor</a></li>
            +   <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="tabs-1">
            +      <p>Tab one content goes here.</p>
            +   </div>
            +    ...
            +</div>
            +

            + + Note: This is a sample of markup generated by the tabs plugin, not markup you should use to create a tabs. The only markup needed for that is
            <div id="tabs">
            +   <ul>
            +      <li><a href="#tabs-1">Nunc tincidunt</a></li>
            +      <li><a href="#tabs-2">Proin dolor</a></li>
            +      <li><a href="#tabs-3">Aenean lacinia</a></li>
            +   </ul>
            +   <div id="tabs-1">
            +      <p>Tab 1 content</p>
            +   </div>
            +   <div id="tabs-2">
            +      <p>Tab 2 content</p>
            +   </div>
            +   <div id="tabs-3">
            +      <p>Tab 3 content</p>
            +   </div>
            +</div>. +
            +

            + +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/toggle.html b/static/grappelli_orig/js/ui/development-bundle/docs/toggle.html new file mode 100644 index 00000000..85608abd --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/toggle.html @@ -0,0 +1,144 @@ + + +
            +

            jQuery UI toggle

            +
            +

            Overview

            +
            +

            toggle( effect, [options], [speed], [callback] )

            +

            The enhanced toggle method optionally accepts jQuery UI advanced effects.

            +

            Uses a specific effect on an element to toggle the element if the first argument is an effect string.

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Apply the effect slide if you click on the p to toggle a div.
            +

            +
            $("p").click(function () {
            +      $("div").toggle("slide", {}, 1000);
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<script src="http://ui.jquery.com/latest/ui/effects.slide.js"></script>
            +<style type="text/css">
            +  div { display: none; margin: 0px; width: 100px; height: 80px; background: blue; position: relative; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $("div").toggle("slide", {}, 1000);
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<p>Click me</p><div></div>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              effect

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              The effect to be used. Possible values: 'blind', 'clip', 'drop', 'explode', 'fold', 'puff', 'slide', 'scale', 'size', 'pulsate'.

              +
              +
            • + + +
            • +
              +

              options

              +
              +
              Type:
              +
              Hash
              + +
              Optional
              + +
              +
              +
              +

              A object/hash including specific options for the effect.

              +
              +
            • + + +
            • +
              +

              speed

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the predefined speeds ("slow" or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + + +
            • +
              +

              callback

              +
              +
              Type:
              +
              Function
              + +
              Optional
              + +
              +
              +
              +

              A function that is called after the effect is completed.

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/docs/toggleClass.html b/static/grappelli_orig/js/ui/development-bundle/docs/toggleClass.html new file mode 100644 index 00000000..ee72a697 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/docs/toggleClass.html @@ -0,0 +1,111 @@ + + +
            +

            jQuery UI toggleClass

            +
            +

            Overview

            +
            +

            toggleClass( class, [duration] )

            +

            Adds the specified class if it is not present, and removes the specified class if it is present, using an optional transition.

            +
            +
            +

            Dependencies

            +
              +
            • Effects Core
            • +
            +
            +
            +

            Example

            +
            + +

            +Adds the 'selected' class if it is not present, and removes the 'selected' class if it is present.
            +

            +
            $("p").click(function () {
            +      $(this).toggleClass("selected", 1000);
            +    });
            +
            +

            +

            +
            <!DOCTYPE html>
            +<html>
            +<head>
            +  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            +  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            +  <script src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
            +<style type="text/css">
            +  p { cursor: pointer; font-size: 1.2em; }
            +  .selected { color:red; }
            +</style>
            +  <script>
            +  $(document).ready(function() {
            +    $("p").click(function () {
            +      $(this).toggleClass("selected", 1000);
            +    });
            +  });
            +  </script>
            +</head>
            +<body style="font-size:62.5%;">
            +  
            +<p>Click me to toggle 'selected' class.</p>
            +<p class="selected">Click me to toggle 'selected' class.</p>
            +<p>Click me to toggle 'selected' class.</p>
            +
            +</body>
            +</html>
            +
            +

            +

            +
            +
            +
            +

            Arguments

            +
              + +
            • +
              +

              class

              +
              +
              Type:
              +
              String
              + +
              +
              +
              +

              A CSS class to toggle on the elements.

              +
              +
            • + + +
            • +
              +

              duration

              +
              +
              Type:
              +
              String, Number
              + +
              Optional
              + +
              +
              +
              +

              A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).

              +
              +
            • + +
            +
            +
            + +

            + + diff --git a/static/grappelli_orig/js/ui/development-bundle/external/jquery.bgiframe-2.1.2.js b/static/grappelli_orig/js/ui/development-bundle/external/jquery.bgiframe-2.1.2.js new file mode 100644 index 00000000..5cd38bb1 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/external/jquery.bgiframe-2.1.2.js @@ -0,0 +1,39 @@ +/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Version 2.1.2 + */ + +(function($){ + +$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) { + s = $.extend({ + top : 'auto', // auto == .currentStyle.borderTopWidth + left : 'auto', // auto == .currentStyle.borderLeftWidth + width : 'auto', // auto == offsetWidth + height : 'auto', // auto == offsetHeight + opacity : true, + src : 'javascript:false;' + }, s); + var html = '' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '
            '; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '' + monthNames[drawMonth] + ''; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += ''; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '' + drawYear + ''; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ''; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '
            '; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; + return dpDiv.bind('mouseout', function(event) { + var elem = $( event.target ).closest( selector ); + if ( !elem.length ) { + return; + } + elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" ); + }) + .bind('mouseover', function(event) { + var elem = $( event.target ).closest( selector ); + if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) || + !elem.length ) { + return; + } + elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + elem.addClass('ui-state-hover'); + if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover'); + if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover'); + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Determine whether an object is an array. */ +function isArray(a) { + return (a && (($.browser.safari && typeof a == 'object' && a.length) || + (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); +}; + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find('body').append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.8.21"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); +/*! + * jQuery UI Progressbar 1.8.21 + * + * Copyright 2012, 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/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.progressbar", { + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function() { + this.element + .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .attr({ + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + }); + + this.valueDiv = $( "
            " ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + destroy: function() { + this.element + .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + + $.Widget.prototype.destroy.apply( this, arguments ); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(); + var percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +$.extend( $.ui.progressbar, { + version: "1.8.21" +}); + +})( jQuery ); +/*! + * jQuery UI Effects 1.8.21 + * + * Copyright 2012, 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/Effects/ + */ +;jQuery.effects || (function($, undefined) { + +$.effects = {}; + + + +/******************************************************************************/ +/****************************** COLOR ANIMATIONS ******************************/ +/******************************************************************************/ + +// override the animation for color styles +$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', + 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'], +function(i, attr) { + $.fx.step[attr] = function(fx) { + if (!fx.colorInit) { + fx.start = getColor(fx.elem, attr); + fx.end = getRGB(fx.end); + fx.colorInit = true; + } + + fx.elem.style[attr] = 'rgb(' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')'; + }; +}); + +// Color Conversion functions from highlightFade +// By Blair Mitchelmore +// http://jquery.offput.ca/highlightFade/ + +// Parse strings looking for color tuples [255,255,255] +function getRGB(color) { + var result; + + // Check if we're already dealing with an array of colors + if ( color && color.constructor == Array && color.length == 3 ) + return color; + + // Look for rgb(num,num,num) + if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) + return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; + + // Look for rgb(num%,num%,num%) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) + return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; + + // Look for #a0b1c2 + if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) + return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; + + // Look for #fff + if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) + return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; + + // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 + if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) + return colors['transparent']; + + // Otherwise, we're most likely dealing with a named color + return colors[$.trim(color).toLowerCase()]; +} + +function getColor(elem, attr) { + var color; + + do { + color = $.curCSS(elem, attr); + + // Keep going until we find an element that has color, or we hit the body + if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") ) + break; + + attr = "backgroundColor"; + } while ( elem = elem.parentNode ); + + return getRGB(color); +}; + +// Some named colors to work with +// From Interface by Stefan Petre +// http://interface.eyecon.ro/ + +var colors = { + aqua:[0,255,255], + azure:[240,255,255], + beige:[245,245,220], + black:[0,0,0], + blue:[0,0,255], + brown:[165,42,42], + cyan:[0,255,255], + darkblue:[0,0,139], + darkcyan:[0,139,139], + darkgrey:[169,169,169], + darkgreen:[0,100,0], + darkkhaki:[189,183,107], + darkmagenta:[139,0,139], + darkolivegreen:[85,107,47], + darkorange:[255,140,0], + darkorchid:[153,50,204], + darkred:[139,0,0], + darksalmon:[233,150,122], + darkviolet:[148,0,211], + fuchsia:[255,0,255], + gold:[255,215,0], + green:[0,128,0], + indigo:[75,0,130], + khaki:[240,230,140], + lightblue:[173,216,230], + lightcyan:[224,255,255], + lightgreen:[144,238,144], + lightgrey:[211,211,211], + lightpink:[255,182,193], + lightyellow:[255,255,224], + lime:[0,255,0], + magenta:[255,0,255], + maroon:[128,0,0], + navy:[0,0,128], + olive:[128,128,0], + orange:[255,165,0], + pink:[255,192,203], + purple:[128,0,128], + violet:[128,0,128], + red:[255,0,0], + silver:[192,192,192], + white:[255,255,255], + yellow:[255,255,0], + transparent: [255,255,255] +}; + + + +/******************************************************************************/ +/****************************** CLASS ANIMATIONS ******************************/ +/******************************************************************************/ + +var classAnimationActions = ['add', 'remove', 'toggle'], + shorthandStyles = { + border: 1, + borderBottom: 1, + borderColor: 1, + borderLeft: 1, + borderRight: 1, + borderTop: 1, + borderWidth: 1, + margin: 1, + padding: 1 + }; + +function getElementStyles() { + var style = document.defaultView + ? document.defaultView.getComputedStyle(this, null) + : this.currentStyle, + newStyle = {}, + key, + camelCase; + + // webkit enumerates style porperties + if (style && style.length && style[0] && style[style[0]]) { + var len = style.length; + while (len--) { + key = style[len]; + if (typeof style[key] == 'string') { + camelCase = key.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + newStyle[camelCase] = style[key]; + } + } + } else { + for (key in style) { + if (typeof style[key] === 'string') { + newStyle[key] = style[key]; + } + } + } + + return newStyle; +} + +function filterStyles(styles) { + var name, value; + for (name in styles) { + value = styles[name]; + if ( + // ignore null and undefined values + value == null || + // ignore functions (when does this occur?) + $.isFunction(value) || + // shorthand styles that need to be expanded + name in shorthandStyles || + // ignore scrollbars (break in IE) + (/scrollbar/).test(name) || + + // only colors or values that can be converted to numbers + (!(/color/i).test(name) && isNaN(parseFloat(value))) + ) { + delete styles[name]; + } + } + + return styles; +} + +function styleDifference(oldStyle, newStyle) { + var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459 + name; + + for (name in newStyle) { + if (oldStyle[name] != newStyle[name]) { + diff[name] = newStyle[name]; + } + } + + return diff; +} + +$.effects.animateClass = function(value, duration, easing, callback) { + if ($.isFunction(easing)) { + callback = easing; + easing = null; + } + + return this.queue(function() { + var that = $(this), + originalStyleAttr = that.attr('style') || ' ', + originalStyle = filterStyles(getElementStyles.call(this)), + newStyle, + className = that.attr('class') || ""; + + $.each(classAnimationActions, function(i, action) { + if (value[action]) { + that[action + 'Class'](value[action]); + } + }); + newStyle = filterStyles(getElementStyles.call(this)); + that.attr('class', className); + + that.animate(styleDifference(originalStyle, newStyle), { + queue: false, + duration: duration, + easing: easing, + complete: function() { + $.each(classAnimationActions, function(i, action) { + if (value[action]) { that[action + 'Class'](value[action]); } + }); + // work around bug in IE by clearing the cssText before setting it + if (typeof that.attr('style') == 'object') { + that.attr('style').cssText = ''; + that.attr('style').cssText = originalStyleAttr; + } else { + that.attr('style', originalStyleAttr); + } + if (callback) { callback.apply(this, arguments); } + $.dequeue( this ); + } + }); + }); +}; + +$.fn.extend({ + _addClass: $.fn.addClass, + addClass: function(classNames, speed, easing, callback) { + return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); + }, + + _removeClass: $.fn.removeClass, + removeClass: function(classNames,speed,easing,callback) { + return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); + }, + + _toggleClass: $.fn.toggleClass, + toggleClass: function(classNames, force, speed, easing, callback) { + if ( typeof force == "boolean" || force === undefined ) { + if ( !speed ) { + // without speed parameter; + return this._toggleClass(classNames, force); + } else { + return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]); + } + } else { + // without switch parameter; + return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]); + } + }, + + switchClass: function(remove,add,speed,easing,callback) { + return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); + } +}); + + + +/******************************************************************************/ +/*********************************** EFFECTS **********************************/ +/******************************************************************************/ + +$.extend($.effects, { + version: "1.8.21", + + // Saves a set of properties in a data storage + save: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]); + } + }, + + // Restores a set of previously saved properties from a data storage + restore: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i])); + } + }, + + setMode: function(el, mode) { + if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle + return mode; + }, + + getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value + // this should be a little more flexible in the future to handle a string & hash + var y, x; + switch (origin[0]) { + case 'top': y = 0; break; + case 'middle': y = 0.5; break; + case 'bottom': y = 1; break; + default: y = origin[0] / original.height; + }; + switch (origin[1]) { + case 'left': x = 0; break; + case 'center': x = 0.5; break; + case 'right': x = 1; break; + default: x = origin[1] / original.width; + }; + return {x: x, y: y}; + }, + + // Wraps the element around a wrapper that copies position properties + createWrapper: function(element) { + + // if the element is already wrapped, return it + if (element.parent().is('.ui-effects-wrapper')) { + return element.parent(); + } + + // wrap the element + var props = { + width: element.outerWidth(true), + height: element.outerHeight(true), + 'float': element.css('float') + }, + wrapper = $('
            ') + .addClass('ui-effects-wrapper') + .css({ + fontSize: '100%', + background: 'transparent', + border: 'none', + margin: 0, + padding: 0 + }), + active = document.activeElement; + + // support: Firefox + // Firefox incorrectly exposes anonymous content + // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 + try { + active.id; + } catch( e ) { + active = document.body; + } + + element.wrap( wrapper ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element + + // transfer positioning properties to the wrapper + if (element.css('position') == 'static') { + wrapper.css({ position: 'relative' }); + element.css({ position: 'relative' }); + } else { + $.extend(props, { + position: element.css('position'), + zIndex: element.css('z-index') + }); + $.each(['top', 'left', 'bottom', 'right'], function(i, pos) { + props[pos] = element.css(pos); + if (isNaN(parseInt(props[pos], 10))) { + props[pos] = 'auto'; + } + }); + element.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' }); + } + + return wrapper.css(props).show(); + }, + + removeWrapper: function(element) { + var parent, + active = document.activeElement; + + if (element.parent().is('.ui-effects-wrapper')) { + parent = element.parent().replaceWith(element); + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + return parent; + } + + return element; + }, + + setTransition: function(element, list, factor, value) { + value = value || {}; + $.each(list, function(i, x){ + var unit = element.cssUnit(x); + if (unit[0] > 0) value[x] = unit[0] * factor + unit[1]; + }); + return value; + } +}); + + +function _normalizeArguments(effect, options, speed, callback) { + // shift params for method overloading + if (typeof effect == 'object') { + callback = options; + speed = null; + options = effect; + effect = options.effect; + } + if ($.isFunction(options)) { + callback = options; + speed = null; + options = {}; + } + if (typeof options == 'number' || $.fx.speeds[options]) { + callback = speed; + speed = options; + options = {}; + } + if ($.isFunction(speed)) { + callback = speed; + speed = null; + } + + options = options || {}; + + speed = speed || options.duration; + speed = $.fx.off ? 0 : typeof speed == 'number' + ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default; + + callback = callback || options.complete; + + return [effect, options, speed, callback]; +} + +function standardSpeed( speed ) { + // valid standard speeds + if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { + return true; + } + + // invalid strings - treat as "normal" speed + if ( typeof speed === "string" && !$.effects[ speed ] ) { + return true; + } + + return false; +} + +$.fn.extend({ + effect: function(effect, options, speed, callback) { + var args = _normalizeArguments.apply(this, arguments), + // TODO: make effects take actual parameters instead of a hash + args2 = { + options: args[1], + duration: args[2], + callback: args[3] + }, + mode = args2.options.mode, + effectMethod = $.effects[effect]; + + if ( $.fx.off || !effectMethod ) { + // delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args2.duration, args2.callback ); + } else { + return this.each(function() { + if ( args2.callback ) { + args2.callback.call( this ); + } + }); + } + } + + return effectMethod.call(this, args2); + }, + + _show: $.fn.show, + show: function(speed) { + if ( standardSpeed( speed ) ) { + return this._show.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'show'; + return this.effect.apply(this, args); + } + }, + + _hide: $.fn.hide, + hide: function(speed) { + if ( standardSpeed( speed ) ) { + return this._hide.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'hide'; + return this.effect.apply(this, args); + } + }, + + // jQuery core overloads toggle and creates _toggle + __toggle: $.fn.toggle, + toggle: function(speed) { + if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { + return this.__toggle.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'toggle'; + return this.effect.apply(this, args); + } + }, + + // helper functions + cssUnit: function(key) { + var style = this.css(key), val = []; + $.each( ['em','px','%','pt'], function(i, unit){ + if(style.indexOf(unit) > 0) + val = [parseFloat(style), unit]; + }); + return val; + } +}); + + + +/******************************************************************************/ +/*********************************** EASING ***********************************/ +/******************************************************************************/ + +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built in easing capabilities added In jQuery 1.1 + * to offer multiple easing options + * + * TERMS OF USE - jQuery Easing + * + * Open source under the BSD License. + * + * Copyright 2008 George McGinley Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * +*/ + +// t: current time, b: begInnIng value, c: change In value, d: duration +$.easing.jswing = $.easing.swing; + +$.extend($.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert($.easing.default); + return $.easing[$.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +})(jQuery); +/*! + * jQuery UI Effects Blind 1.8.21 + * + * Copyright 2012, 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/Effects/Blind + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.blind = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'vertical') ? 'height' : 'width'; + var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); + if(mode == 'show') wrapper.css(ref, 0); // Shift + + // Animation + var animation = {}; + animation[ref] = mode == 'show' ? distance : 0; + + // Animate + wrapper.animate(animation, o.duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Bounce 1.8.21 + * + * Copyright 2012, 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/Effects/Bounce + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.bounce = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'up'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 5; // Default # of times + var speed = o.duration || 250; // Default speed per bounce + if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + if (mode == 'hide') distance = distance / (times * 2); + if (mode != 'hide') times--; + + // Animate + if (mode == 'show') { // Show Bounce + var animation = {opacity: 1}; + animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation, speed / 2, o.options.easing); + distance = distance / 2; + times--; + }; + for (var i = 0; i < times; i++) { // Bounces + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing); + distance = (mode == 'hide') ? distance * 2 : distance / 2; + }; + if (mode == 'hide') { // Last Bounce + var animation = {opacity: 0}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + el.animate(animation, speed / 2, o.options.easing, function(){ + el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + } else { + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){ + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + }; + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Clip 1.8.21 + * + * Copyright 2012, 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/Effects/Clip + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.clip = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','height','width']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var animate = el[0].tagName == 'IMG' ? wrapper : el; + var ref = { + size: (direction == 'vertical') ? 'height' : 'width', + position: (direction == 'vertical') ? 'top' : 'left' + }; + var distance = (direction == 'vertical') ? animate.height() : animate.width(); + if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift + + // Animation + var animation = {}; + animation[ref.size] = mode == 'show' ? distance : 0; + animation[ref.position] = mode == 'show' ? 0 : distance / 2; + + // Animate + animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Drop 1.8.21 + * + * Copyright 2012, 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/Effects/Drop + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.drop = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','opacity']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + + // Animation + var animation = {opacity: mode == 'show' ? 1 : 0}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Explode 1.8.21 + * + * Copyright 2012, 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/Effects/Explode + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.explode = function(o) { + + return this.queue(function() { + + var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + + o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode; + var el = $(this).show().css('visibility', 'hidden'); + var offset = el.offset(); + + //Substract the margins - not fixing the problem yet. + offset.top -= parseInt(el.css("marginTop"),10) || 0; + offset.left -= parseInt(el.css("marginLeft"),10) || 0; + + var width = el.outerWidth(true); + var height = el.outerHeight(true); + + for(var i=0;i') + .css({ + position: 'absolute', + visibility: 'visible', + left: -j*(width/cells), + top: -i*(height/rows) + }) + .parent() + .addClass('ui-effects-explode') + .css({ + position: 'absolute', + overflow: 'hidden', + width: width/cells, + height: height/rows, + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0), + opacity: o.options.mode == 'show' ? 0 : 1 + }).animate({ + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)), + opacity: o.options.mode == 'show' ? 1 : 0 + }, o.duration || 500); + } + } + + // Set a timeout, to call the callback approx. when the other animations have finished + setTimeout(function() { + + o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide(); + if(o.callback) o.callback.apply(el[0]); // Callback + el.dequeue(); + + $('div.ui-effects-explode').remove(); + + }, o.duration || 500); + + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Fade 1.8.21 + * + * Copyright 2012, 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/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fade = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'); + + elem.animate({ opacity: mode }, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); +/*! + * jQuery UI Effects Fold 1.8.21 + * + * Copyright 2012, 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/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fold = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var size = o.options.size || 15; // Default fold size + var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value + var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var widthFirst = ((mode == 'show') != horizFirst); + var ref = widthFirst ? ['width', 'height'] : ['height', 'width']; + var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()]; + var percent = /([0-9]+)%/.exec(size); + if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1]; + if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift + + // Animation + var animation1 = {}, animation2 = {}; + animation1[ref[0]] = mode == 'show' ? distance[0] : size; + animation2[ref[1]] = mode == 'show' ? distance[1] : 0; + + // Animate + wrapper.animate(animation1, duration, o.options.easing) + .animate(animation2, duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Highlight 1.8.21 + * + * Copyright 2012, 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/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.highlight = function(o) { + return this.queue(function() { + var elem = $(this), + props = ['backgroundImage', 'backgroundColor', 'opacity'], + mode = $.effects.setMode(elem, o.options.mode || 'show'), + animation = { + backgroundColor: elem.css('backgroundColor') + }; + + if (mode == 'hide') { + animation.opacity = 0; + } + + $.effects.save(elem, props); + elem + .show() + .css({ + backgroundImage: 'none', + backgroundColor: o.options.color || '#ffff99' + }) + .animate(animation, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (mode == 'hide' && elem.hide()); + $.effects.restore(elem, props); + (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter')); + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); +/*! + * jQuery UI Effects Pulsate 1.8.21 + * + * Copyright 2012, 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/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.pulsate = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'show'), + times = ((o.options.times || 5) * 2) - 1, + duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2, + isVisible = elem.is(':visible'), + animateTo = 0; + + if (!isVisible) { + elem.css('opacity', 0).show(); + animateTo = 1; + } + + if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) { + times--; + } + + for (var i = 0; i < times; i++) { + elem.animate({ opacity: animateTo }, duration, o.options.easing); + animateTo = (animateTo + 1) % 2; + } + + elem.animate({ opacity: animateTo }, duration, o.options.easing, function() { + if (animateTo == 0) { + elem.hide(); + } + (o.callback && o.callback.apply(this, arguments)); + }); + + elem + .queue('fx', function() { elem.dequeue(); }) + .dequeue(); + }); +}; + +})(jQuery); +/*! + * jQuery UI Effects Scale 1.8.21 + * + * Copyright 2012, 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/Effects/Scale + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.puff = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'), + percent = parseInt(o.options.percent, 10) || 150, + factor = percent / 100, + original = { height: elem.height(), width: elem.width() }; + + $.extend(o.options, { + fade: true, + mode: mode, + percent: mode == 'hide' ? percent : 100, + from: mode == 'hide' + ? original + : { + height: original.height * factor, + width: original.width * factor + } + }); + + elem.effect('scale', o.options, o.duration, o.callback); + elem.dequeue(); + }); +}; + +$.effects.scale = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var options = $.extend(true, {}, o.options); + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent + var direction = o.options.direction || 'both'; // Set default axis + var origin = o.options.origin; // The origin of the scaling + if (mode != 'effect') { // Set default origin and restore for show/hide + options.origin = origin || ['middle','center']; + options.restore = true; + } + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state + + // Adjust + var factor = { // Set scaling factor + y: direction != 'horizontal' ? (percent / 100) : 1, + x: direction != 'vertical' ? (percent / 100) : 1 + }; + el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state + + if (o.options.fade) { // Fade option to support puff + if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; + if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; + }; + + // Animation + options.from = el.from; options.to = el.to; options.mode = mode; + + // Animate + el.effect('size', options, o.duration, o.callback); + el.dequeue(); + }); + +}; + +$.effects.size = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','width','height','overflow','opacity']; + var props1 = ['position','top','bottom','left','right','overflow','opacity']; // Always restore + var props2 = ['width','height','overflow']; // Copy for children + var cProps = ['fontSize']; + var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; + var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var restore = o.options.restore || false; // Default restore + var scale = o.options.scale || 'both'; // Default scale mode + var origin = o.options.origin; // The origin of the sizing + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || original; // Default from state + el.to = o.options.to || original; // Default to state + // Adjust + if (origin) { // Calculate baseline shifts + var baseline = $.effects.getBaseline(origin, original); + el.from.top = (original.height - el.from.height) * baseline.y; + el.from.left = (original.width - el.from.width) * baseline.x; + el.to.top = (original.height - el.to.height) * baseline.y; + el.to.left = (original.width - el.to.width) * baseline.x; + }; + var factor = { // Set scaling factor + from: {y: el.from.height / original.height, x: el.from.width / original.width}, + to: {y: el.to.height / original.height, x: el.to.width / original.width} + }; + if (scale == 'box' || scale == 'both') { // Scale the css box + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(vProps); + el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + props = props.concat(hProps); + el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from); + el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to); + }; + }; + if (scale == 'content' || scale == 'both') { // Scale the content + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(cProps); + el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to); + }; + }; + $.effects.save(el, restore ? props : props1); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + el.css('overflow','hidden').css(el.from); // Shift + + // Animate + if (scale == 'content' || scale == 'both') { // Scale the children + vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size + hProps = hProps.concat(['marginLeft','marginRight']); // Add margins + props2 = props.concat(vProps).concat(hProps); // Concat + el.find("*[width]").each(function(){ + var child = $(this); + if (restore) $.effects.save(child, props2); + var c_original = {height: child.height(), width: child.width()}; // Save original + child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x}; + child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x}; + if (factor.from.y != factor.to.y) { // Vertical props scaling + child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from); + child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from); + child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to); + }; + child.css(child.from); // Shift children + child.animate(child.to, o.duration, o.options.easing, function(){ + if (restore) $.effects.restore(child, props2); // Restore children + }); // Animate children + }); + }; + + // Animate + el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if (el.to.opacity === 0) { + el.css('opacity', el.from.opacity); + } + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Shake 1.8.21 + * + * Copyright 2012, 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/Effects/Shake + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.shake = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'left'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 3; // Default # of times + var speed = o.duration || o.options.duration || 140; // Default speed per shake + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + + // Animation + var animation = {}, animation1 = {}, animation2 = {}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2; + animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2; + + // Animate + el.animate(animation, speed, o.options.easing); + for (var i = 1; i < times; i++) { // Shakes + el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing); + }; + el.animate(animation1, speed, o.options.easing). + animate(animation, speed / 2, o.options.easing, function(){ // Last shake + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Slide 1.8.21 + * + * Copyright 2012, 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/Effects/Slide + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.slide = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); + if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift + + // Animation + var animation = {}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Transfer 1.8.21 + * + * Copyright 2012, 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/Effects/Transfer + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.transfer = function(o) { + return this.queue(function() { + var elem = $(this), + target = $(o.options.to), + endPosition = target.offset(), + animation = { + top: endPosition.top, + left: endPosition.left, + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $('
            ') + .appendTo(document.body) + .addClass(o.options.className) + .css({ + top: startPosition.top, + left: startPosition.left, + height: elem.innerHeight(), + width: elem.innerWidth(), + position: 'absolute' + }) + .animate(animation, o.duration, o.options.easing, function() { + transfer.remove(); + (o.callback && o.callback.apply(elem[0], arguments)); + elem.dequeue(); + }); + }); +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.blind.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.blind.js new file mode 100644 index 00000000..686cdb79 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.blind.js @@ -0,0 +1,49 @@ +/*! + * jQuery UI Effects Blind 1.8.21 + * + * Copyright 2012, 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/Effects/Blind + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.blind = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'vertical') ? 'height' : 'width'; + var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); + if(mode == 'show') wrapper.css(ref, 0); // Shift + + // Animation + var animation = {}; + animation[ref] = mode == 'show' ? distance : 0; + + // Animate + wrapper.animate(animation, o.duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.bounce.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.bounce.js new file mode 100644 index 00000000..e3fc3d8d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.bounce.js @@ -0,0 +1,78 @@ +/*! + * jQuery UI Effects Bounce 1.8.21 + * + * Copyright 2012, 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/Effects/Bounce + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.bounce = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'up'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 5; // Default # of times + var speed = o.duration || 250; // Default speed per bounce + if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + if (mode == 'hide') distance = distance / (times * 2); + if (mode != 'hide') times--; + + // Animate + if (mode == 'show') { // Show Bounce + var animation = {opacity: 1}; + animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation, speed / 2, o.options.easing); + distance = distance / 2; + times--; + }; + for (var i = 0; i < times; i++) { // Bounces + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing); + distance = (mode == 'hide') ? distance * 2 : distance / 2; + }; + if (mode == 'hide') { // Last Bounce + var animation = {opacity: 0}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + el.animate(animation, speed / 2, o.options.easing, function(){ + el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + } else { + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){ + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + }; + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.clip.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.clip.js new file mode 100644 index 00000000..2b435548 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.clip.js @@ -0,0 +1,54 @@ +/*! + * jQuery UI Effects Clip 1.8.21 + * + * Copyright 2012, 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/Effects/Clip + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.clip = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','height','width']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var animate = el[0].tagName == 'IMG' ? wrapper : el; + var ref = { + size: (direction == 'vertical') ? 'height' : 'width', + position: (direction == 'vertical') ? 'top' : 'left' + }; + var distance = (direction == 'vertical') ? animate.height() : animate.width(); + if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift + + // Animation + var animation = {}; + animation[ref.size] = mode == 'show' ? distance : 0; + animation[ref.position] = mode == 'show' ? 0 : distance / 2; + + // Animate + animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.core.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.core.js new file mode 100644 index 00000000..cc318271 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.core.js @@ -0,0 +1,772 @@ +/*! + * jQuery UI Effects 1.8.21 + * + * Copyright 2012, 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/Effects/ + */ +;jQuery.effects || (function($, undefined) { + +$.effects = {}; + + + +/******************************************************************************/ +/****************************** COLOR ANIMATIONS ******************************/ +/******************************************************************************/ + +// override the animation for color styles +$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', + 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'], +function(i, attr) { + $.fx.step[attr] = function(fx) { + if (!fx.colorInit) { + fx.start = getColor(fx.elem, attr); + fx.end = getRGB(fx.end); + fx.colorInit = true; + } + + fx.elem.style[attr] = 'rgb(' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')'; + }; +}); + +// Color Conversion functions from highlightFade +// By Blair Mitchelmore +// http://jquery.offput.ca/highlightFade/ + +// Parse strings looking for color tuples [255,255,255] +function getRGB(color) { + var result; + + // Check if we're already dealing with an array of colors + if ( color && color.constructor == Array && color.length == 3 ) + return color; + + // Look for rgb(num,num,num) + if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) + return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; + + // Look for rgb(num%,num%,num%) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) + return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; + + // Look for #a0b1c2 + if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) + return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; + + // Look for #fff + if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) + return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; + + // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 + if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) + return colors['transparent']; + + // Otherwise, we're most likely dealing with a named color + return colors[$.trim(color).toLowerCase()]; +} + +function getColor(elem, attr) { + var color; + + do { + color = $.curCSS(elem, attr); + + // Keep going until we find an element that has color, or we hit the body + if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") ) + break; + + attr = "backgroundColor"; + } while ( elem = elem.parentNode ); + + return getRGB(color); +}; + +// Some named colors to work with +// From Interface by Stefan Petre +// http://interface.eyecon.ro/ + +var colors = { + aqua:[0,255,255], + azure:[240,255,255], + beige:[245,245,220], + black:[0,0,0], + blue:[0,0,255], + brown:[165,42,42], + cyan:[0,255,255], + darkblue:[0,0,139], + darkcyan:[0,139,139], + darkgrey:[169,169,169], + darkgreen:[0,100,0], + darkkhaki:[189,183,107], + darkmagenta:[139,0,139], + darkolivegreen:[85,107,47], + darkorange:[255,140,0], + darkorchid:[153,50,204], + darkred:[139,0,0], + darksalmon:[233,150,122], + darkviolet:[148,0,211], + fuchsia:[255,0,255], + gold:[255,215,0], + green:[0,128,0], + indigo:[75,0,130], + khaki:[240,230,140], + lightblue:[173,216,230], + lightcyan:[224,255,255], + lightgreen:[144,238,144], + lightgrey:[211,211,211], + lightpink:[255,182,193], + lightyellow:[255,255,224], + lime:[0,255,0], + magenta:[255,0,255], + maroon:[128,0,0], + navy:[0,0,128], + olive:[128,128,0], + orange:[255,165,0], + pink:[255,192,203], + purple:[128,0,128], + violet:[128,0,128], + red:[255,0,0], + silver:[192,192,192], + white:[255,255,255], + yellow:[255,255,0], + transparent: [255,255,255] +}; + + + +/******************************************************************************/ +/****************************** CLASS ANIMATIONS ******************************/ +/******************************************************************************/ + +var classAnimationActions = ['add', 'remove', 'toggle'], + shorthandStyles = { + border: 1, + borderBottom: 1, + borderColor: 1, + borderLeft: 1, + borderRight: 1, + borderTop: 1, + borderWidth: 1, + margin: 1, + padding: 1 + }; + +function getElementStyles() { + var style = document.defaultView + ? document.defaultView.getComputedStyle(this, null) + : this.currentStyle, + newStyle = {}, + key, + camelCase; + + // webkit enumerates style porperties + if (style && style.length && style[0] && style[style[0]]) { + var len = style.length; + while (len--) { + key = style[len]; + if (typeof style[key] == 'string') { + camelCase = key.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + newStyle[camelCase] = style[key]; + } + } + } else { + for (key in style) { + if (typeof style[key] === 'string') { + newStyle[key] = style[key]; + } + } + } + + return newStyle; +} + +function filterStyles(styles) { + var name, value; + for (name in styles) { + value = styles[name]; + if ( + // ignore null and undefined values + value == null || + // ignore functions (when does this occur?) + $.isFunction(value) || + // shorthand styles that need to be expanded + name in shorthandStyles || + // ignore scrollbars (break in IE) + (/scrollbar/).test(name) || + + // only colors or values that can be converted to numbers + (!(/color/i).test(name) && isNaN(parseFloat(value))) + ) { + delete styles[name]; + } + } + + return styles; +} + +function styleDifference(oldStyle, newStyle) { + var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459 + name; + + for (name in newStyle) { + if (oldStyle[name] != newStyle[name]) { + diff[name] = newStyle[name]; + } + } + + return diff; +} + +$.effects.animateClass = function(value, duration, easing, callback) { + if ($.isFunction(easing)) { + callback = easing; + easing = null; + } + + return this.queue(function() { + var that = $(this), + originalStyleAttr = that.attr('style') || ' ', + originalStyle = filterStyles(getElementStyles.call(this)), + newStyle, + className = that.attr('class') || ""; + + $.each(classAnimationActions, function(i, action) { + if (value[action]) { + that[action + 'Class'](value[action]); + } + }); + newStyle = filterStyles(getElementStyles.call(this)); + that.attr('class', className); + + that.animate(styleDifference(originalStyle, newStyle), { + queue: false, + duration: duration, + easing: easing, + complete: function() { + $.each(classAnimationActions, function(i, action) { + if (value[action]) { that[action + 'Class'](value[action]); } + }); + // work around bug in IE by clearing the cssText before setting it + if (typeof that.attr('style') == 'object') { + that.attr('style').cssText = ''; + that.attr('style').cssText = originalStyleAttr; + } else { + that.attr('style', originalStyleAttr); + } + if (callback) { callback.apply(this, arguments); } + $.dequeue( this ); + } + }); + }); +}; + +$.fn.extend({ + _addClass: $.fn.addClass, + addClass: function(classNames, speed, easing, callback) { + return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); + }, + + _removeClass: $.fn.removeClass, + removeClass: function(classNames,speed,easing,callback) { + return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); + }, + + _toggleClass: $.fn.toggleClass, + toggleClass: function(classNames, force, speed, easing, callback) { + if ( typeof force == "boolean" || force === undefined ) { + if ( !speed ) { + // without speed parameter; + return this._toggleClass(classNames, force); + } else { + return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]); + } + } else { + // without switch parameter; + return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]); + } + }, + + switchClass: function(remove,add,speed,easing,callback) { + return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); + } +}); + + + +/******************************************************************************/ +/*********************************** EFFECTS **********************************/ +/******************************************************************************/ + +$.extend($.effects, { + version: "1.8.21", + + // Saves a set of properties in a data storage + save: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]); + } + }, + + // Restores a set of previously saved properties from a data storage + restore: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i])); + } + }, + + setMode: function(el, mode) { + if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle + return mode; + }, + + getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value + // this should be a little more flexible in the future to handle a string & hash + var y, x; + switch (origin[0]) { + case 'top': y = 0; break; + case 'middle': y = 0.5; break; + case 'bottom': y = 1; break; + default: y = origin[0] / original.height; + }; + switch (origin[1]) { + case 'left': x = 0; break; + case 'center': x = 0.5; break; + case 'right': x = 1; break; + default: x = origin[1] / original.width; + }; + return {x: x, y: y}; + }, + + // Wraps the element around a wrapper that copies position properties + createWrapper: function(element) { + + // if the element is already wrapped, return it + if (element.parent().is('.ui-effects-wrapper')) { + return element.parent(); + } + + // wrap the element + var props = { + width: element.outerWidth(true), + height: element.outerHeight(true), + 'float': element.css('float') + }, + wrapper = $('
            ') + .addClass('ui-effects-wrapper') + .css({ + fontSize: '100%', + background: 'transparent', + border: 'none', + margin: 0, + padding: 0 + }), + active = document.activeElement; + + // support: Firefox + // Firefox incorrectly exposes anonymous content + // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 + try { + active.id; + } catch( e ) { + active = document.body; + } + + element.wrap( wrapper ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element + + // transfer positioning properties to the wrapper + if (element.css('position') == 'static') { + wrapper.css({ position: 'relative' }); + element.css({ position: 'relative' }); + } else { + $.extend(props, { + position: element.css('position'), + zIndex: element.css('z-index') + }); + $.each(['top', 'left', 'bottom', 'right'], function(i, pos) { + props[pos] = element.css(pos); + if (isNaN(parseInt(props[pos], 10))) { + props[pos] = 'auto'; + } + }); + element.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' }); + } + + return wrapper.css(props).show(); + }, + + removeWrapper: function(element) { + var parent, + active = document.activeElement; + + if (element.parent().is('.ui-effects-wrapper')) { + parent = element.parent().replaceWith(element); + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + return parent; + } + + return element; + }, + + setTransition: function(element, list, factor, value) { + value = value || {}; + $.each(list, function(i, x){ + var unit = element.cssUnit(x); + if (unit[0] > 0) value[x] = unit[0] * factor + unit[1]; + }); + return value; + } +}); + + +function _normalizeArguments(effect, options, speed, callback) { + // shift params for method overloading + if (typeof effect == 'object') { + callback = options; + speed = null; + options = effect; + effect = options.effect; + } + if ($.isFunction(options)) { + callback = options; + speed = null; + options = {}; + } + if (typeof options == 'number' || $.fx.speeds[options]) { + callback = speed; + speed = options; + options = {}; + } + if ($.isFunction(speed)) { + callback = speed; + speed = null; + } + + options = options || {}; + + speed = speed || options.duration; + speed = $.fx.off ? 0 : typeof speed == 'number' + ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default; + + callback = callback || options.complete; + + return [effect, options, speed, callback]; +} + +function standardSpeed( speed ) { + // valid standard speeds + if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { + return true; + } + + // invalid strings - treat as "normal" speed + if ( typeof speed === "string" && !$.effects[ speed ] ) { + return true; + } + + return false; +} + +$.fn.extend({ + effect: function(effect, options, speed, callback) { + var args = _normalizeArguments.apply(this, arguments), + // TODO: make effects take actual parameters instead of a hash + args2 = { + options: args[1], + duration: args[2], + callback: args[3] + }, + mode = args2.options.mode, + effectMethod = $.effects[effect]; + + if ( $.fx.off || !effectMethod ) { + // delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args2.duration, args2.callback ); + } else { + return this.each(function() { + if ( args2.callback ) { + args2.callback.call( this ); + } + }); + } + } + + return effectMethod.call(this, args2); + }, + + _show: $.fn.show, + show: function(speed) { + if ( standardSpeed( speed ) ) { + return this._show.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'show'; + return this.effect.apply(this, args); + } + }, + + _hide: $.fn.hide, + hide: function(speed) { + if ( standardSpeed( speed ) ) { + return this._hide.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'hide'; + return this.effect.apply(this, args); + } + }, + + // jQuery core overloads toggle and creates _toggle + __toggle: $.fn.toggle, + toggle: function(speed) { + if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { + return this.__toggle.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'toggle'; + return this.effect.apply(this, args); + } + }, + + // helper functions + cssUnit: function(key) { + var style = this.css(key), val = []; + $.each( ['em','px','%','pt'], function(i, unit){ + if(style.indexOf(unit) > 0) + val = [parseFloat(style), unit]; + }); + return val; + } +}); + + + +/******************************************************************************/ +/*********************************** EASING ***********************************/ +/******************************************************************************/ + +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built in easing capabilities added In jQuery 1.1 + * to offer multiple easing options + * + * TERMS OF USE - jQuery Easing + * + * Open source under the BSD License. + * + * Copyright 2008 George McGinley Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * +*/ + +// t: current time, b: begInnIng value, c: change In value, d: duration +$.easing.jswing = $.easing.swing; + +$.extend($.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert($.easing.default); + return $.easing[$.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.drop.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.drop.js new file mode 100644 index 00000000..1fa5660b --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.drop.js @@ -0,0 +1,50 @@ +/*! + * jQuery UI Effects Drop 1.8.21 + * + * Copyright 2012, 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/Effects/Drop + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.drop = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','opacity']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + + // Animation + var animation = {opacity: mode == 'show' ? 1 : 0}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.explode.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.explode.js new file mode 100644 index 00000000..f50e2571 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.explode.js @@ -0,0 +1,79 @@ +/*! + * jQuery UI Effects Explode 1.8.21 + * + * Copyright 2012, 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/Effects/Explode + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.explode = function(o) { + + return this.queue(function() { + + var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + + o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode; + var el = $(this).show().css('visibility', 'hidden'); + var offset = el.offset(); + + //Substract the margins - not fixing the problem yet. + offset.top -= parseInt(el.css("marginTop"),10) || 0; + offset.left -= parseInt(el.css("marginLeft"),10) || 0; + + var width = el.outerWidth(true); + var height = el.outerHeight(true); + + for(var i=0;i') + .css({ + position: 'absolute', + visibility: 'visible', + left: -j*(width/cells), + top: -i*(height/rows) + }) + .parent() + .addClass('ui-effects-explode') + .css({ + position: 'absolute', + overflow: 'hidden', + width: width/cells, + height: height/rows, + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0), + opacity: o.options.mode == 'show' ? 0 : 1 + }).animate({ + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)), + opacity: o.options.mode == 'show' ? 1 : 0 + }, o.duration || 500); + } + } + + // Set a timeout, to call the callback approx. when the other animations have finished + setTimeout(function() { + + o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide(); + if(o.callback) o.callback.apply(el[0]); // Callback + el.dequeue(); + + $('div.ui-effects-explode').remove(); + + }, o.duration || 500); + + + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.fade.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.fade.js new file mode 100644 index 00000000..c62037f5 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.fade.js @@ -0,0 +1,32 @@ +/*! + * jQuery UI Effects Fade 1.8.21 + * + * Copyright 2012, 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/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fade = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'); + + elem.animate({ opacity: mode }, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.fold.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.fold.js new file mode 100644 index 00000000..a660eedb --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.fold.js @@ -0,0 +1,56 @@ +/*! + * jQuery UI Effects Fold 1.8.21 + * + * Copyright 2012, 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/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fold = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var size = o.options.size || 15; // Default fold size + var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value + var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var widthFirst = ((mode == 'show') != horizFirst); + var ref = widthFirst ? ['width', 'height'] : ['height', 'width']; + var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()]; + var percent = /([0-9]+)%/.exec(size); + if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1]; + if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift + + // Animation + var animation1 = {}, animation2 = {}; + animation1[ref[0]] = mode == 'show' ? distance[0] : size; + animation2[ref[1]] = mode == 'show' ? distance[1] : 0; + + // Animate + wrapper.animate(animation1, duration, o.options.easing) + .animate(animation2, duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.highlight.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.highlight.js new file mode 100644 index 00000000..e65bda35 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.highlight.js @@ -0,0 +1,50 @@ +/*! + * jQuery UI Effects Highlight 1.8.21 + * + * Copyright 2012, 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/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.highlight = function(o) { + return this.queue(function() { + var elem = $(this), + props = ['backgroundImage', 'backgroundColor', 'opacity'], + mode = $.effects.setMode(elem, o.options.mode || 'show'), + animation = { + backgroundColor: elem.css('backgroundColor') + }; + + if (mode == 'hide') { + animation.opacity = 0; + } + + $.effects.save(elem, props); + elem + .show() + .css({ + backgroundImage: 'none', + backgroundColor: o.options.color || '#ffff99' + }) + .animate(animation, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (mode == 'hide' && elem.hide()); + $.effects.restore(elem, props); + (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter')); + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.pulsate.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.pulsate.js new file mode 100644 index 00000000..a5121842 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.pulsate.js @@ -0,0 +1,51 @@ +/*! + * jQuery UI Effects Pulsate 1.8.21 + * + * Copyright 2012, 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/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.pulsate = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'show'), + times = ((o.options.times || 5) * 2) - 1, + duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2, + isVisible = elem.is(':visible'), + animateTo = 0; + + if (!isVisible) { + elem.css('opacity', 0).show(); + animateTo = 1; + } + + if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) { + times--; + } + + for (var i = 0; i < times; i++) { + elem.animate({ opacity: animateTo }, duration, o.options.easing); + animateTo = (animateTo + 1) % 2; + } + + elem.animate({ opacity: animateTo }, duration, o.options.easing, function() { + if (animateTo == 0) { + elem.hide(); + } + (o.callback && o.callback.apply(this, arguments)); + }); + + elem + .queue('fx', function() { elem.dequeue(); }) + .dequeue(); + }); +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.scale.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.scale.js new file mode 100644 index 00000000..c312195c --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.scale.js @@ -0,0 +1,178 @@ +/*! + * jQuery UI Effects Scale 1.8.21 + * + * Copyright 2012, 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/Effects/Scale + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.puff = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'), + percent = parseInt(o.options.percent, 10) || 150, + factor = percent / 100, + original = { height: elem.height(), width: elem.width() }; + + $.extend(o.options, { + fade: true, + mode: mode, + percent: mode == 'hide' ? percent : 100, + from: mode == 'hide' + ? original + : { + height: original.height * factor, + width: original.width * factor + } + }); + + elem.effect('scale', o.options, o.duration, o.callback); + elem.dequeue(); + }); +}; + +$.effects.scale = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var options = $.extend(true, {}, o.options); + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent + var direction = o.options.direction || 'both'; // Set default axis + var origin = o.options.origin; // The origin of the scaling + if (mode != 'effect') { // Set default origin and restore for show/hide + options.origin = origin || ['middle','center']; + options.restore = true; + } + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state + + // Adjust + var factor = { // Set scaling factor + y: direction != 'horizontal' ? (percent / 100) : 1, + x: direction != 'vertical' ? (percent / 100) : 1 + }; + el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state + + if (o.options.fade) { // Fade option to support puff + if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; + if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; + }; + + // Animation + options.from = el.from; options.to = el.to; options.mode = mode; + + // Animate + el.effect('size', options, o.duration, o.callback); + el.dequeue(); + }); + +}; + +$.effects.size = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','width','height','overflow','opacity']; + var props1 = ['position','top','bottom','left','right','overflow','opacity']; // Always restore + var props2 = ['width','height','overflow']; // Copy for children + var cProps = ['fontSize']; + var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; + var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var restore = o.options.restore || false; // Default restore + var scale = o.options.scale || 'both'; // Default scale mode + var origin = o.options.origin; // The origin of the sizing + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || original; // Default from state + el.to = o.options.to || original; // Default to state + // Adjust + if (origin) { // Calculate baseline shifts + var baseline = $.effects.getBaseline(origin, original); + el.from.top = (original.height - el.from.height) * baseline.y; + el.from.left = (original.width - el.from.width) * baseline.x; + el.to.top = (original.height - el.to.height) * baseline.y; + el.to.left = (original.width - el.to.width) * baseline.x; + }; + var factor = { // Set scaling factor + from: {y: el.from.height / original.height, x: el.from.width / original.width}, + to: {y: el.to.height / original.height, x: el.to.width / original.width} + }; + if (scale == 'box' || scale == 'both') { // Scale the css box + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(vProps); + el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + props = props.concat(hProps); + el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from); + el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to); + }; + }; + if (scale == 'content' || scale == 'both') { // Scale the content + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(cProps); + el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to); + }; + }; + $.effects.save(el, restore ? props : props1); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + el.css('overflow','hidden').css(el.from); // Shift + + // Animate + if (scale == 'content' || scale == 'both') { // Scale the children + vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size + hProps = hProps.concat(['marginLeft','marginRight']); // Add margins + props2 = props.concat(vProps).concat(hProps); // Concat + el.find("*[width]").each(function(){ + var child = $(this); + if (restore) $.effects.save(child, props2); + var c_original = {height: child.height(), width: child.width()}; // Save original + child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x}; + child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x}; + if (factor.from.y != factor.to.y) { // Vertical props scaling + child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from); + child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from); + child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to); + }; + child.css(child.from); // Shift children + child.animate(child.to, o.duration, o.options.easing, function(){ + if (restore) $.effects.restore(child, props2); // Restore children + }); // Animate children + }); + }; + + // Animate + el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if (el.to.opacity === 0) { + el.css('opacity', el.from.opacity); + } + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.shake.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.shake.js new file mode 100644 index 00000000..08ce5a84 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.shake.js @@ -0,0 +1,57 @@ +/*! + * jQuery UI Effects Shake 1.8.21 + * + * Copyright 2012, 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/Effects/Shake + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.shake = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'left'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 3; // Default # of times + var speed = o.duration || o.options.duration || 140; // Default speed per shake + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + + // Animation + var animation = {}, animation1 = {}, animation2 = {}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2; + animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2; + + // Animate + el.animate(animation, speed, o.options.easing); + for (var i = 1; i < times; i++) { // Shakes + el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing); + }; + el.animate(animation1, speed, o.options.easing). + animate(animation, speed / 2, o.options.easing, function(){ // Last shake + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.slide.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.slide.js new file mode 100644 index 00000000..3258a9ad --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.slide.js @@ -0,0 +1,50 @@ +/*! + * jQuery UI Effects Slide 1.8.21 + * + * Copyright 2012, 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/Effects/Slide + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.slide = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); + if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift + + // Animation + var animation = {}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.transfer.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.transfer.js new file mode 100644 index 00000000..97514f19 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.effects.transfer.js @@ -0,0 +1,45 @@ +/*! + * jQuery UI Effects Transfer 1.8.21 + * + * Copyright 2012, 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/Effects/Transfer + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.transfer = function(o) { + return this.queue(function() { + var elem = $(this), + target = $(o.options.to), + endPosition = target.offset(), + animation = { + top: endPosition.top, + left: endPosition.left, + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $('
            ') + .appendTo(document.body) + .addClass(o.options.className) + .css({ + top: startPosition.top, + left: startPosition.left, + height: elem.innerHeight(), + width: elem.innerWidth(), + position: 'absolute' + }) + .animate(animation, o.duration, o.options.easing, function() { + transfer.remove(); + (o.callback && o.callback.apply(elem[0], arguments)); + elem.dequeue(); + }); + }); +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.accordion.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.accordion.js new file mode 100644 index 00000000..fe0a729a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.accordion.js @@ -0,0 +1,611 @@ +/*! + * jQuery UI Accordion 1.8.21 + * + * Copyright 2012, 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/Accordion + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.accordion", { + options: { + active: 0, + animated: "slide", + autoHeight: true, + clearStyle: false, + collapsible: false, + event: "click", + fillSpace: false, + header: "> li > :first-child,> :not(li):even", + icons: { + header: "ui-icon-triangle-1-e", + headerSelected: "ui-icon-triangle-1-s" + }, + navigation: false, + navigationFilter: function() { + return this.href.toLowerCase() === location.href.toLowerCase(); + } + }, + + _create: function() { + var self = this, + options = self.options; + + self.running = 0; + + self.element + .addClass( "ui-accordion ui-widget ui-helper-reset" ) + // in lack of child-selectors in CSS + // we need to mark top-LIs in a UL-accordion for some IE-fix + .children( "li" ) + .addClass( "ui-accordion-li-fix" ); + + self.headers = self.element.find( options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ) + .bind( "mouseenter.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + }) + .bind( "mouseleave.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( "ui-state-hover" ); + }) + .bind( "focus.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-focus" ); + }) + .bind( "blur.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( "ui-state-focus" ); + }); + + self.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ); + + if ( options.navigation ) { + var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 ); + if ( current.length ) { + var header = current.closest( ".ui-accordion-header" ); + if ( header.length ) { + // anchor within header + self.active = header; + } else { + // anchor within content + self.active = current.closest( ".ui-accordion-content" ).prev(); + } + } + } + + self.active = self._findActive( self.active || options.active ) + .addClass( "ui-state-default ui-state-active" ) + .toggleClass( "ui-corner-all" ) + .toggleClass( "ui-corner-top" ); + self.active.next().addClass( "ui-accordion-content-active" ); + + self._createIcons(); + self.resize(); + + // ARIA + self.element.attr( "role", "tablist" ); + + self.headers + .attr( "role", "tab" ) + .bind( "keydown.accordion", function( event ) { + return self._keydown( event ); + }) + .next() + .attr( "role", "tabpanel" ); + + self.headers + .not( self.active || "" ) + .attr({ + "aria-expanded": "false", + "aria-selected": "false", + tabIndex: -1 + }) + .next() + .hide(); + + // make sure at least one header is in the tab order + if ( !self.active.length ) { + self.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + self.active + .attr({ + "aria-expanded": "true", + "aria-selected": "true", + tabIndex: 0 + }); + } + + // only need links in tab order for Safari + if ( !$.browser.safari ) { + self.headers.find( "a" ).attr( "tabIndex", -1 ); + } + + if ( options.event ) { + self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) { + self._clickHandler.call( self, event, this ); + event.preventDefault(); + }); + } + }, + + _createIcons: function() { + var options = this.options; + if ( options.icons ) { + $( "" ) + .addClass( "ui-icon " + options.icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-icon" ) + .toggleClass(options.icons.header) + .toggleClass(options.icons.headerSelected); + this.element.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers.children( ".ui-icon" ).remove(); + this.element.removeClass( "ui-accordion-icons" ); + }, + + destroy: function() { + var options = this.options; + + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + this.headers + .unbind( ".accordion" ) + .removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-selected" ) + .removeAttr( "tabIndex" ); + + this.headers.find( "a" ).removeAttr( "tabIndex" ); + this._destroyIcons(); + var contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role" ) + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" ); + if ( options.autoHeight || options.fillHeight ) { + contents.css( "height", "" ); + } + + return $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + + if ( key == "active" ) { + this.activate( value ); + } + if ( key == "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key == "disabled" ) { + this.headers.add(this.headers.next()) + [ value ? "addClass" : "removeClass" ]( + "ui-accordion-disabled ui-state-disabled" ); + } + }, + + _keydown: function( event ) { + if ( this.options.disabled || event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._clickHandler( { target: event.target }, event.target ); + event.preventDefault(); + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + return false; + } + + return true; + }, + + resize: function() { + var options = this.options, + maxHeight; + + if ( options.fillSpace ) { + if ( $.browser.msie ) { + var defOverflow = this.element.parent().css( "overflow" ); + this.element.parent().css( "overflow", "hidden"); + } + maxHeight = this.element.parent().height(); + if ($.browser.msie) { + this.element.parent().css( "overflow", defOverflow ); + } + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( options.autoHeight ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); + }) + .height( maxHeight ); + } + + return this; + }, + + activate: function( index ) { + // TODO this gets called on init, changing the option without an explicit call for that + this.options.active = index; + // call clickHandler with custom event + var active = this._findActive( index )[ 0 ]; + this._clickHandler( { target: active }, active ); + + return this; + }, + + _findActive: function( selector ) { + return selector + ? typeof selector === "number" + ? this.headers.filter( ":eq(" + selector + ")" ) + : this.headers.not( this.headers.not( selector ) ) + : selector === false + ? $( [] ) + : this.headers.filter( ":eq(0)" ); + }, + + // TODO isn't event.target enough? why the separate target argument? + _clickHandler: function( event, target ) { + var options = this.options; + if ( options.disabled ) { + return; + } + + // called only when using activate(false) to close all parts programmatically + if ( !event.target ) { + if ( !options.collapsible ) { + return; + } + this.active + .removeClass( "ui-state-active ui-corner-top" ) + .addClass( "ui-state-default ui-corner-all" ) + .children( ".ui-icon" ) + .removeClass( options.icons.headerSelected ) + .addClass( options.icons.header ); + this.active.next().addClass( "ui-accordion-content-active" ); + var toHide = this.active.next(), + data = { + options: options, + newHeader: $( [] ), + oldHeader: options.active, + newContent: $( [] ), + oldContent: toHide + }, + toShow = ( this.active = $( [] ) ); + this._toggle( toShow, toHide, data ); + return; + } + + // get the click target + var clicked = $( event.currentTarget || target ), + clickedIsActive = clicked[0] === this.active[0]; + + // TODO the option is changed, is that correct? + // TODO if it is correct, shouldn't that happen after determining that the click is valid? + options.active = options.collapsible && clickedIsActive ? + false : + this.headers.index( clicked ); + + // if animations are still active, or the active header is the target, ignore click + if ( this.running || ( !options.collapsible && clickedIsActive ) ) { + return; + } + + // find elements to show and hide + var active = this.active, + toShow = clicked.next(), + toHide = this.active.next(), + data = { + options: options, + newHeader: clickedIsActive && options.collapsible ? $([]) : clicked, + oldHeader: this.active, + newContent: clickedIsActive && options.collapsible ? $([]) : toShow, + oldContent: toHide + }, + down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $([]) : clicked; + this._toggle( toShow, toHide, data, clickedIsActive, down ); + + // switch classes + active + .removeClass( "ui-state-active ui-corner-top" ) + .addClass( "ui-state-default ui-corner-all" ) + .children( ".ui-icon" ) + .removeClass( options.icons.headerSelected ) + .addClass( options.icons.header ); + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-state-default ui-corner-all" ) + .addClass( "ui-state-active ui-corner-top" ) + .children( ".ui-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.headerSelected ); + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + + return; + }, + + _toggle: function( toShow, toHide, data, clickedIsActive, down ) { + var self = this, + options = self.options; + + self.toShow = toShow; + self.toHide = toHide; + self.data = data; + + var complete = function() { + if ( !self ) { + return; + } + return self._completed.apply( self, arguments ); + }; + + // trigger changestart event + self._trigger( "changestart", null, self.data ); + + // count elements to animate + self.running = toHide.size() === 0 ? toShow.size() : toHide.size(); + + if ( options.animated ) { + var animOptions = {}; + + if ( options.collapsible && clickedIsActive ) { + animOptions = { + toShow: $( [] ), + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight || options.fillSpace + }; + } else { + animOptions = { + toShow: toShow, + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight || options.fillSpace + }; + } + + if ( !options.proxied ) { + options.proxied = options.animated; + } + + if ( !options.proxiedDuration ) { + options.proxiedDuration = options.duration; + } + + options.animated = $.isFunction( options.proxied ) ? + options.proxied( animOptions ) : + options.proxied; + + options.duration = $.isFunction( options.proxiedDuration ) ? + options.proxiedDuration( animOptions ) : + options.proxiedDuration; + + var animations = $.ui.accordion.animations, + duration = options.duration, + easing = options.animated; + + if ( easing && !animations[ easing ] && !$.easing[ easing ] ) { + easing = "slide"; + } + if ( !animations[ easing ] ) { + animations[ easing ] = function( options ) { + this.slide( options, { + easing: easing, + duration: duration || 700 + }); + }; + } + + animations[ easing ]( animOptions ); + } else { + if ( options.collapsible && clickedIsActive ) { + toShow.toggle(); + } else { + toHide.hide(); + toShow.show(); + } + + complete( true ); + } + + // TODO assert that the blur and focus triggers are really necessary, remove otherwise + toHide.prev() + .attr({ + "aria-expanded": "false", + "aria-selected": "false", + tabIndex: -1 + }) + .blur(); + toShow.prev() + .attr({ + "aria-expanded": "true", + "aria-selected": "true", + tabIndex: 0 + }) + .focus(); + }, + + _completed: function( cancel ) { + this.running = cancel ? 0 : --this.running; + if ( this.running ) { + return; + } + + if ( this.options.clearStyle ) { + this.toShow.add( this.toHide ).css({ + height: "", + overflow: "" + }); + } + + // other classes are removed before the animation; this one needs to stay until completed + this.toHide.removeClass( "ui-accordion-content-active" ); + // Work around for rendering bug in IE (#5421) + if ( this.toHide.length ) { + this.toHide.parent()[0].className = this.toHide.parent()[0].className; + } + + this._trigger( "change", null, this.data ); + } +}); + +$.extend( $.ui.accordion, { + version: "1.8.21", + animations: { + slide: function( options, additions ) { + options = $.extend({ + easing: "swing", + duration: 300 + }, options, additions ); + if ( !options.toHide.size() ) { + options.toShow.animate({ + height: "show", + paddingTop: "show", + paddingBottom: "show" + }, options ); + return; + } + if ( !options.toShow.size() ) { + options.toHide.animate({ + height: "hide", + paddingTop: "hide", + paddingBottom: "hide" + }, options ); + return; + } + var overflow = options.toShow.css( "overflow" ), + percentDone = 0, + showProps = {}, + hideProps = {}, + fxAttrs = [ "height", "paddingTop", "paddingBottom" ], + originalWidth; + // fix width before calculating height of hidden element + var s = options.toShow; + originalWidth = s[0].style.width; + s.width( s.parent().width() + - parseFloat( s.css( "paddingLeft" ) ) + - parseFloat( s.css( "paddingRight" ) ) + - ( parseFloat( s.css( "borderLeftWidth" ) ) || 0 ) + - ( parseFloat( s.css( "borderRightWidth" ) ) || 0 ) ); + + $.each( fxAttrs, function( i, prop ) { + hideProps[ prop ] = "hide"; + + var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ ); + showProps[ prop ] = { + value: parts[ 1 ], + unit: parts[ 2 ] || "px" + }; + }); + options.toShow.css({ height: 0, overflow: "hidden" }).show(); + options.toHide + .filter( ":hidden" ) + .each( options.complete ) + .end() + .filter( ":visible" ) + .animate( hideProps, { + step: function( now, settings ) { + // only calculate the percent when animating height + // IE gets very inconsistent results when animating elements + // with small values, which is common for padding + if ( settings.prop == "height" ) { + percentDone = ( settings.end - settings.start === 0 ) ? 0 : + ( settings.now - settings.start ) / ( settings.end - settings.start ); + } + + options.toShow[ 0 ].style[ settings.prop ] = + ( percentDone * showProps[ settings.prop ].value ) + + showProps[ settings.prop ].unit; + }, + duration: options.duration, + easing: options.easing, + complete: function() { + if ( !options.autoHeight ) { + options.toShow.css( "height", "" ); + } + options.toShow.css({ + width: originalWidth, + overflow: overflow + }); + options.complete(); + } + }); + }, + bounceslide: function( options ) { + this.slide( options, { + easing: options.down ? "easeOutBounce" : "swing", + duration: options.down ? 1000 : 200 + }); + } + } +}); + +})( jQuery ); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.autocomplete.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.autocomplete.js new file mode 100644 index 00000000..f8009c61 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.autocomplete.js @@ -0,0 +1,631 @@ +/*! + * jQuery UI Autocomplete 1.8.21 + * + * Copyright 2012, 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/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + options: { + appendTo: "body", + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null + }, + + pending: 0, + + _create: function() { + var self = this, + doc = this.element[ 0 ].ownerDocument, + suppressKeyPress; + this.isMultiLine = this.element.is( "textarea" ); + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ) + // TODO verify these actually work as intended + .attr({ + role: "textbox", + "aria-autocomplete": "list", + "aria-haspopup": "true" + }) + .bind( "keydown.autocomplete", function( event ) { + if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) { + return; + } + + suppressKeyPress = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + self._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + self._move( "nextPage", event ); + break; + case keyCode.UP: + self._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + self._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( self.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + } + //passthrough - ENTER and TAB both select the current element + case keyCode.TAB: + if ( !self.menu.active ) { + return; + } + self.menu.select( event ); + break; + case keyCode.ESCAPE: + self.element.val( self.term ); + self.close( event ); + break; + default: + // keypress is triggered before the input value is changed + clearTimeout( self.searching ); + self.searching = setTimeout(function() { + // only search if the value has changed + if ( self.term != self.element.val() ) { + self.selectedItem = null; + self.search( null, event ); + } + }, self.options.delay ); + break; + } + }) + .bind( "keypress.autocomplete", function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + } + }) + .bind( "focus.autocomplete", function() { + if ( self.options.disabled ) { + return; + } + + self.selectedItem = null; + self.previous = self.element.val(); + }) + .bind( "blur.autocomplete", function( event ) { + if ( self.options.disabled ) { + return; + } + + clearTimeout( self.searching ); + // clicks on the menu (or a button to trigger a search) will cause a blur event + self.closing = setTimeout(function() { + self.close( event ); + self._change( event ); + }, 150 ); + }); + this._initSource(); + this.menu = $( "
              " ) + .addClass( "ui-autocomplete" ) + .appendTo( $( this.options.appendTo || "body", doc )[0] ) + // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown) + .mousedown(function( event ) { + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = self.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + setTimeout(function() { + $( document ).one( 'mousedown', function( event ) { + if ( event.target !== self.element[ 0 ] && + event.target !== menuElement && + !$.ui.contains( menuElement, event.target ) ) { + self.close(); + } + }); + }, 1 ); + } + + // use another timeout to make sure the blur-event-handler on the input was already triggered + setTimeout(function() { + clearTimeout( self.closing ); + }, 13); + }) + .menu({ + focus: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ); + if ( false !== self._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( /^key/.test(event.originalEvent.type) ) { + self.element.val( item.value ); + } + } + }, + selected: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ), + previous = self.previous; + + // only trigger when focus was lost (click on menu) + if ( self.element[0] !== doc.activeElement ) { + self.element.focus(); + self.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + setTimeout(function() { + self.previous = previous; + self.selectedItem = item; + }, 1); + } + + if ( false !== self._trigger( "select", event, { item: item } ) ) { + self.element.val( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + self.term = self.element.val(); + + self.close( event ); + self.selectedItem = item; + }, + blur: function( event, ui ) { + // don't set the value of the text field if it's already correct + // this prevents moving the cursor unnecessarily + if ( self.menu.element.is(":visible") && + ( self.element.val() !== self.term ) ) { + self.element.val( self.term ); + } + } + }) + .zIndex( this.element.zIndex() + 1 ) + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .hide() + .data( "menu" ); + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + self.beforeunloadHandler = function() { + self.element.removeAttr( "autocomplete" ); + }; + $( window ).bind( "beforeunload", self.beforeunloadHandler ); + }, + + destroy: function() { + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ) + .removeAttr( "role" ) + .removeAttr( "aria-autocomplete" ) + .removeAttr( "aria-haspopup" ); + this.menu.element.remove(); + $( window ).unbind( "beforeunload", this.beforeunloadHandler ); + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] ) + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _initSource: function() { + var self = this, + array, + url; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter(array, request.term) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( self.xhr ) { + self.xhr.abort(); + } + self.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data, status ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + search: function( value, event ) { + value = value != null ? value : this.element.val(); + + // always save the actual value, not the one passed as an argument + this.term = this.element.val(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + clearTimeout( this.closing ); + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var that = this, + index = ++requestIndex; + + return function( content ) { + if ( index === requestIndex ) { + that.__response( content ); + } + + that.pending--; + if ( !that.pending ) { + that.element.removeClass( "ui-autocomplete-loading" ); + } + }; + }, + + __response: function( content ) { + if ( !this.options.disabled && content && content.length ) { + content = this._normalize( content ); + this._suggest( content ); + this._trigger( "open" ); + } else { + this.close(); + } + }, + + close: function( event ) { + clearTimeout( this.closing ); + if ( this.menu.element.is(":visible") ) { + this.menu.element.hide(); + this.menu.deactivate(); + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this.element.val() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function(item) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate + this.menu.deactivate(); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next( new $.Event("mouseover") ); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var self = this; + $.each( items, function( index, item ) { + self._renderItem( ul, item ); + }); + }, + + _renderItem: function( ul, item) { + return $( "
            • " ) + .data( "item.autocomplete", item ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is(":visible") ) { + this.search( null, event ); + return; + } + if ( this.menu.first() && /^previous/.test(direction) || + this.menu.last() && /^next/.test(direction) ) { + this.element.val( this.term ); + this.menu.deactivate(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + +}( jQuery )); + +/* + * jQuery UI Menu (not officially released) + * + * This widget isn't yet finished and the API is subject to change. We plan to finish + * it for the next release. You're welcome to give it a try anyway and give us feedback, + * as long as you're okay with migrating your code later on. We can help with that, too. + * + * Copyright 2010, 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/Menu + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function($) { + +$.widget("ui.menu", { + _create: function() { + var self = this; + this.element + .addClass("ui-menu ui-widget ui-widget-content ui-corner-all") + .attr({ + role: "listbox", + "aria-activedescendant": "ui-active-menuitem" + }) + .click(function( event ) { + if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) { + return; + } + // temporary + event.preventDefault(); + self.select( event ); + }); + this.refresh(); + }, + + refresh: function() { + var self = this; + + // don't refresh list items that are already adapted + var items = this.element.children("li:not(.ui-menu-item):has(a)") + .addClass("ui-menu-item") + .attr("role", "menuitem"); + + items.children("a") + .addClass("ui-corner-all") + .attr("tabindex", -1) + // mouseenter doesn't work with event delegation + .mouseenter(function( event ) { + self.activate( event, $(this).parent() ); + }) + .mouseleave(function() { + self.deactivate(); + }); + }, + + activate: function( event, item ) { + this.deactivate(); + if (this.hasScroll()) { + var offset = item.offset().top - this.element.offset().top, + scroll = this.element.scrollTop(), + elementHeight = this.element.height(); + if (offset < 0) { + this.element.scrollTop( scroll + offset); + } else if (offset >= elementHeight) { + this.element.scrollTop( scroll + offset - elementHeight + item.height()); + } + } + this.active = item.eq(0) + .children("a") + .addClass("ui-state-hover") + .attr("id", "ui-active-menuitem") + .end(); + this._trigger("focus", event, { item: item }); + }, + + deactivate: function() { + if (!this.active) { return; } + + this.active.children("a") + .removeClass("ui-state-hover") + .removeAttr("id"); + this._trigger("blur"); + this.active = null; + }, + + next: function(event) { + this.move("next", ".ui-menu-item:first", event); + }, + + previous: function(event) { + this.move("prev", ".ui-menu-item:last", event); + }, + + 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(direction, edge, event) { + if (!this.active) { + this.activate(event, this.element.children(edge)); + return; + } + var next = this.active[direction + "All"](".ui-menu-item").eq(0); + if (next.length) { + this.activate(event, next); + } else { + this.activate(event, this.element.children(edge)); + } + }, + + // TODO merge with previousPage + nextPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.last()) { + this.activate(event, this.element.children(".ui-menu-item:first")); + return; + } + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base - height + $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:last"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.last() ? ":first" : ":last")); + } + }, + + // TODO merge with nextPage + previousPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.first()) { + this.activate(event, this.element.children(".ui-menu-item:last")); + return; + } + + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base + height - $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:first"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.first() ? ":last" : ":first")); + } + }, + + hasScroll: function() { + return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight"); + }, + + select: function( event ) { + this._trigger("selected", event, { item: this.active }); + } +}); + +}(jQuery)); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.button.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.button.js new file mode 100644 index 00000000..47bd6aa7 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.button.js @@ -0,0 +1,414 @@ +/*! + * jQuery UI Button 1.8.21 + * + * Copyright 2012, 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/Button + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var lastActive, startXPos, startYPos, clickDragged, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var buttons = $( this ).find( ":ui-button" ); + setTimeout(function() { + buttons.button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + options: { + disabled: null, + text: true, + label: null, + icons: { + primary: null, + secondary: null + } + }, + _create: function() { + this.element.closest( "form" ) + .unbind( "reset.button" ) + .bind( "reset.button", formResetHandler ); + + if ( typeof this.options.disabled !== "boolean" ) { + this.options.disabled = !!this.element.propAttr( "disabled" ); + } else { + this.element.propAttr( "disabled", this.options.disabled ); + } + + this._determineButtonType(); + this.hasTitle = !!this.buttonElement.attr( "title" ); + + var self = this, + options = this.options, + toggleButton = this.type === "checkbox" || this.type === "radio", + hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ), + focusClass = "ui-state-focus"; + + if ( options.label === null ) { + options.label = this.buttonElement.html(); + } + + this.buttonElement + .addClass( baseClasses ) + .attr( "role", "button" ) + .bind( "mouseenter.button", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + if ( this === lastActive ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "mouseleave.button", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( hoverClass ); + }) + .bind( "click.button", function( event ) { + if ( options.disabled ) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + }); + + this.element + .bind( "focus.button", function() { + // no need to check disabled, focus won't be triggered anyway + self.buttonElement.addClass( focusClass ); + }) + .bind( "blur.button", function() { + self.buttonElement.removeClass( focusClass ); + }); + + if ( toggleButton ) { + this.element.bind( "change.button", function() { + if ( clickDragged ) { + return; + } + self.refresh(); + }); + // if mouse moves between mousedown and mouseup (drag) set clickDragged flag + // prevents issue where button state changes but checkbox/radio checked state + // does not in Firefox (see ticket #6970) + this.buttonElement + .bind( "mousedown.button", function( event ) { + if ( options.disabled ) { + return; + } + clickDragged = false; + startXPos = event.pageX; + startYPos = event.pageY; + }) + .bind( "mouseup.button", function( event ) { + if ( options.disabled ) { + return; + } + if ( startXPos !== event.pageX || startYPos !== event.pageY ) { + clickDragged = true; + } + }); + } + + if ( this.type === "checkbox" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).toggleClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", self.element[0].checked ); + }); + } else if ( this.type === "radio" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", "true" ); + + var radio = self.element[ 0 ]; + radioGroup( radio ) + .not( radio ) + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + }); + } else { + this.buttonElement + .bind( "mousedown.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + lastActive = this; + $( document ).one( "mouseup", function() { + lastActive = null; + }); + }) + .bind( "mouseup.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).removeClass( "ui-state-active" ); + }) + .bind( "keydown.button", function(event) { + if ( options.disabled ) { + return false; + } + if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "keyup.button", function() { + $( this ).removeClass( "ui-state-active" ); + }); + + if ( this.buttonElement.is("a") ) { + this.buttonElement.keyup(function(event) { + if ( event.keyCode === $.ui.keyCode.SPACE ) { + // TODO pass through original event correctly (just as 2nd argument doesn't work) + $( this ).click(); + } + }); + } + } + + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins + this._setOption( "disabled", options.disabled ); + this._resetButton(); + }, + + _determineButtonType: function() { + + if ( this.element.is(":checkbox") ) { + this.type = "checkbox"; + } else if ( this.element.is(":radio") ) { + this.type = "radio"; + } else if ( this.element.is("input") ) { + this.type = "input"; + } else { + this.type = "button"; + } + + if ( this.type === "checkbox" || this.type === "radio" ) { + // we don't search against the document in case the element + // is disconnected from the DOM + var ancestor = this.element.parents().filter(":last"), + labelSelector = "label[for='" + this.element.attr("id") + "']"; + this.buttonElement = ancestor.find( labelSelector ); + if ( !this.buttonElement.length ) { + ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings(); + this.buttonElement = ancestor.filter( labelSelector ); + if ( !this.buttonElement.length ) { + this.buttonElement = ancestor.find( labelSelector ); + } + } + this.element.addClass( "ui-helper-hidden-accessible" ); + + var checked = this.element.is( ":checked" ); + if ( checked ) { + this.buttonElement.addClass( "ui-state-active" ); + } + this.buttonElement.attr( "aria-pressed", checked ); + } else { + this.buttonElement = this.element; + } + }, + + widget: function() { + return this.buttonElement; + }, + + destroy: function() { + this.element + .removeClass( "ui-helper-hidden-accessible" ); + this.buttonElement + .removeClass( baseClasses + " " + stateClasses + " " + typeClasses ) + .removeAttr( "role" ) + .removeAttr( "aria-pressed" ) + .html( this.buttonElement.find(".ui-button-text").html() ); + + if ( !this.hasTitle ) { + this.buttonElement.removeAttr( "title" ); + } + + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "disabled" ) { + if ( value ) { + this.element.propAttr( "disabled", true ); + } else { + this.element.propAttr( "disabled", false ); + } + return; + } + this._resetButton(); + }, + + refresh: function() { + var isDisabled = this.element.is( ":disabled" ); + if ( isDisabled !== this.options.disabled ) { + this._setOption( "disabled", isDisabled ); + } + if ( this.type === "radio" ) { + radioGroup( this.element[0] ).each(function() { + if ( $( this ).is( ":checked" ) ) { + $( this ).button( "widget" ) + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + $( this ).button( "widget" ) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + }); + } else if ( this.type === "checkbox" ) { + if ( this.element.is( ":checked" ) ) { + this.buttonElement + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + this.buttonElement + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + } + }, + + _resetButton: function() { + if ( this.type === "input" ) { + if ( this.options.label ) { + this.element.val( this.options.label ); + } + return; + } + var buttonElement = this.buttonElement.removeClass( typeClasses ), + buttonText = $( "", this.element[0].ownerDocument ) + .addClass( "ui-button-text" ) + .html( this.options.label ) + .appendTo( buttonElement.empty() ) + .text(), + icons = this.options.icons, + multipleIcons = icons.primary && icons.secondary, + buttonClasses = []; + + if ( icons.primary || icons.secondary ) { + if ( this.options.text ) { + buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + } + + if ( icons.primary ) { + buttonElement.prepend( "" ); + } + + if ( icons.secondary ) { + buttonElement.append( "" ); + } + + if ( !this.options.text ) { + buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); + + if ( !this.hasTitle ) { + buttonElement.attr( "title", buttonText ); + } + } + } else { + buttonClasses.push( "ui-button-text-only" ); + } + buttonElement.addClass( buttonClasses.join( " " ) ); + } +}); + +$.widget( "ui.buttonset", { + options: { + items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" + }, + + _create: function() { + this.element.addClass( "ui-buttonset" ); + }, + + _init: function() { + this.refresh(); + }, + + _setOption: function( key, value ) { + if ( key === "disabled" ) { + this.buttons.button( "option", key, value ); + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + refresh: function() { + var rtl = this.element.css( "direction" ) === "rtl"; + + this.buttons = this.element.find( this.options.items ) + .filter( ":ui-button" ) + .button( "refresh" ) + .end() + .not( ":ui-button" ) + .button() + .end() + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) + .filter( ":first" ) + .addClass( rtl ? "ui-corner-right" : "ui-corner-left" ) + .end() + .filter( ":last" ) + .addClass( rtl ? "ui-corner-left" : "ui-corner-right" ) + .end() + .end(); + }, + + destroy: function() { + this.element.removeClass( "ui-buttonset" ); + this.buttons + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-left ui-corner-right" ) + .end() + .button( "destroy" ); + + $.Widget.prototype.destroy.call( this ); + } +}); + +}( jQuery ) ); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.core.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.core.js new file mode 100644 index 00000000..2a8a2c18 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.core.js @@ -0,0 +1,319 @@ +/*! + * jQuery UI 1.8.21 + * + * Copyright 2012, 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( $, undefined ) { + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.8.21", + + keyCode: { + ALT: 18, + BACKSPACE: 8, + CAPS_LOCK: 20, + COMMA: 188, + COMMAND: 91, + COMMAND_LEFT: 91, // COMMAND + COMMAND_RIGHT: 93, + CONTROL: 17, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + INSERT: 45, + LEFT: 37, + MENU: 93, // COMMAND_RIGHT + 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 // COMMAND + } +}); + +// plugins +$.fn.extend({ + propAttr: $.fn.prop || $.fn.attr, + + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
              + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + if ( border ) { + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; +}); + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + var map = element.parentNode, + mapName = map.name, + img; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) + ? !element.disabled + : "a" == nodeName + ? element.href || isTabIndexNotNaN + : isTabIndexNotNaN) + // the element and all of its ancestors must be visible + && visible( element ); +} + +function visible( element ) { + return !$( element ).parents().andSelf().filter(function() { + return $.curCSS( this, "visibility" ) === "hidden" || + $.expr.filters.hidden( this ); + }).length; +} + +$.extend( $.expr[ ":" ], { + data: function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + // access offsetHeight before setting the style to prevent a layout bug + // in IE 9 which causes the elemnt to continue to take up space even + // after it is removed from the DOM (#8026) + div.offsetHeight; + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + + + + + +// deprecated +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var proto = $.ui[ module ].prototype; + for ( var i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode ) { + return; + } + + for ( var i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains() + contains: function( a, b ) { + return document.compareDocumentPosition ? + a.compareDocumentPosition( b ) & 16 : + a !== b && a.contains( b ); + }, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.datepicker.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.datepicker.js new file mode 100644 index 00000000..8ca1b152 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.datepicker.js @@ -0,0 +1,1824 @@ +/*! + * jQuery UI Datepicker 1.8.21 + * + * Copyright 2012, 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/Datepicker + * + * Depends: + * jquery.ui.core.js + */ +(function( $, undefined ) { + +$.extend($.ui, { datepicker: { version: "1.8.21" } }); + +var PROP_NAME = 'datepicker'; +var dpuuid = new Date().getTime(); +var instActive; + +/* Date picker manager. + Use the singleton instance of this class, $.datepicker, to interact with the date picker. + Settings for (groups of) date pickers are maintained in an instance object, + allowing multiple different settings on the same page. */ + +function Datepicker() { + this.debug = false; // Change this to true to start debugging + this._curInst = null; // The current instance in use + this._keyEvent = false; // If the last event was a key event + this._disabledInputs = []; // List of date picker inputs that have been disabled + this._datepickerShowing = false; // True if the popup picker is showing , false if not + this._inDialog = false; // True if showing within a "dialog", false if not + this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division + this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class + this._appendClass = 'ui-datepicker-append'; // The name of the append marker class + this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class + this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class + this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class + this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class + this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class + this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + closeText: 'Done', // Display text for close link + prevText: 'Prev', // Display text for previous month link + nextText: 'Next', // Display text for next month link + currentText: 'Today', // Display text for current month link + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], // Names of months for drop-down and formatting + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday + weekHeader: 'Wk', // Column header for week of the year + dateFormat: 'mm/dd/yy', // See format options on parseDate + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... + isRTL: false, // True if right-to-left language, false if left-to-right + showMonthAfterYear: false, // True if the year select precedes month, false for month then year + yearSuffix: '' // Additional text to append to the year in the month headers + }; + this._defaults = { // Global defaults for all the date picker instances + showOn: 'focus', // 'focus' for popup on focus, + // 'button' for trigger button, or 'both' for either + showAnim: 'fadeIn', // Name of jQuery animation for popup + showOptions: {}, // Options for enhanced animations + defaultDate: null, // Used when field is blank: actual date, + // +/-number for offset from today, null for today + appendText: '', // Display text following the input box, e.g. showing the format + buttonText: '...', // Text for trigger button + buttonImage: '', // URL for trigger button image + buttonImageOnly: false, // True if the image appears alone, false if it appears on a button + hideIfNoPrevNext: false, // True to hide next/previous month links + // if not applicable, false to just disable them + navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links + gotoCurrent: false, // True if today link goes back to current selection instead + changeMonth: false, // True if month can be selected directly, false if only prev/next + changeYear: false, // True if year can be selected directly, false if only prev/next + yearRange: 'c-10:c+10', // Range of years to display in drop-down, + // either relative to today's year (-nn:+nn), relative to currently displayed year + // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) + showOtherMonths: false, // True to show dates in other months, false to leave blank + selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable + showWeek: false, // True to show week of the year, false to not show it + calculateWeek: this.iso8601Week, // How to calculate the week of the year, + // takes a Date and returns the number of the week for it + shortYearCutoff: '+10', // Short year values < this are in the current century, + // > this are in the previous century, + // string value starting with '+' for current year + value + minDate: null, // The earliest selectable date, or null for no limit + maxDate: null, // The latest selectable date, or null for no limit + duration: 'fast', // Duration of display/closure + beforeShowDay: null, // Function that takes a date and returns an array with + // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', + // [2] = cell title (optional), e.g. $.datepicker.noWeekends + beforeShow: null, // Function that takes an input field and + // returns a set of custom settings for the date picker + onSelect: null, // Define a callback function when a date is selected + onChangeMonthYear: null, // Define a callback function when the month or year is changed + onClose: null, // Define a callback function when the datepicker is closed + numberOfMonths: 1, // Number of months to show at a time + showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) + stepMonths: 1, // Number of months to step back/forward + stepBigMonths: 12, // Number of months to step back/forward for the big links + altField: '', // Selector for an alternate field to store selected dates into + altFormat: '', // The date format to use for the alternate field + constrainInput: true, // The input is constrained by the current date format + showButtonPanel: false, // True to show button panel, false to not show it + autoSize: false, // True to size the input for the date format, false to leave as is + disabled: false // The initial disabled state + }; + $.extend(this._defaults, this.regional['']); + this.dpDiv = bindHover($('
              ')); +} + +$.extend(Datepicker.prototype, { + /* Class name added to elements to indicate already configured with a date picker. */ + markerClassName: 'hasDatepicker', + + //Keep track of the maximum number of rows displayed (see #7043) + maxRows: 4, + + /* Debug logging (if enabled). */ + log: function () { + if (this.debug) + console.log.apply('', arguments); + }, + + // TODO rename to "widget" when switching to widget factory + _widgetDatepicker: function() { + return this.dpDiv; + }, + + /* Override the default settings for all instances of the date picker. + @param settings object - the new settings to use as defaults (anonymous object) + @return the manager object */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* Attach the date picker to a jQuery selection. + @param target element - the target input field or division or span + @param settings object - the new settings to use for this date picker instance (anonymous) */ + _attachDatepicker: function(target, settings) { + // check for settings on the control itself - in namespace 'date:' + var inlineSettings = null; + for (var attrName in this._defaults) { + var attrValue = target.getAttribute('date:' + attrName); + if (attrValue) { + inlineSettings = inlineSettings || {}; + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + var nodeName = target.nodeName.toLowerCase(); + var inline = (nodeName == 'div' || nodeName == 'span'); + if (!target.id) { + this.uuid += 1; + target.id = 'dp' + this.uuid; + } + var inst = this._newInst($(target), inline); + inst.settings = $.extend({}, settings || {}, inlineSettings || {}); + if (nodeName == 'input') { + this._connectDatepicker(target, inst); + } else if (inline) { + this._inlineDatepicker(target, inst); + } + }, + + /* Create a new instance object. */ + _newInst: function(target, inline) { + var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars + return {id: id, input: target, // associated target + selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection + drawMonth: 0, drawYear: 0, // month being drawn + inline: inline, // is datepicker inline or not + dpDiv: (!inline ? this.dpDiv : // presentation div + bindHover($('
              ')))}; + }, + + /* Attach the date picker to an input field. */ + _connectDatepicker: function(target, inst) { + var input = $(target); + inst.append = $([]); + inst.trigger = $([]); + if (input.hasClass(this.markerClassName)) + return; + this._attachments(input, inst); + input.addClass(this.markerClassName).keydown(this._doKeyDown). + keypress(this._doKeyPress).keyup(this._doKeyUp). + bind("setData.datepicker", function(event, key, value) { + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key) { + return this._get(inst, key); + }); + this._autoSize(inst); + $.data(target, PROP_NAME, inst); + //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + }, + + /* Make attachments based on settings. */ + _attachments: function(input, inst) { + var appendText = this._get(inst, 'appendText'); + var isRTL = this._get(inst, 'isRTL'); + if (inst.append) + inst.append.remove(); + if (appendText) { + inst.append = $('' + appendText + ''); + input[isRTL ? 'before' : 'after'](inst.append); + } + input.unbind('focus', this._showDatepicker); + if (inst.trigger) + inst.trigger.remove(); + var showOn = this._get(inst, 'showOn'); + if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field + input.focus(this._showDatepicker); + if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked + var buttonText = this._get(inst, 'buttonText'); + var buttonImage = this._get(inst, 'buttonImage'); + inst.trigger = $(this._get(inst, 'buttonImageOnly') ? + $('').addClass(this._triggerClass). + attr({ src: buttonImage, alt: buttonText, title: buttonText }) : + $('').addClass(this._triggerClass). + html(buttonImage == '' ? buttonText : $('').attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? 'before' : 'after'](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) + $.datepicker._hideDatepicker(); + else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) { + $.datepicker._hideDatepicker(); + $.datepicker._showDatepicker(input[0]); + } else + $.datepicker._showDatepicker(input[0]); + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, 'autoSize') && !inst.inline) { + var date = new Date(2009, 12 - 1, 20); // Ensure double digits + var dateFormat = this._get(inst, 'dateFormat'); + if (dateFormat.match(/[DM]/)) { + var findMax = function(names) { + var max = 0; + var maxI = 0; + for (var i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + 'monthNames' : 'monthNamesShort')))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); + } + inst.input.attr('size', this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) + return; + divSpan.addClass(this.markerClassName).append(inst.dpDiv). + bind("setData.datepicker", function(event, key, value){ + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return this._get(inst, key); + }); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + //If disabled option is true, disable the datepicker before showing it (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); + }, + + /* Pop-up the date picker in a "dialog" box. + @param input element - ignored + @param date string or Date - the initial date to display + @param onSelect function - the function to call when a date is selected + @param settings object - update the dialog date picker instance's settings (anonymous object) + @param pos int[2] - coordinates for the dialog's position within the screen or + event - with x/y coordinates or + leave empty for default (screen centre) + @return the manager object */ + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + this.uuid += 1; + var id = 'dp' + this.uuid; + this._dialogInput = $(''); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = document.documentElement.clientWidth; + var browserHeight = document.documentElement.clientHeight; + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this.dpDiv); + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName == 'input') { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind('focus', this._showDatepicker). + unbind('keydown', this._doKeyDown). + unbind('keypress', this._doKeyPress). + unbind('keyup', this._doKeyUp); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = false; + inst.trigger.filter('button'). + each(function() { this.disabled = false; }).end(). + filter('img').css({opacity: '1.0', cursor: ''}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().removeClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + removeAttr("disabled"); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _disableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = true; + inst.trigger.filter('button'). + each(function() { this.disabled = true; }).end(). + filter('img').css({opacity: '0.5', cursor: 'default'}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().addClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + attr("disabled", "disabled"); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + @param target element - the target input field or division or span + @return boolean - true if disabled, false if enabled */ + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Retrieve the instance data for the target control. + @param target element - the target input field or division or span + @return object - the associated instance data + @throws error if a jQuery problem getting data */ + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw 'Missing instance data for this datepicker'; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. + @param target element - the target input field or division or span + @param name object - the new settings to update or + string - the name of the setting to change or retrieve, + when retrieving also 'all' for all instance settings or + 'defaults' for all global defaults + @param value any - the new value for the setting + (omit if above is an object or to retrieve a value) */ + _optionDatepicker: function(target, name, value) { + var inst = this._getInst(target); + if (arguments.length == 2 && typeof name == 'string') { + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : + (inst ? (name == 'all' ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst) { + if (this._curInst == inst) { + this._hideDatepicker(); + } + var date = this._getDateDatepicker(target, true); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + extendRemove(inst.settings, settings); + // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided + if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined) + inst.settings.minDate = this._formatDate(inst, minDate); + if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined) + inst.settings.maxDate = this._formatDate(inst, maxDate); + this._attachments($(target), inst); + this._autoSize(inst); + this._setDate(inst, date); + this._updateAlternate(inst); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + @param target element - the target input field or division or span */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + @param target element - the target input field or division or span + @param date Date - the new date */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @param noDefault boolean - true if no default date is to be used + @return Date - the current date */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) + this._setDateFromField(inst, noDefault); + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var inst = $.datepicker._getInst(event.target); + var handled = true; + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + + $.datepicker._currentClass + ')', inst.dpDiv); + if (sel[0]) + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + var onSelect = $.datepicker._get(inst, 'onSelect'); + if (onSelect) { + var dateStr = $.datepicker._formatDate(inst); + + // trigger custom callback + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); + } + else + $.datepicker._hideDatepicker(); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + else { + handled = false; + } + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var inst = $.datepicker._getInst(event.target); + if ($.datepicker._get(inst, 'constrainInput')) { + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var inst = $.datepicker._getInst(event.target); + if (inst.input.val() != inst.lastVal) { + try { + var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (err) { + $.datepicker.log(err); + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + If false returned from beforeShow event handler do not show. + @param input element - the input field attached to the date picker or + event - if triggered by focus */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger + input = $('input', input.parentNode)[0]; + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here + return; + var inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst != inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + if ( inst && $.datepicker._datepickerShowing ) { + $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); + } + } + var beforeShow = $.datepicker._get(inst, 'beforeShow'); + var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; + if(beforeShowSettings === false){ + //false + return; + } + extendRemove(inst.settings, beforeShowSettings); + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + if ($.datepicker._inDialog) // hide cursor + input.value = ''; + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + var isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css('position') == 'fixed'; + return !isFixed; + }); + if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled + $.datepicker._pos[0] -= document.documentElement.scrollLeft; + $.datepicker._pos[1] -= document.documentElement.scrollTop; + } + var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', + left: offset.left + 'px', top: offset.top + 'px'}); + if (!inst.inline) { + var showAnim = $.datepicker._get(inst, 'showAnim'); + var duration = $.datepicker._get(inst, 'duration'); + var postProcess = function() { + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !! cover.length ){ + var borders = $.datepicker._getBorders(inst.dpDiv); + cover.css({left: -borders[0], top: -borders[1], + width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); + } + }; + inst.dpDiv.zIndex($(input).zIndex()+1); + $.datepicker._datepickerShowing = true; + if ($.effects && $.effects[showAnim]) + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); + if (!showAnim || !duration) + postProcess(); + if (inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + var self = this; + self.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + var borders = $.datepicker._getBorders(inst.dpDiv); + instActive = inst; // for delegate hover events + inst.dpDiv.empty().append(this._generateHTML(inst)); + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6 + cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) + } + inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover(); + var numMonths = this._getNumberOfMonths(inst); + var cols = numMonths[1]; + var width = 17; + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); + if (cols > 1) + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + + 'Class']('ui-datepicker-multi'); + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + + 'Class']('ui-datepicker-rtl'); + if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) + inst.input.focus(); + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + var origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml && inst.yearshtml ){ + inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + /* Retrieve the size of left and top borders for an element. + @param elem (jQuery object) the element of interest + @return (number[2]) the left and top borders */ + _getBorders: function(elem) { + var convert = function(value) { + return {thin: 1, medium: 2, thick: 3}[value] || value; + }; + return [parseFloat(convert(elem.css('border-left-width'))), + parseFloat(convert(elem.css('border-top-width')))]; + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(); + var dpHeight = inst.dpDiv.outerHeight(); + var inputWidth = inst.input ? inst.input.outerWidth() : 0; + var inputHeight = inst.input ? inst.input.outerHeight() : 0; + var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); + var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); + + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var inst = this._getInst(obj); + var isRTL = this._get(inst, 'isRTL'); + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; + } + var position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + @param input element - the input field attached to the date picker */ + _hideDatepicker: function(input) { + var inst = this._curInst; + if (!inst || (input && inst != $.data(input, PROP_NAME))) + return; + if (this._datepickerShowing) { + var showAnim = this._get(inst, 'showAnim'); + var duration = this._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._tidyDialog(inst); + }; + if ($.effects && $.effects[showAnim]) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); + if (!showAnim) + postProcess(); + this._datepickerShowing = false; + var onClose = this._get(inst, 'onClose'); + if (onClose) + onClose.apply((inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + + var $target = $(event.target), + inst = $.datepicker._getInst($target[0]); + + if ( ( ( $target[0].id != $.datepicker._mainDivId && + $target.parents('#' + $.datepicker._mainDivId).length == 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.closest("." + $.datepicker._triggerClass).length && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || + ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) ) + $.datepicker._hideDatepicker(); + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } + else { + var date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id); + var inst = this._getInst(target[0]); + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = + parseInt(select.options[select.selectedIndex].value,10); + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var target = $(id); + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + var inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $('a', td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + this._selectDate(target, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var target = $(id); + var inst = this._getInst(target[0]); + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) + inst.input.val(dateStr); + this._updateAlternate(inst); + var onSelect = this._get(inst, 'onSelect'); + if (onSelect) + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + else if (inst.input) + inst.input.trigger('change'); // fire the change event + if (inst.inline) + this._updateDatepicker(inst); + else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) != 'object') + inst.input.focus(); // restore focus + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altField = this._get(inst, 'altField'); + if (altField) { // update alternate field too + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); + var date = this._getDate(inst); + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + @param date Date - the date to customise + @return [boolean, string] - is this date selectable?, what is its CSS class? */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), '']; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + @param date Date - the date to get the week for + @return number - the number of the week within the year that contains this date */ + iso8601Week: function(date) { + var checkDate = new Date(date.getTime()); + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + var time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + See formatDate below for the possible formats. + + @param format string - the expected format of the date + @param value string - the date in the above format + @param settings Object - attributes include: + shortYearCutoff number - the cutoff year for determining the century (optional) + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return Date - the extracted date value or null if value is blank */ + parseDate: function (format, value, settings) { + if (format == null || value == null) + throw 'Invalid arguments'; + value = (typeof value == 'object' ? value.toString() : value + ''); + if (value == '') + return null; + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + var year = -1; + var month = -1; + var day = -1; + var doy = -1; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Extract a number from the string value + var getNumber = function(match) { + var isDoubled = lookAhead(match); + var size = (match == '@' ? 14 : (match == '!' ? 20 : + (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); + var digits = new RegExp('^\\d{1,' + size + '}'); + var num = value.substring(iValue).match(digits); + if (!num) + throw 'Missing number at position ' + iValue; + iValue += num[0].length; + return parseInt(num[0], 10); + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + var index = -1; + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; + } + }); + if (index != -1) + return index + 1; + else + throw 'Unknown name at position ' + iValue; + }; + // Confirm that a literal character matches the string value + var checkLiteral = function() { + if (value.charAt(iValue) != format.charAt(iFormat)) + throw 'Unexpected literal at position ' + iValue; + iValue++; + }; + var iValue = 0; + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + checkLiteral(); + else + switch (format.charAt(iFormat)) { + case 'd': + day = getNumber('d'); + break; + case 'D': + getName('D', dayNamesShort, dayNames); + break; + case 'o': + doy = getNumber('o'); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case '@': + var date = new Date(getNumber('@')); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case '!': + var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (iValue < value.length){ + throw "Extra/unparsed characters found in date: " + value.substring(iValue); + } + if (year == -1) + year = new Date().getFullYear(); + else if (year < 100) + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + if (doy > -1) { + month = 1; + day = doy; + do { + var dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) + break; + month++; + day -= dim; + } while (true); + } + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) + throw 'Invalid date'; // E.g. 31/02/00 + return date; + }, + + /* Standard date formats. */ + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) + COOKIE: 'D, dd M yy', + ISO_8601: 'yy-mm-dd', + RFC_822: 'D, d M y', + RFC_850: 'DD, dd-M-y', + RFC_1036: 'D, d M y', + RFC_1123: 'D, d M yy', + RFC_2822: 'D, d M yy', + RSS: 'D, d M y', // RFC 822 + TICKS: '!', + TIMESTAMP: '@', + W3C: 'yy-mm-dd', // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. + The format can be combinations of the following: + d - day of month (no leading zero) + dd - day of month (two digit) + o - day of year (no leading zeros) + oo - day of year (three digit) + D - day name short + DD - day name long + m - month of year (no leading zero) + mm - month of year (two digit) + M - month name short + MM - month name long + y - year (two digit) + yy - year (four digit) + @ - Unix timestamp (ms since 01/01/1970) + ! - Windows ticks (100ns since 01/01/0001) + '...' - literal text + '' - single quote + + @param format string - the desired format of the date + @param date Date - the date value to format + @param settings Object - attributes include: + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return string - the date in the above format */ + formatDate: function (format, date, settings) { + if (!date) + return ''; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Format a number, with leading zero if necessary + var formatNumber = function(match, value, len) { + var num = '' + value; + if (lookAhead(match)) + while (num.length < len) + num = '0' + num; + return num; + }; + // Format a name, short or long as requested + var formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }; + var output = ''; + var literal = false; + if (date) + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + output += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': + output += formatNumber('d', date.getDate(), 2); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'o': + output += formatNumber('o', + Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1, 2); + break; + case 'M': + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); + break; + case 'y': + output += (lookAhead('y') ? date.getFullYear() : + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); + break; + case '@': + output += date.getTime(); + break; + case '!': + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) + output += "'"; + else + literal = true; + break; + default: + output += format.charAt(iFormat); + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var chars = ''; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + for (var iFormat = 0; iFormat < format.length; iFormat++) + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + chars += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': case 'm': case 'y': case '@': + chars += '0123456789'; + break; + case 'D': case 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() == inst.lastVal) { + return; + } + var dateFormat = this._get(inst, 'dateFormat'); + var dates = inst.lastVal = inst.input ? inst.input.val() : null; + var date, defaultDate; + date = defaultDate = this._getDefaultDate(inst); + var settings = this._getFormatConfig(inst); + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + this.log(event); + dates = (noDefault ? '' : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(); + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += parseInt(matches[1],10); break; + case 'w' : case 'W' : + day += parseInt(matches[1],10) * 7; break; + case 'm' : case 'M' : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }; + var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) : + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + Hours may be non-zero on daylight saving cut-over: + > 12 when midnight changeover, but then cannot generate + midnight datetime, so jump to 1AM, otherwise reset. + @param date (Date) the date to check + @return (Date) the corrected date */ + _daylightSavingAdjust: function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date; + var origMonth = inst.selectedMonth; + var origYear = inst.selectedYear; + var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) + this._notifyChange(inst); + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? '' : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var today = new Date(); + today = this._daylightSavingAdjust( + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time + var isRTL = this._get(inst, 'isRTL'); + var showButtonPanel = this._get(inst, 'showButtonPanel'); + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); + var numMonths = this._getNumberOfMonths(inst); + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); + var stepMonths = this._get(inst, 'stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var drawMonth = inst.drawMonth - showCurrentAtPos; + var drawYear = inst.drawYear; + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + var prevText = this._get(inst, 'prevText'); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + '' + prevText + '' : + (hideIfNoPrevNext ? '' : '' + prevText + '')); + var nextText = this._get(inst, 'nextText'); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + '' + nextText + '' : + (hideIfNoPrevNext ? '' : '' + nextText + '')); + var currentText = this._get(inst, 'currentText'); + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + var controls = (!inst.inline ? '' : ''); + var buttonPanel = (showButtonPanel) ? '
              ' + (isRTL ? controls : '') + + (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
              ' : ''; + var firstDay = parseInt(this._get(inst, 'firstDay'),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + var showWeek = this._get(inst, 'showWeek'); + var dayNames = this._get(inst, 'dayNames'); + var dayNamesShort = this._get(inst, 'dayNamesShort'); + var dayNamesMin = this._get(inst, 'dayNamesMin'); + var monthNames = this._get(inst, 'monthNames'); + var monthNamesShort = this._get(inst, 'monthNamesShort'); + var beforeShowDay = this._get(inst, 'beforeShowDay'); + var showOtherMonths = this._get(inst, 'showOtherMonths'); + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; + var defaultDate = this._getDefaultDate(inst); + var html = ''; + for (var row = 0; row < numMonths[0]; row++) { + var group = ''; + this.maxRows = 4; + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + var cornerClass = ' ui-corner-all'; + var calender = ''; + if (isMultiMonth) { + calender += '
              '; + } + calender += '
              ' + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + '
              ' + + ''; + var thead = (showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + + '' + dayNamesMin[day] + ''; + } + calender += thead + ''; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate + var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += ''; + var tbody = (!showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += ''; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + ''; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += '
              ' + this._get(inst, 'weekHeader') + '
              ' + + this._get(inst, 'calculateWeek')(printDate) + '' + // actions + (otherMonth && !showOtherMonths ? ' ' : // display for other months + (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
              ' + (isMultiMonth ? '
              ' + + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
              ' : '') : ''); + group += calender; + } + html += group; + } + html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? + '' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '
              '; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '' + monthNames[drawMonth] + ''; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += ''; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '' + drawYear + ''; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ''; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '
              '; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; + return dpDiv.bind('mouseout', function(event) { + var elem = $( event.target ).closest( selector ); + if ( !elem.length ) { + return; + } + elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" ); + }) + .bind('mouseover', function(event) { + var elem = $( event.target ).closest( selector ); + if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) || + !elem.length ) { + return; + } + elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + elem.addClass('ui-state-hover'); + if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover'); + if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover'); + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Determine whether an object is an array. */ +function isArray(a) { + return (a && (($.browser.safari && typeof a == 'object' && a.length) || + (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); +}; + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find('body').append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.8.21"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.dialog.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.dialog.js new file mode 100644 index 00000000..e7e05b1b --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.dialog.js @@ -0,0 +1,878 @@ +/*! + * jQuery UI Dialog 1.8.21 + * + * Copyright 2012, 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/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function( $, undefined ) { + +var uiDialogClasses = + 'ui-dialog ' + + 'ui-widget ' + + 'ui-widget-content ' + + 'ui-corner-all ', + sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }, + // support for jQuery 1.3.2 - handle common attrFn methods for dialog + attrFn = $.attrFn || { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true, + click: true + }; + +$.widget("ui.dialog", { + options: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: 'close', + dialogClass: '', + draggable: true, + hide: null, + height: 'auto', + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: 'center', + at: 'center', + collision: 'fit', + // ensure that the titlebar is never outside the document + using: function(pos) { + var topOffset = $(this).css(pos).offset().top; + if (topOffset < 0) { + $(this).css('top', pos.top - topOffset); + } + } + }, + resizable: true, + show: null, + stack: true, + title: '', + width: 300, + zIndex: 1000 + }, + + _create: function() { + this.originalTitle = this.element.attr('title'); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } + + this.options.title = this.options.title || this.originalTitle; + var self = this, + options = self.options, + + title = options.title || ' ', + titleId = $.ui.dialog.getTitleId(self.element), + + uiDialog = (self.uiDialog = $('
              ')) + .appendTo(document.body) + .hide() + .addClass(uiDialogClasses + options.dialogClass) + .css({ + zIndex: options.zIndex + }) + // setting tabIndex makes the div focusable + // setting outline to 0 prevents a border on focus in Mozilla + .attr('tabIndex', -1).css('outline', 0).keydown(function(event) { + if (options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { + + self.close(event); + event.preventDefault(); + } + }) + .attr({ + role: 'dialog', + 'aria-labelledby': titleId + }) + .mousedown(function(event) { + self.moveToTop(false, event); + }), + + uiDialogContent = self.element + .show() + .removeAttr('title') + .addClass( + 'ui-dialog-content ' + + 'ui-widget-content') + .appendTo(uiDialog), + + uiDialogTitlebar = (self.uiDialogTitlebar = $('
              ')) + .addClass( + 'ui-dialog-titlebar ' + + 'ui-widget-header ' + + 'ui-corner-all ' + + 'ui-helper-clearfix' + ) + .prependTo(uiDialog), + + uiDialogTitlebarClose = $('') + .addClass( + 'ui-dialog-titlebar-close ' + + 'ui-corner-all' + ) + .attr('role', 'button') + .hover( + function() { + uiDialogTitlebarClose.addClass('ui-state-hover'); + }, + function() { + uiDialogTitlebarClose.removeClass('ui-state-hover'); + } + ) + .focus(function() { + uiDialogTitlebarClose.addClass('ui-state-focus'); + }) + .blur(function() { + uiDialogTitlebarClose.removeClass('ui-state-focus'); + }) + .click(function(event) { + self.close(event); + return false; + }) + .appendTo(uiDialogTitlebar), + + uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('')) + .addClass( + 'ui-icon ' + + 'ui-icon-closethick' + ) + .text(options.closeText) + .appendTo(uiDialogTitlebarClose), + + uiDialogTitle = $('') + .addClass('ui-dialog-title') + .attr('id', titleId) + .html(title) + .prependTo(uiDialogTitlebar); + + //handling of deprecated beforeclose (vs beforeClose) option + //Ticket #4669 http://dev.jqueryui.com/ticket/4669 + //TODO: remove in 1.9pre + if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) { + options.beforeClose = options.beforeclose; + } + + uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); + + if (options.draggable && $.fn.draggable) { + self._makeDraggable(); + } + if (options.resizable && $.fn.resizable) { + self._makeResizable(); + } + + self._createButtons(options.buttons); + self._isOpen = false; + + if ($.fn.bgiframe) { + uiDialog.bgiframe(); + } + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + destroy: function() { + var self = this; + + if (self.overlay) { + self.overlay.destroy(); + } + self.uiDialog.hide(); + self.element + .unbind('.dialog') + .removeData('dialog') + .removeClass('ui-dialog-content ui-widget-content') + .hide().appendTo('body'); + self.uiDialog.remove(); + + if (self.originalTitle) { + self.element.attr('title', self.originalTitle); + } + + return self; + }, + + widget: function() { + return this.uiDialog; + }, + + close: function(event) { + var self = this, + maxZ, thisZ; + + if (false === self._trigger('beforeClose', event)) { + return; + } + + if (self.overlay) { + self.overlay.destroy(); + } + self.uiDialog.unbind('keypress.ui-dialog'); + + self._isOpen = false; + + if (self.options.hide) { + self.uiDialog.hide(self.options.hide, function() { + self._trigger('close', event); + }); + } else { + self.uiDialog.hide(); + self._trigger('close', event); + } + + $.ui.dialog.overlay.resize(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + if (self.options.modal) { + maxZ = 0; + $('.ui-dialog').each(function() { + if (this !== self.uiDialog[0]) { + thisZ = $(this).css('z-index'); + if(!isNaN(thisZ)) { + maxZ = Math.max(maxZ, thisZ); + } + } + }); + $.ui.dialog.maxZ = maxZ; + } + + return self; + }, + + isOpen: function() { + return this._isOpen; + }, + + // the force parameter allows us to move modal dialogs to their correct + // position on open + moveToTop: function(force, event) { + var self = this, + options = self.options, + saveScroll; + + if ((options.modal && !force) || + (!options.stack && !options.modal)) { + return self._trigger('focus', event); + } + + if (options.zIndex > $.ui.dialog.maxZ) { + $.ui.dialog.maxZ = options.zIndex; + } + if (self.overlay) { + $.ui.dialog.maxZ += 1; + self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ); + } + + //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. + // http://ui.jquery.com/bugs/ticket/3193 + saveScroll = { scrollTop: self.element.scrollTop(), scrollLeft: self.element.scrollLeft() }; + $.ui.dialog.maxZ += 1; + self.uiDialog.css('z-index', $.ui.dialog.maxZ); + self.element.attr(saveScroll); + self._trigger('focus', event); + + return self; + }, + + open: function() { + if (this._isOpen) { return; } + + var self = this, + options = self.options, + uiDialog = self.uiDialog; + + self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null; + self._size(); + self._position(options.position); + uiDialog.show(options.show); + self.moveToTop(true); + + // prevent tabbing out of modal dialogs + if ( options.modal ) { + uiDialog.bind( "keydown.ui-dialog", function( event ) { + if ( event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $(':tabbable', this), + first = tabbables.filter(':first'), + last = tabbables.filter(':last'); + + if (event.target === last[0] && !event.shiftKey) { + first.focus(1); + return false; + } else if (event.target === first[0] && event.shiftKey) { + last.focus(1); + return false; + } + }); + } + + // set focus to the first tabbable element in the content area or the first button + // if there are no tabbable elements, set focus on the dialog itself + $(self.element.find(':tabbable').get().concat( + uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat( + uiDialog.get()))).eq(0).focus(); + + self._isOpen = true; + self._trigger('open'); + + return self; + }, + + _createButtons: function(buttons) { + var self = this, + hasButtons = false, + uiDialogButtonPane = $('
              ') + .addClass( + 'ui-dialog-buttonpane ' + + 'ui-widget-content ' + + 'ui-helper-clearfix' + ), + uiButtonSet = $( "
              " ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + // if we already have a button pane, remove it + self.uiDialog.find('.ui-dialog-buttonpane').remove(); + + if (typeof buttons === 'object' && buttons !== null) { + $.each(buttons, function() { + return !(hasButtons = true); + }); + } + if (hasButtons) { + $.each(buttons, function(name, props) { + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + var button = $('') + .click(function() { + props.click.apply(self.element[0], arguments); + }) + .appendTo(uiButtonSet); + // can't use .attr( props, true ) with jQuery 1.3.2. + $.each( props, function( key, value ) { + if ( key === "click" ) { + return; + } + if ( key in attrFn ) { + button[ key ]( value ); + } else { + button.attr( key, value ); + } + }); + if ($.fn.button) { + button.button(); + } + }); + uiDialogButtonPane.appendTo(self.uiDialog); + } + }, + + _makeDraggable: function() { + var self = this, + options = self.options, + doc = $(document), + heightBeforeDrag; + + function filteredUi(ui) { + return { + position: ui.position, + offset: ui.offset + }; + } + + self.uiDialog.draggable({ + cancel: '.ui-dialog-content, .ui-dialog-titlebar-close', + handle: '.ui-dialog-titlebar', + containment: 'document', + start: function(event, ui) { + heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height(); + $(this).height($(this).height()).addClass("ui-dialog-dragging"); + self._trigger('dragStart', event, filteredUi(ui)); + }, + drag: function(event, ui) { + self._trigger('drag', event, filteredUi(ui)); + }, + stop: function(event, ui) { + options.position = [ui.position.left - doc.scrollLeft(), + ui.position.top - doc.scrollTop()]; + $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag); + self._trigger('dragStop', event, filteredUi(ui)); + $.ui.dialog.overlay.resize(); + } + }); + }, + + _makeResizable: function(handles) { + handles = (handles === undefined ? this.options.resizable : handles); + var self = this, + options = self.options, + // .ui-resizable has position: relative defined in the stylesheet + // but dialogs have to use absolute or fixed positioning + position = self.uiDialog.css('position'), + resizeHandles = (typeof handles === 'string' ? + handles : + 'n,e,s,w,se,sw,ne,nw' + ); + + function filteredUi(ui) { + return { + originalPosition: ui.originalPosition, + originalSize: ui.originalSize, + position: ui.position, + size: ui.size + }; + } + + self.uiDialog.resizable({ + cancel: '.ui-dialog-content', + containment: 'document', + alsoResize: self.element, + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: self._minHeight(), + handles: resizeHandles, + start: function(event, ui) { + $(this).addClass("ui-dialog-resizing"); + self._trigger('resizeStart', event, filteredUi(ui)); + }, + resize: function(event, ui) { + self._trigger('resize', event, filteredUi(ui)); + }, + stop: function(event, ui) { + $(this).removeClass("ui-dialog-resizing"); + options.height = $(this).height(); + options.width = $(this).width(); + self._trigger('resizeStop', event, filteredUi(ui)); + $.ui.dialog.overlay.resize(); + } + }) + .css('position', position) + .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); + }, + + _minHeight: function() { + var options = this.options; + + if (options.height === 'auto') { + return options.minHeight; + } else { + return Math.min(options.minHeight, options.height); + } + }, + + _position: function(position) { + var myAt = [], + offset = [0, 0], + isVisible; + + if (position) { + // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( + // if (typeof position == 'string' || $.isArray(position)) { + // myAt = $.isArray(position) ? position : position.split(' '); + + if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) { + myAt = position.split ? position.split(' ') : [position[0], position[1]]; + if (myAt.length === 1) { + myAt[1] = myAt[0]; + } + + $.each(['left', 'top'], function(i, offsetPosition) { + if (+myAt[i] === myAt[i]) { + offset[i] = myAt[i]; + myAt[i] = offsetPosition; + } + }); + + position = { + my: myAt.join(" "), + at: myAt.join(" "), + offset: offset.join(" ") + }; + } + + position = $.extend({}, $.ui.dialog.prototype.options.position, position); + } else { + position = $.ui.dialog.prototype.options.position; + } + + // need to show the dialog to get the actual offset in the position plugin + isVisible = this.uiDialog.is(':visible'); + if (!isVisible) { + this.uiDialog.show(); + } + this.uiDialog + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .position($.extend({ of: window }, position)); + if (!isVisible) { + this.uiDialog.hide(); + } + }, + + _setOptions: function( options ) { + var self = this, + resizableOptions = {}, + resize = false; + + $.each( options, function( key, value ) { + self._setOption( key, value ); + + if ( key in sizeRelatedOptions ) { + resize = true; + } + if ( key in resizableRelatedOptions ) { + resizableOptions[ key ] = value; + } + }); + + if ( resize ) { + this._size(); + } + if ( this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", resizableOptions ); + } + }, + + _setOption: function(key, value){ + var self = this, + uiDialog = self.uiDialog; + + switch (key) { + //handling of deprecated beforeclose (vs beforeClose) option + //Ticket #4669 http://dev.jqueryui.com/ticket/4669 + //TODO: remove in 1.9pre + case "beforeclose": + key = "beforeClose"; + break; + case "buttons": + self._createButtons(value); + break; + case "closeText": + // ensure that we always pass a string + self.uiDialogTitlebarCloseText.text("" + value); + break; + case "dialogClass": + uiDialog + .removeClass(self.options.dialogClass) + .addClass(uiDialogClasses + value); + break; + case "disabled": + if (value) { + uiDialog.addClass('ui-dialog-disabled'); + } else { + uiDialog.removeClass('ui-dialog-disabled'); + } + break; + case "draggable": + var isDraggable = uiDialog.is( ":data(draggable)" ); + if ( isDraggable && !value ) { + uiDialog.draggable( "destroy" ); + } + + if ( !isDraggable && value ) { + self._makeDraggable(); + } + break; + case "position": + self._position(value); + break; + case "resizable": + // currently resizable, becoming non-resizable + var isResizable = uiDialog.is( ":data(resizable)" ); + if (isResizable && !value) { + uiDialog.resizable('destroy'); + } + + // currently resizable, changing handles + if (isResizable && typeof value === 'string') { + uiDialog.resizable('option', 'handles', value); + } + + // currently non-resizable, becoming resizable + if (!isResizable && value !== false) { + self._makeResizable(value); + } + break; + case "title": + // convert whatever was passed in o a string, for html() to not throw up + $(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || ' ')); + break; + } + + $.Widget.prototype._setOption.apply(self, arguments); + }, + + _size: function() { + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + * divs will both have width and height set, so we need to reset them + */ + var options = this.options, + nonContentHeight, + minContentHeight, + isVisible = this.uiDialog.is( ":visible" ); + + // reset content sizing + this.element.show().css({ + width: 'auto', + minHeight: 0, + height: 0 + }); + + if (options.minWidth > options.width) { + options.width = options.minWidth; + } + + // reset wrapper sizing + // determine the height of all the non-content elements + nonContentHeight = this.uiDialog.css({ + height: 'auto', + width: options.width + }) + .height(); + minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); + + if ( options.height === "auto" ) { + // only needed for IE6 support + if ( $.support.minHeight ) { + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); + } else { + this.uiDialog.show(); + var autoHeight = this.element.css( "height", "auto" ).height(); + if ( !isVisible ) { + this.uiDialog.hide(); + } + this.element.height( Math.max( autoHeight, minContentHeight ) ); + } + } else { + this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); + } + + if (this.uiDialog.is(':data(resizable)')) { + this.uiDialog.resizable('option', 'minHeight', this._minHeight()); + } + } +}); + +$.extend($.ui.dialog, { + version: "1.8.21", + + uuid: 0, + maxZ: 0, + + getTitleId: function($el) { + var id = $el.attr('id'); + if (!id) { + this.uuid += 1; + id = this.uuid; + } + return 'ui-dialog-title-' + id; + }, + + overlay: function(dialog) { + this.$el = $.ui.dialog.overlay.create(dialog); + } +}); + +$.extend($.ui.dialog.overlay, { + instances: [], + // reuse old instances due to IE memory leak with alpha transparency (see #5185) + oldInstances: [], + maxZ: 0, + events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), + function(event) { return event + '.dialog-overlay'; }).join(' '), + create: function(dialog) { + if (this.instances.length === 0) { + // prevent use of anchors and inputs + // we use a setTimeout in case the overlay is created from an + // event that we're going to be cancelling (see #2804) + setTimeout(function() { + // handle $(el).dialog().dialog('close') (see #4065) + if ($.ui.dialog.overlay.instances.length) { + $(document).bind($.ui.dialog.overlay.events, function(event) { + // stop events if the z-index of the target is < the z-index of the overlay + // we cannot return true when we don't want to cancel the event (#3523) + if ($(event.target).zIndex() < $.ui.dialog.overlay.maxZ) { + return false; + } + }); + } + }, 1); + + // allow closing by pressing the escape key + $(document).bind('keydown.dialog-overlay', function(event) { + if (dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { + + dialog.close(event); + event.preventDefault(); + } + }); + + // handle window resize + $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); + } + + var $el = (this.oldInstances.pop() || $('
              ').addClass('ui-widget-overlay')) + .appendTo(document.body) + .css({ + width: this.width(), + height: this.height() + }); + + if ($.fn.bgiframe) { + $el.bgiframe(); + } + + this.instances.push($el); + return $el; + }, + + destroy: function($el) { + var indexOf = $.inArray($el, this.instances); + if (indexOf != -1){ + this.oldInstances.push(this.instances.splice(indexOf, 1)[0]); + } + + if (this.instances.length === 0) { + $([document, window]).unbind('.dialog-overlay'); + } + + $el.remove(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + var maxZ = 0; + $.each(this.instances, function() { + maxZ = Math.max(maxZ, this.css('z-index')); + }); + this.maxZ = maxZ; + }, + + height: function() { + var scrollHeight, + offsetHeight; + // handle IE 6 + if ($.browser.msie && $.browser.version < 7) { + scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if (scrollHeight < offsetHeight) { + return $(window).height() + 'px'; + } else { + return scrollHeight + 'px'; + } + // handle "good" browsers + } else { + return $(document).height() + 'px'; + } + }, + + width: function() { + var scrollWidth, + offsetWidth; + // handle IE + if ( $.browser.msie ) { + scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if (scrollWidth < offsetWidth) { + return $(window).width() + 'px'; + } else { + return scrollWidth + 'px'; + } + // handle "good" browsers + } else { + return $(document).width() + 'px'; + } + }, + + resize: function() { + /* If the dialog is draggable and the user drags it past the + * right edge of the window, the document becomes wider so we + * need to stretch the overlay. If the user then drags the + * dialog back to the left, the document will become narrower, + * so we need to shrink the overlay to the appropriate size. + * This is handled by shrinking the overlay before setting it + * to the full document size. + */ + var $overlays = $([]); + $.each($.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add(this); + }); + + $overlays.css({ + width: 0, + height: 0 + }).css({ + width: $.ui.dialog.overlay.width(), + height: $.ui.dialog.overlay.height() + }); + } +}); + +$.extend($.ui.dialog.overlay.prototype, { + destroy: function() { + $.ui.dialog.overlay.destroy(this.$el); + } +}); + +}(jQuery)); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.draggable.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.draggable.js new file mode 100644 index 00000000..40a0c52d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.draggable.js @@ -0,0 +1,833 @@ +/*! + * jQuery UI Draggable 1.8.21 + * + * Copyright 2012, 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( $, undefined ) { + +$.widget("ui.draggable", $.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')) return; + this.element + .removeData("draggable") + .unbind(".draggable") + .removeClass("ui-draggable" + + " ui-draggable-dragging" + + " ui-draggable-disabled"); + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + if ( o.iframeFix ) { + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('
              ') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + } + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.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'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + var element = this.element[0], elementInDom = false; + while ( element && (element = element.parentNode) ) { + if (element == document ) { + elementInDom = true; + } + } + if ( !elementInDom && this.options.helper === "original" ) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var self = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(self._trigger("stop", event) !== false) { + self._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + if (this.options.iframeFix === true) { + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); //Remove frame helpers + } + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.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), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var c = $(o.containment); + var ce = c[0]; if(!ce) return; + var co = c.offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.extend($.ui.draggable, { + version: "1.8.21" +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), self = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.droppable.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.droppable.js new file mode 100644 index 00000000..a7491617 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.droppable.js @@ -0,0 +1,296 @@ +/*! + * jQuery UI Droppable 1.8.21 + * + * Copyright 2012, 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/Droppables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.mouse.js + * jquery.ui.draggable.js + */ +(function( $, undefined ) { + +$.widget("ui.droppable", { + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element + .removeClass("ui-droppable ui-droppable-disabled") + .removeData("droppable") + .unbind(".droppable"); + + return this; + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.extend($.ui.droppable, { + version: "1.8.21" +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l <= x1 && x2 <= r + && t <= y1 && y2 <= b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this._drop.call(this, event) || dropped; + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parents( ":not(body,html)" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + var parent = this.element.parents(':data(droppable):eq(0)'); + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance._out.call(parentInstance, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parents( ":not(body,html)" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + } +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.mouse.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.mouse.js new file mode 100644 index 00000000..a4392deb --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.mouse.js @@ -0,0 +1,165 @@ +/*! + * jQuery UI Mouse 1.8.21 + * + * Copyright 2012, 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/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + options: { + cancel: ':input,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var self = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return self._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) { + $.removeData(event.target, self.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return }; + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var self = this, + btnIsLeft = (event.which == 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return self._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return self._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target == this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.position.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.position.js new file mode 100644 index 00000000..164804b5 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.position.js @@ -0,0 +1,303 @@ +/*! + * jQuery UI Position 1.8.21 + * + * Copyright 2012, 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( $, undefined ) { + +$.ui = $.ui || {}; + +var horizontalPositions = /left|center|right/, + verticalPositions = /top|center|bottom/, + center = "center", + support = {}, + _position = $.fn.position, + _offset = $.fn.offset; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var target = $( options.of ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ], + targetWidth, + targetHeight, + basePosition; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: 0, left: 0 }; + // TODO: use $.isWindow() in 1.9 + } else if ( targetElem.setTimeout ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + basePosition = { top: options.of.pageY, left: options.of.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + basePosition = target.offset(); + } + + // force my and at to have valid horizontal and veritcal positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[this] || "" ).split( " " ); + if ( pos.length === 1) { + pos = horizontalPositions.test( pos[0] ) ? + pos.concat( [center] ) : + verticalPositions.test( pos[0] ) ? + [ center ].concat( pos ) : + [ center, center ]; + } + pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center; + pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center; + options[ this ] = pos; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + // normalize offset option + offset[ 0 ] = parseInt( offset[0], 10 ) || 0; + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + offset[ 1 ] = parseInt( offset[1], 10 ) || 0; + + if ( options.at[0] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[0] === center ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[1] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[1] === center ) { + basePosition.top += targetHeight / 2; + } + + basePosition.left += offset[ 0 ]; + basePosition.top += offset[ 1 ]; + + return this.each(function() { + var elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, + marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, + collisionWidth = elemWidth + marginLeft + + ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ), + collisionHeight = elemHeight + marginTop + + ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ), + position = $.extend( {}, basePosition ), + collisionPosition; + + if ( options.my[0] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[0] === center ) { + position.left -= elemWidth / 2; + } + + if ( options.my[1] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[1] === center ) { + position.top -= elemHeight / 2; + } + + // prevent fractions if jQuery version doesn't support them (see #5280) + if ( !support.fractions ) { + position.left = Math.round( position.left ); + position.top = Math.round( position.top ); + } + + collisionPosition = { + left: position.left - marginLeft, + top: position.top - marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[i] ] ) { + $.ui.position[ collision[i] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: offset, + my: options.my, + at: options.at + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + elem.offset( $.extend( position, { using: options.using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(); + position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left ); + }, + top: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(); + position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top ); + } + }, + + flip: { + left: function( position, data ) { + if ( data.at[0] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(), + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + -data.targetWidth, + offset = -2 * data.offset[ 0 ]; + position.left += data.collisionPosition.left < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + }, + top: function( position, data ) { + if ( data.at[1] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(), + myOffset = data.my[ 1 ] === "top" ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + -data.targetHeight, + offset = -2 * data.offset[ 1 ]; + position.top += data.collisionPosition.top < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + } + } +}; + +// offset setter from jQuery 1.4 +if ( !$.offset.setOffset ) { + $.offset.setOffset = function( elem, options ) { + // set position first, in-case top/left are set even on static elem + if ( /static/.test( $.curCSS( elem, "position" ) ) ) { + elem.style.position = "relative"; + } + var curElem = $( elem ), + curOffset = curElem.offset(), + curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0, + curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0, + props = { + top: (options.top - curOffset.top) + curTop, + left: (options.left - curOffset.left) + curLeft + }; + + if ( 'using' in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + }; + + $.fn.offset = function( options ) { + var elem = this[ 0 ]; + if ( !elem || !elem.ownerDocument ) { return null; } + if ( options ) { + if ( $.isFunction( options ) ) { + return this.each(function( i ) { + $( this ).offset( options.call( this, i, $( this ).offset() ) ); + }); + } + return this.each(function() { + $.offset.setOffset( this, options ); + }); + } + return _offset.call( this ); + }; +} + +// fraction support test (older versions of jQuery don't support fractions) +(function () { + var body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ), + testElement, testElementParent, testElementStyle, offset, offsetTotal; + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( var i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;"; + + offset = $( div ).offset( function( _, offset ) { + return offset; + }).offset(); + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); + + offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 ); + support.fractions = offsetTotal > 21 && offsetTotal < 22; +})(); + +}( jQuery )); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.progressbar.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.progressbar.js new file mode 100644 index 00000000..4139be6f --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.progressbar.js @@ -0,0 +1,109 @@ +/*! + * jQuery UI Progressbar 1.8.21 + * + * Copyright 2012, 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/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.progressbar", { + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function() { + this.element + .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .attr({ + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + }); + + this.valueDiv = $( "
              " ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + destroy: function() { + this.element + .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + + $.Widget.prototype.destroy.apply( this, arguments ); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(); + var percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +$.extend( $.ui.progressbar, { + version: "1.8.21" +}); + +})( jQuery ); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.resizable.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.resizable.js new file mode 100644 index 00000000..904be47b --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.resizable.js @@ -0,0 +1,807 @@ +/*! + * jQuery UI Resizable 1.8.21 + * + * Copyright 2012, 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/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var self = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('
              ').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('
              '); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!self.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + self.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .hover(function() { + if (o.disabled) return; + $(this).removeClass("ui-resizable-autohide"); + self._handles.show(); + }, + function(){ + if (o.disabled) return; + if (!self.resizing) { + $(this).addClass("ui-resizable-autohide"); + self._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + wrapper.after( + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }) + ).remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + self = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, self = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + self.helper.height(self.size.height); + self.helper.width(self.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; + if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; + if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; + if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); + else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) + continue; + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('
              '); + + // fix ie6 offset TODO: This seems broken + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), + pxyoffset = ( ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +$.extend($.ui.resizable, { + version: "1.8.21" +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; + + var delta = { + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + self.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(self.element.css('width'), 10), + height: parseInt(self.element.css('height'), 10), + top: parseInt(self.element.css('top'), 10), + left: parseInt(self.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + self._updateCache(data); + self._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, el = self.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + self.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + self.containerOffset = { left: 0, top: 0 }; + self.containerPosition = { left: 0, top: 0 }; + + self.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + self.containerOffset = element.offset(); + self.containerPosition = element.position(); + self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + self.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, + ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, + pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (self._helper ? co.left : 0)) { + self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + self.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (self._helper ? co.top : 0)) { + self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + self.position.top = self._helper ? co.top : 0; + } + + self.offset.left = self.parentData.left+self.position.left; + self.offset.top = self.parentData.top+self.position.top; + + var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), + hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); + + var isParent = self.containerElement.get(0) == self.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= self.parentData.left; + + if (woset + self.size.width >= self.parentData.width) { + self.size.width = self.parentData.width - woset; + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + } + + if (hoset + self.size.height >= self.parentData.height) { + self.size.height = self.parentData.height - hoset; + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + } + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options, cp = self.position, + co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; + + var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; + + if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (self._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var self = $(this).data("resizable"), o = self.options, cs = self.size; + + self.ghost = self.originalElement.clone(); + self.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + self.ghost.appendTo(self.helper); + + }, + + resize: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.left = op.left - ox; + } + else { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + self.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.selectable.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.selectable.js new file mode 100644 index 00000000..403e62dc --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.selectable.js @@ -0,0 +1,267 @@ +/*! + * jQuery UI Selectable 1.8.21 + * + * Copyright 2012, 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/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: function() { + var self = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(self.options.filter, self.element[0]); + selectees.addClass("ui-selectee"); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("
              "); + }, + + destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled") + .removeData("selectable") + .unbind(".selectable"); + this._mouseDestroy(); + + return this; + }, + + _mouseStart: function(event) { + var self = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + self._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + var self = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == self.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + self._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var self = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + self._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + self._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +$.extend($.ui.selectable, { + version: "1.8.21" +}); + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.slider.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.slider.js new file mode 100644 index 00000000..8629dc6b --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.slider.js @@ -0,0 +1,662 @@ +/*! + * jQuery UI Slider 1.8.21 + * + * Copyright 2012, 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/Slider + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +// number of pages in a slider +// (how many times can you page up/down to go through the whole range) +var numPages = 5; + +$.widget( "ui.slider", $.ui.mouse, { + + widgetEventPrefix: "slide", + + options: { + animate: false, + distance: 0, + max: 100, + min: 0, + orientation: "horizontal", + range: false, + step: 1, + value: 0, + values: null + }, + + _create: function() { + var self = this, + o = this.options, + existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), + handle = "", + handleCount = ( o.values && o.values.length ) || 1, + handles = []; + + this._keySliding = false; + this._mouseSliding = false; + this._animateOff = true; + this._handleIndex = null; + this._detectOrientation(); + this._mouseInit(); + + this.element + .addClass( "ui-slider" + + " ui-slider-" + this.orientation + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" + + ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); + + this.range = $([]); + + if ( o.range ) { + if ( o.range === true ) { + if ( !o.values ) { + o.values = [ this._valueMin(), this._valueMin() ]; + } + if ( o.values.length && o.values.length !== 2 ) { + o.values = [ o.values[0], o.values[0] ]; + } + } + + this.range = $( "
              " ) + .appendTo( this.element ) + .addClass( "ui-slider-range" + + // note: this isn't the most fittingly semantic framework class for this element, + // but worked best visually with a variety of themes + " ui-widget-header" + + ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); + } + + for ( var i = existingHandles.length; i < handleCount; i += 1 ) { + handles.push( handle ); + } + + this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) ); + + this.handle = this.handles.eq( 0 ); + + this.handles.add( this.range ).filter( "a" ) + .click(function( event ) { + event.preventDefault(); + }) + .hover(function() { + if ( !o.disabled ) { + $( this ).addClass( "ui-state-hover" ); + } + }, function() { + $( this ).removeClass( "ui-state-hover" ); + }) + .focus(function() { + if ( !o.disabled ) { + $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); + $( this ).addClass( "ui-state-focus" ); + } else { + $( this ).blur(); + } + }) + .blur(function() { + $( this ).removeClass( "ui-state-focus" ); + }); + + this.handles.each(function( i ) { + $( this ).data( "index.ui-slider-handle", i ); + }); + + this.handles + .keydown(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ), + allowed, + curVal, + newVal, + step; + + if ( self.options.disabled ) { + return; + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + case $.ui.keyCode.END: + case $.ui.keyCode.PAGE_UP: + case $.ui.keyCode.PAGE_DOWN: + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + event.preventDefault(); + if ( !self._keySliding ) { + self._keySliding = true; + $( this ).addClass( "ui-state-active" ); + allowed = self._start( event, index ); + if ( allowed === false ) { + return; + } + } + break; + } + + step = self.options.step; + if ( self.options.values && self.options.values.length ) { + curVal = newVal = self.values( index ); + } else { + curVal = newVal = self.value(); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + newVal = self._valueMin(); + break; + case $.ui.keyCode.END: + newVal = self._valueMax(); + break; + case $.ui.keyCode.PAGE_UP: + newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.PAGE_DOWN: + newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + if ( curVal === self._valueMax() ) { + return; + } + newVal = self._trimAlignValue( curVal + step ); + break; + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + if ( curVal === self._valueMin() ) { + return; + } + newVal = self._trimAlignValue( curVal - step ); + break; + } + + self._slide( event, index, newVal ); + }) + .keyup(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ); + + if ( self._keySliding ) { + self._keySliding = false; + self._stop( event, index ); + self._change( event, index ); + $( this ).removeClass( "ui-state-active" ); + } + + }); + + this._refreshValue(); + + this._animateOff = false; + }, + + destroy: function() { + this.handles.remove(); + this.range.remove(); + + this.element + .removeClass( "ui-slider" + + " ui-slider-horizontal" + + " ui-slider-vertical" + + " ui-slider-disabled" + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ) + .removeData( "slider" ) + .unbind( ".slider" ); + + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function( event ) { + var o = this.options, + position, + normValue, + distance, + closestHandle, + self, + index, + allowed, + offset, + mouseOverHandle; + + if ( o.disabled ) { + return false; + } + + this.elementSize = { + width: this.element.outerWidth(), + height: this.element.outerHeight() + }; + this.elementOffset = this.element.offset(); + + position = { x: event.pageX, y: event.pageY }; + normValue = this._normValueFromMouse( position ); + distance = this._valueMax() - this._valueMin() + 1; + self = this; + this.handles.each(function( i ) { + var thisDistance = Math.abs( normValue - self.values(i) ); + if ( distance > thisDistance ) { + distance = thisDistance; + closestHandle = $( this ); + index = i; + } + }); + + // workaround for bug #3736 (if both handles of a range are at 0, + // the first is always used as the one with least distance, + // and moving it is obviously prevented by preventing negative ranges) + if( o.range === true && this.values(1) === o.min ) { + index += 1; + closestHandle = $( this.handles[index] ); + } + + allowed = this._start( event, index ); + if ( allowed === false ) { + return false; + } + this._mouseSliding = true; + + self._handleIndex = index; + + closestHandle + .addClass( "ui-state-active" ) + .focus(); + + offset = closestHandle.offset(); + mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); + this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { + left: event.pageX - offset.left - ( closestHandle.width() / 2 ), + top: event.pageY - offset.top - + ( closestHandle.height() / 2 ) - + ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - + ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) + }; + + if ( !this.handles.hasClass( "ui-state-hover" ) ) { + this._slide( event, index, normValue ); + } + this._animateOff = true; + return true; + }, + + _mouseStart: function( event ) { + return true; + }, + + _mouseDrag: function( event ) { + var position = { x: event.pageX, y: event.pageY }, + normValue = this._normValueFromMouse( position ); + + this._slide( event, this._handleIndex, normValue ); + + return false; + }, + + _mouseStop: function( event ) { + this.handles.removeClass( "ui-state-active" ); + this._mouseSliding = false; + + this._stop( event, this._handleIndex ); + this._change( event, this._handleIndex ); + + this._handleIndex = null; + this._clickOffset = null; + this._animateOff = false; + + return false; + }, + + _detectOrientation: function() { + this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; + }, + + _normValueFromMouse: function( position ) { + var pixelTotal, + pixelMouse, + percentMouse, + valueTotal, + valueMouse; + + if ( this.orientation === "horizontal" ) { + pixelTotal = this.elementSize.width; + pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); + } else { + pixelTotal = this.elementSize.height; + pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); + } + + percentMouse = ( pixelMouse / pixelTotal ); + if ( percentMouse > 1 ) { + percentMouse = 1; + } + if ( percentMouse < 0 ) { + percentMouse = 0; + } + if ( this.orientation === "vertical" ) { + percentMouse = 1 - percentMouse; + } + + valueTotal = this._valueMax() - this._valueMin(); + valueMouse = this._valueMin() + percentMouse * valueTotal; + + return this._trimAlignValue( valueMouse ); + }, + + _start: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + return this._trigger( "start", event, uiHash ); + }, + + _slide: function( event, index, newVal ) { + var otherVal, + newValues, + allowed; + + if ( this.options.values && this.options.values.length ) { + otherVal = this.values( index ? 0 : 1 ); + + if ( ( this.options.values.length === 2 && this.options.range === true ) && + ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) + ) { + newVal = otherVal; + } + + if ( newVal !== this.values( index ) ) { + newValues = this.values(); + newValues[ index ] = newVal; + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal, + values: newValues + } ); + otherVal = this.values( index ? 0 : 1 ); + if ( allowed !== false ) { + this.values( index, newVal, true ); + } + } + } else { + if ( newVal !== this.value() ) { + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal + } ); + if ( allowed !== false ) { + this.value( newVal ); + } + } + } + }, + + _stop: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "stop", event, uiHash ); + }, + + _change: function( event, index ) { + if ( !this._keySliding && !this._mouseSliding ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "change", event, uiHash ); + } + }, + + value: function( newValue ) { + if ( arguments.length ) { + this.options.value = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, 0 ); + return; + } + + return this._value(); + }, + + values: function( index, newValue ) { + var vals, + newValues, + i; + + if ( arguments.length > 1 ) { + this.options.values[ index ] = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, index ); + return; + } + + if ( arguments.length ) { + if ( $.isArray( arguments[ 0 ] ) ) { + vals = this.options.values; + newValues = arguments[ 0 ]; + for ( i = 0; i < vals.length; i += 1 ) { + vals[ i ] = this._trimAlignValue( newValues[ i ] ); + this._change( null, i ); + } + this._refreshValue(); + } else { + if ( this.options.values && this.options.values.length ) { + return this._values( index ); + } else { + return this.value(); + } + } + } else { + return this._values(); + } + }, + + _setOption: function( key, value ) { + var i, + valsLength = 0; + + if ( $.isArray( this.options.values ) ) { + valsLength = this.options.values.length; + } + + $.Widget.prototype._setOption.apply( this, arguments ); + + switch ( key ) { + case "disabled": + if ( value ) { + this.handles.filter( ".ui-state-focus" ).blur(); + this.handles.removeClass( "ui-state-hover" ); + this.handles.propAttr( "disabled", true ); + this.element.addClass( "ui-disabled" ); + } else { + this.handles.propAttr( "disabled", false ); + this.element.removeClass( "ui-disabled" ); + } + break; + case "orientation": + this._detectOrientation(); + this.element + .removeClass( "ui-slider-horizontal ui-slider-vertical" ) + .addClass( "ui-slider-" + this.orientation ); + this._refreshValue(); + break; + case "value": + this._animateOff = true; + this._refreshValue(); + this._change( null, 0 ); + this._animateOff = false; + break; + case "values": + this._animateOff = true; + this._refreshValue(); + for ( i = 0; i < valsLength; i += 1 ) { + this._change( null, i ); + } + this._animateOff = false; + break; + } + }, + + //internal value getter + // _value() returns value trimmed by min and max, aligned by step + _value: function() { + var val = this.options.value; + val = this._trimAlignValue( val ); + + return val; + }, + + //internal values getter + // _values() returns array of values trimmed by min and max, aligned by step + // _values( index ) returns single value trimmed by min and max, aligned by step + _values: function( index ) { + var val, + vals, + i; + + if ( arguments.length ) { + val = this.options.values[ index ]; + val = this._trimAlignValue( val ); + + return val; + } else { + // .slice() creates a copy of the array + // this copy gets trimmed by min and max and then returned + vals = this.options.values.slice(); + for ( i = 0; i < vals.length; i+= 1) { + vals[ i ] = this._trimAlignValue( vals[ i ] ); + } + + return vals; + } + }, + + // returns the step-aligned value that val is closest to, between (inclusive) min and max + _trimAlignValue: function( val ) { + if ( val <= this._valueMin() ) { + return this._valueMin(); + } + if ( val >= this._valueMax() ) { + return this._valueMax(); + } + var step = ( this.options.step > 0 ) ? this.options.step : 1, + valModStep = (val - this._valueMin()) % step, + alignValue = val - valModStep; + + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see #4124) + return parseFloat( alignValue.toFixed(5) ); + }, + + _valueMin: function() { + return this.options.min; + }, + + _valueMax: function() { + return this.options.max; + }, + + _refreshValue: function() { + var oRange = this.options.range, + o = this.options, + self = this, + animate = ( !this._animateOff ) ? o.animate : false, + valPercent, + _set = {}, + lastValPercent, + value, + valueMin, + valueMax; + + if ( this.options.values && this.options.values.length ) { + this.handles.each(function( i, j ) { + valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + if ( self.options.range === true ) { + if ( self.orientation === "horizontal" ) { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } else { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + lastValPercent = valPercent; + }); + } else { + value = this.value(); + valueMin = this._valueMin(); + valueMax = this._valueMax(); + valPercent = ( valueMax !== valueMin ) ? + ( value - valueMin ) / ( valueMax - valueMin ) * 100 : + 0; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + + if ( oRange === "min" && this.orientation === "horizontal" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "horizontal" ) { + this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + if ( oRange === "min" && this.orientation === "vertical" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "vertical" ) { + this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + +}); + +$.extend( $.ui.slider, { + version: "1.8.21" +}); + +}(jQuery)); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.sortable.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.sortable.js new file mode 100644 index 00000000..45fbb1ce --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.sortable.js @@ -0,0 +1,1082 @@ +/*! + * jQuery UI Sortable 1.8.21 + * + * Copyright 2012, 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/Sortables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true + + }, + + destroy: function() { + $.Widget.prototype.destroy.call( this ); + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData(this.widgetName + "-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget() + [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, self = this, nodes = $(event.target).parents().each(function() { + if($.data(this, that.widgetName + '-item') == self) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options, self = this; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper 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'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + if(itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var self = this; + var cur = self.placeholder.offset(); + + self.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + self._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + var self = this; + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, self._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, self._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var self = this; + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + for (var i=0; i < this.items.length; i++) { + + for (var j=0; j < list.length; j++) { + if(list[j] == this.items[i].item[0]) + this.items.splice(i,1); + }; + + }; + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var self = this; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) + continue; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + + var self = that || this, o = self.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(self.currentItem[0].nodeName)) + .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)); + + //Append it after the actual current item + self.currentItem.after(self.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(self, self.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.ui.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else if(this.currentContainer != this.containers[innermostIndex]) { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + var cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = (cur - base > 0) ? 'down' : 'up'; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var self = this, counter = this.counter; + + window.setTimeout(function() { + if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + },0); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = [], self = this; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element + if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + for (var i = this.containers.length - 1; i >= 0; i--){ + if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + } + }; + }; + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(inst) { + var self = inst || this; + return { + helper: self.helper, + placeholder: self.placeholder || $([]), + position: self.position, + originalPosition: self.originalPosition, + offset: self.positionAbs, + item: self.currentItem, + sender: inst ? inst.element : null + }; + } + +}); + +$.extend($.ui.sortable, { + version: "1.8.21" +}); + +})(jQuery); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.tabs.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.tabs.js new file mode 100644 index 00000000..d9e2fdf8 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.tabs.js @@ -0,0 +1,757 @@ +/*! + * jQuery UI Tabs 1.8.21 + * + * Copyright 2012, 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/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var tabId = 0, + listId = 0; + +function getNextTabId() { + return ++tabId; +} + +function getNextListId() { + return ++listId; +} + +$.widget( "ui.tabs", { + options: { + add: null, + ajaxOptions: null, + cache: false, + cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } + collapsible: false, + disable: null, + disabled: [], + enable: null, + event: "click", + fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } + idPrefix: "ui-tabs-", + load: null, + panelTemplate: "
              ", + remove: null, + select: null, + show: null, + spinner: "Loading…", + tabTemplate: "
            • #{label}
            • " + }, + + _create: function() { + this._tabify( true ); + }, + + _setOption: function( key, value ) { + if ( key == "selected" ) { + if (this.options.collapsible && value == this.options.selected ) { + return; + } + this.select( value ); + } else { + this.options[ key ] = value; + this._tabify(); + } + }, + + _tabId: function( a ) { + return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) || + this.options.idPrefix + getNextTabId(); + }, + + _sanitizeSelector: function( hash ) { + // we need this because an id may contain a ":" + return hash.replace( /:/g, "\\:" ); + }, + + _cookie: function() { + var cookie = this.cookie || + ( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() ); + return $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) ); + }, + + _ui: function( tab, panel ) { + return { + tab: tab, + panel: panel, + index: this.anchors.index( tab ) + }; + }, + + _cleanup: function() { + // restore all former loading tabs labels + this.lis.filter( ".ui-state-processing" ) + .removeClass( "ui-state-processing" ) + .find( "span:data(label.tabs)" ) + .each(function() { + var el = $( this ); + el.html( el.data( "label.tabs" ) ).removeData( "label.tabs" ); + }); + }, + + _tabify: function( init ) { + var self = this, + o = this.options, + fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash + + this.list = this.element.find( "ol,ul" ).eq( 0 ); + this.lis = $( " > li:has(a[href])", this.list ); + this.anchors = this.lis.map(function() { + return $( "a", this )[ 0 ]; + }); + this.panels = $( [] ); + + this.anchors.each(function( i, a ) { + var href = $( a ).attr( "href" ); + // For dynamically created HTML that contains a hash as href IE < 8 expands + // such href to the full page url with hash and then misinterprets tab as ajax. + // Same consideration applies for an added tab with a fragment identifier + // since a[href=#fragment-identifier] does unexpectedly not match. + // Thus normalize href attribute... + var hrefBase = href.split( "#" )[ 0 ], + baseEl; + if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] || + ( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) { + href = a.hash; + a.href = href; + } + + // inline tab + if ( fragmentId.test( href ) ) { + self.panels = self.panels.add( self.element.find( self._sanitizeSelector( href ) ) ); + // remote tab + // prevent loading the page itself if href is just "#" + } else if ( href && href !== "#" ) { + // required for restore on destroy + $.data( a, "href.tabs", href ); + + // TODO until #3808 is fixed strip fragment identifier from url + // (IE fails to load from such url) + $.data( a, "load.tabs", href.replace( /#.*$/, "" ) ); + + var id = self._tabId( a ); + a.href = "#" + id; + var $panel = self.element.find( "#" + id ); + if ( !$panel.length ) { + $panel = $( o.panelTemplate ) + .attr( "id", id ) + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .insertAfter( self.panels[ i - 1 ] || self.list ); + $panel.data( "destroy.tabs", true ); + } + self.panels = self.panels.add( $panel ); + // invalid tab href + } else { + o.disabled.push( i ); + } + }); + + // initialization from scratch + if ( init ) { + // attach necessary classes for styling + 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" ); + + // Selected tab + // use "selected" option or try to retrieve: + // 1. from fragment identifier in url + // 2. from cookie + // 3. from selected class attribute on
            • + if ( o.selected === undefined ) { + if ( location.hash ) { + this.anchors.each(function( i, a ) { + if ( a.hash == location.hash ) { + o.selected = i; + return false; + } + }); + } + if ( typeof o.selected !== "number" && o.cookie ) { + o.selected = parseInt( self._cookie(), 10 ); + } + if ( typeof o.selected !== "number" && this.lis.filter( ".ui-tabs-selected" ).length ) { + o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) ); + } + o.selected = o.selected || ( this.lis.length ? 0 : -1 ); + } else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release + o.selected = -1; + } + + // sanity check - default to first tab... + o.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 ) + ? o.selected + : 0; + + // Take disabling tabs via class attribute from HTML + // into account and update option properly. + // A selected tab cannot become disabled. + o.disabled = $.unique( o.disabled.concat( + $.map( this.lis.filter( ".ui-state-disabled" ), function( n, i ) { + return self.lis.index( n ); + }) + ) ).sort(); + + if ( $.inArray( o.selected, o.disabled ) != -1 ) { + o.disabled.splice( $.inArray( o.selected, o.disabled ), 1 ); + } + + // highlight selected tab + this.panels.addClass( "ui-tabs-hide" ); + this.lis.removeClass( "ui-tabs-selected ui-state-active" ); + // check for length avoids error when initializing empty list + if ( o.selected >= 0 && this.anchors.length ) { + self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ).removeClass( "ui-tabs-hide" ); + this.lis.eq( o.selected ).addClass( "ui-tabs-selected ui-state-active" ); + + // seems to be expected behavior that the show callback is fired + self.element.queue( "tabs", function() { + self._trigger( "show", null, + self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) )[ 0 ] ) ); + }); + + this.load( o.selected ); + } + + // clean up to avoid memory leaks in certain versions of IE 6 + // TODO: namespace this event + $( window ).bind( "unload", function() { + self.lis.add( self.anchors ).unbind( ".tabs" ); + self.lis = self.anchors = self.panels = null; + }); + // update selected after add/remove + } else { + o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) ); + } + + // update collapsible + // TODO: use .toggleClass() + this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" ); + + // set or update cookie after init and add/remove respectively + if ( o.cookie ) { + this._cookie( o.selected, o.cookie ); + } + + // disable tabs + for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) { + $( li )[ $.inArray( i, o.disabled ) != -1 && + // TODO: use .toggleClass() + !$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" ); + } + + // reset cache if switching from cached to not cached + if ( o.cache === false ) { + this.anchors.removeData( "cache.tabs" ); + } + + // remove all handlers before, tabify may run on existing tabs after add or option change + this.lis.add( this.anchors ).unbind( ".tabs" ); + + if ( o.event !== "mouseover" ) { + var addState = function( state, el ) { + if ( el.is( ":not(.ui-state-disabled)" ) ) { + el.addClass( "ui-state-" + state ); + } + }; + var removeState = function( state, el ) { + el.removeClass( "ui-state-" + state ); + }; + this.lis.bind( "mouseover.tabs" , function() { + addState( "hover", $( this ) ); + }); + this.lis.bind( "mouseout.tabs", function() { + removeState( "hover", $( this ) ); + }); + this.anchors.bind( "focus.tabs", function() { + addState( "focus", $( this ).closest( "li" ) ); + }); + this.anchors.bind( "blur.tabs", function() { + removeState( "focus", $( this ).closest( "li" ) ); + }); + } + + // set up animations + var hideFx, showFx; + if ( o.fx ) { + if ( $.isArray( o.fx ) ) { + hideFx = o.fx[ 0 ]; + showFx = o.fx[ 1 ]; + } else { + hideFx = showFx = o.fx; + } + } + + // Reset certain styles left over from animation + // and prevent IE's ClearType bug... + function resetStyle( $el, fx ) { + $el.css( "display", "" ); + if ( !$.support.opacity && fx.opacity ) { + $el[ 0 ].style.removeAttribute( "filter" ); + } + } + + // Show a tab... + var showTab = showFx + ? function( clicked, $show ) { + $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" ); + $show.hide().removeClass( "ui-tabs-hide" ) // avoid flicker that way + .animate( showFx, showFx.duration || "normal", function() { + resetStyle( $show, showFx ); + self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) ); + }); + } + : function( clicked, $show ) { + $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" ); + $show.removeClass( "ui-tabs-hide" ); + self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) ); + }; + + // Hide a tab, $show is optional... + var hideTab = hideFx + ? function( clicked, $hide ) { + $hide.animate( hideFx, hideFx.duration || "normal", function() { + self.lis.removeClass( "ui-tabs-selected ui-state-active" ); + $hide.addClass( "ui-tabs-hide" ); + resetStyle( $hide, hideFx ); + self.element.dequeue( "tabs" ); + }); + } + : function( clicked, $hide, $show ) { + self.lis.removeClass( "ui-tabs-selected ui-state-active" ); + $hide.addClass( "ui-tabs-hide" ); + self.element.dequeue( "tabs" ); + }; + + // attach tab event handler, unbind to avoid duplicates from former tabifying... + this.anchors.bind( o.event + ".tabs", function() { + var el = this, + $li = $(el).closest( "li" ), + $hide = self.panels.filter( ":not(.ui-tabs-hide)" ), + $show = self.element.find( self._sanitizeSelector( el.hash ) ); + + // If tab is already selected and not collapsible or tab disabled or + // or is already loading or click callback returns false stop here. + // Check if click handler returns false last so that it is not executed + // for a disabled or loading tab! + if ( ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) || + $li.hasClass( "ui-state-disabled" ) || + $li.hasClass( "ui-state-processing" ) || + self.panels.filter( ":animated" ).length || + self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) { + this.blur(); + return false; + } + + o.selected = self.anchors.index( this ); + + self.abort(); + + // if tab may be closed + if ( o.collapsible ) { + if ( $li.hasClass( "ui-tabs-selected" ) ) { + o.selected = -1; + + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + self.element.queue( "tabs", function() { + hideTab( el, $hide ); + }).dequeue( "tabs" ); + + this.blur(); + return false; + } else if ( !$hide.length ) { + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + self.element.queue( "tabs", function() { + showTab( el, $show ); + }); + + // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171 + self.load( self.anchors.index( this ) ); + + this.blur(); + return false; + } + } + + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + // show new tab + if ( $show.length ) { + if ( $hide.length ) { + self.element.queue( "tabs", function() { + hideTab( el, $hide ); + }); + } + self.element.queue( "tabs", function() { + showTab( el, $show ); + }); + + self.load( self.anchors.index( this ) ); + } else { + throw "jQuery UI Tabs: Mismatching fragment identifier."; + } + + // Prevent IE from keeping other link focussed when using the back button + // and remove dotted border from clicked link. This is controlled via CSS + // in modern browsers; blur() removes focus from address bar in Firefox + // which can become a usability and annoying problem with tabs('rotate'). + if ( $.browser.msie ) { + this.blur(); + } + }); + + // disable click in any case + this.anchors.bind( "click.tabs", function(){ + return false; + }); + }, + + _getIndex: function( index ) { + // meta-function to give users option to provide a href string instead of a numerical index. + // also sanitizes numerical indexes to valid values. + if ( typeof index == "string" ) { + index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); + } + + return index; + }, + + destroy: function() { + var o = 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 href = $.data( this, "href.tabs" ); + if ( href ) { + this.href = href; + } + var $this = $( this ).unbind( ".tabs" ); + $.each( [ "href", "load", "cache" ], function( i, prefix ) { + $this.removeData( prefix + ".tabs" ); + }); + }); + + this.lis.unbind( ".tabs" ).add( this.panels ).each(function() { + if ( $.data( this, "destroy.tabs" ) ) { + $( this ).remove(); + } else { + $( 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" + ].join( " " ) ); + } + }); + + if ( o.cookie ) { + this._cookie( null, o.cookie ); + } + + return this; + }, + + add: function( url, label, index ) { + if ( index === undefined ) { + index = this.anchors.length; + } + + var self = this, + o = this.options, + $li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ), + id = !url.indexOf( "#" ) ? url.replace( "#", "" ) : this._tabId( $( "a", $li )[ 0 ] ); + + $li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true ); + + // try to find an existing element before creating a new one + var $panel = self.element.find( "#" + id ); + if ( !$panel.length ) { + $panel = $( o.panelTemplate ) + .attr( "id", id ) + .data( "destroy.tabs", true ); + } + $panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" ); + + if ( index >= this.lis.length ) { + $li.appendTo( this.list ); + $panel.appendTo( this.list[ 0 ].parentNode ); + } else { + $li.insertBefore( this.lis[ index ] ); + $panel.insertBefore( this.panels[ index ] ); + } + + o.disabled = $.map( o.disabled, function( n, i ) { + return n >= index ? ++n : n; + }); + + this._tabify(); + + if ( this.anchors.length == 1 ) { + o.selected = 0; + $li.addClass( "ui-tabs-selected ui-state-active" ); + $panel.removeClass( "ui-tabs-hide" ); + this.element.queue( "tabs", function() { + self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) ); + }); + + this.load( 0 ); + } + + this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + remove: function( index ) { + index = this._getIndex( index ); + var o = this.options, + $li = this.lis.eq( index ).remove(), + $panel = this.panels.eq( index ).remove(); + + // If selected tab was removed focus tab to the right or + // in case the last tab was removed the tab to the left. + if ( $li.hasClass( "ui-tabs-selected" ) && this.anchors.length > 1) { + this.select( index + ( index + 1 < this.anchors.length ? 1 : -1 ) ); + } + + o.disabled = $.map( + $.grep( o.disabled, function(n, i) { + return n != index; + }), + function( n, i ) { + return n >= index ? --n : n; + }); + + this._tabify(); + + this._trigger( "remove", null, this._ui( $li.find( "a" )[ 0 ], $panel[ 0 ] ) ); + return this; + }, + + enable: function( index ) { + index = this._getIndex( index ); + var o = this.options; + if ( $.inArray( index, o.disabled ) == -1 ) { + return; + } + + this.lis.eq( index ).removeClass( "ui-state-disabled" ); + o.disabled = $.grep( o.disabled, function( n, i ) { + return n != index; + }); + + this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + disable: function( index ) { + index = this._getIndex( index ); + var self = this, o = this.options; + // cannot disable already selected tab + if ( index != o.selected ) { + this.lis.eq( index ).addClass( "ui-state-disabled" ); + + o.disabled.push( index ); + o.disabled.sort(); + + this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + } + + return this; + }, + + select: function( index ) { + index = this._getIndex( index ); + if ( index == -1 ) { + if ( this.options.collapsible && this.options.selected != -1 ) { + index = this.options.selected; + } else { + return this; + } + } + this.anchors.eq( index ).trigger( this.options.event + ".tabs" ); + return this; + }, + + load: function( index ) { + index = this._getIndex( index ); + var self = this, + o = this.options, + a = this.anchors.eq( index )[ 0 ], + url = $.data( a, "load.tabs" ); + + this.abort(); + + // not remote or from cache + if ( !url || this.element.queue( "tabs" ).length !== 0 && $.data( a, "cache.tabs" ) ) { + this.element.dequeue( "tabs" ); + return; + } + + // load remote from here on + this.lis.eq( index ).addClass( "ui-state-processing" ); + + if ( o.spinner ) { + var span = $( "span", a ); + span.data( "label.tabs", span.html() ).html( o.spinner ); + } + + this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, { + url: url, + success: function( r, s ) { + self.element.find( self._sanitizeSelector( a.hash ) ).html( r ); + + // take care of tab labels + self._cleanup(); + + if ( o.cache ) { + $.data( a, "cache.tabs", true ); + } + + self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) ); + try { + o.ajaxOptions.success( r, s ); + } + catch ( e ) {} + }, + error: function( xhr, s, e ) { + // take care of tab labels + self._cleanup(); + + self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) ); + try { + // Passing index avoid a race condition when this method is + // called after the user has selected another tab. + // Pass the anchor that initiated this request allows + // loadError to manipulate the tab content panel via $(a.hash) + o.ajaxOptions.error( xhr, s, index, a ); + } + catch ( e ) {} + } + } ) ); + + // last, so that load event is fired before show... + self.element.dequeue( "tabs" ); + + return this; + }, + + abort: function() { + // stop possibly running animations + this.element.queue( [] ); + this.panels.stop( false, true ); + + // "tabs" queue must not contain more than two elements, + // which are the callbacks for the latest clicked tab... + this.element.queue( "tabs", this.element.queue( "tabs" ).splice( -2, 2 ) ); + + // terminate pending requests from other tabs + if ( this.xhr ) { + this.xhr.abort(); + delete this.xhr; + } + + // take care of tab labels + this._cleanup(); + return this; + }, + + url: function( index, url ) { + this.anchors.eq( index ).removeData( "cache.tabs" ).data( "load.tabs", url ); + return this; + }, + + length: function() { + return this.anchors.length; + } +}); + +$.extend( $.ui.tabs, { + version: "1.8.21" +}); + +/* + * Tabs Extensions + */ + +/* + * Rotate + */ +$.extend( $.ui.tabs.prototype, { + rotation: null, + rotate: function( ms, continuing ) { + var self = this, + o = this.options; + + var rotate = self._rotate || ( self._rotate = function( e ) { + clearTimeout( self.rotation ); + self.rotation = setTimeout(function() { + var t = o.selected; + self.select( ++t < self.anchors.length ? t : 0 ); + }, ms ); + + if ( e ) { + e.stopPropagation(); + } + }); + + var stop = self._unrotate || ( self._unrotate = !continuing + ? function(e) { + if (e.clientX) { // in case of a true click + self.rotate(null); + } + } + : function( e ) { + rotate(); + }); + + // start rotation + if ( ms ) { + this.element.bind( "tabsshow", rotate ); + this.anchors.bind( o.event + ".tabs", stop ); + rotate(); + // stop rotation + } else { + clearTimeout( self.rotation ); + this.element.unbind( "tabsshow", rotate ); + this.anchors.unbind( o.event + ".tabs", stop ); + delete this._rotate; + delete this._unrotate; + } + + return this; + } +}); + +})( jQuery ); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.widget.js b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.widget.js new file mode 100644 index 00000000..4f7aea7f --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/jquery.ui.widget.js @@ -0,0 +1,272 @@ +/*! + * jQuery UI Widget 1.8.21 + * + * Copyright 2012, 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/Widget + */ +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + try { + $( this ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.blind.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.blind.min.js new file mode 100644 index 00000000..0100e04d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.blind.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.blind.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.bounce.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.bounce.min.js new file mode 100644 index 00000000..9287124d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.bounce.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.bounce.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;try{e.id}catch(f){e=document.body}return b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;return b.parent().is(".ui-effects-wrapper")?(c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus(),c):b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.fade.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.fade.min.js new file mode 100644 index 00000000..5f7f15f6 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.fade.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fade.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.fold.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.fold.min.js new file mode 100644 index 00000000..1882e134 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.fold.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fold.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.highlight.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.highlight.min.js new file mode 100644 index 00000000..240b3d42 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.highlight.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.highlight.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.pulsate.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.pulsate.min.js new file mode 100644 index 00000000..a646af07 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.effects.pulsate.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.pulsate.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show"),e=(b.options.times||5)*2-1,f=b.duration?b.duration/2:a.fx.speeds._default/2,g=c.is(":visible"),h=0;g||(c.css("opacity",0).show(),h=1),(d=="hide"&&g||d=="show"&&!g)&&e--;for(var i=0;i').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.accordion.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.accordion.min.js new file mode 100644 index 00000000..9860d99b --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.accordion.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.accordion.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}return f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];return this._clickHandler({target:b},b),this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(d.disabled)return;if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!g)return;return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),a.extend(a.ui.accordion,{version:"1.8.21",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size()){b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.autocomplete.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.autocomplete.min.js new file mode 100644 index 00000000..078d820f --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.autocomplete.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.autocomplete.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("
                ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):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",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},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(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()
                ",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.core.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.core.min.js new file mode 100644 index 00000000..53eaa4d3 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.core.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.21",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}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a'))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.21"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
                ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
                '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
                ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
                '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
                '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
                '+this._get(a,"weekHeader")+"
                '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
                "+(j?""+(g[0]>0&&N==g[1]-1?'
                ':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
                ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
                ",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.21",window["DP_jQuery_"+dpuuid]=$})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.dialog.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.dialog.min.js new file mode 100644 index 00000000..f8073639 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.dialog.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.dialog.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
                ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
                ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){return b.close(a),!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;return a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle),a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1===c._trigger("beforeClose",b))return;return c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d),c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;return e.modal&&!b||!e.stack&&!e.modal?d._trigger("focus",c):(e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c),d)},open:function(){if(this._isOpen)return;var b=this,c=b.options,d=b.uiDialog;return b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode!==a.ui.keyCode.TAB)return;var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey)return d.focus(1),!1;if(b.target===d[0]&&b.shiftKey)return e.focus(1),!1}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open"),b},_createButtons:function(b){var c=this,d=!1,e=a("
                ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
                ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){if(a==="click")return;a in f?e[a](b):e.attr(a,b)}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.21",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");return b||(this.uuid+=1,b=this.uuid),"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return a.fn.bgiframe&&c.bgiframe(),this.instances.push(c),c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;return a.browser.msie&&a.browser.version<7?(b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),b').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.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},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.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";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.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()}}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,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_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(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.position.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.position.min.js new file mode 100644 index 00000000..9cfbc61d --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.position.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.position.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.progressbar.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.progressbar.min.js new file mode 100644 index 00000000..2a6aa554 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.progressbar.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.progressbar.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
                ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){return a===b?this._value():(this._setOption("value",a),this)},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.21"})})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.resizable.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.resizable.min.js new file mode 100644 index 00000000..52b1824a --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.resizable.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.resizable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('
                ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e');h.css({zIndex:c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);return l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.21"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/d.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*d.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.selectable.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.selectable.min.js new file mode 100644 index 00000000..b3b80cb2 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.selectable.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.selectable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
                ")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1){this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);return}if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.21"})})(jQuery); \ No newline at end of file diff --git a/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.sortable.min.js b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.sortable.min.js new file mode 100644 index 00000000..6dddf285 --- /dev/null +++ b/static/grappelli_orig/js/ui/development-bundle/ui/minified/jquery.ui.sortable.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.sortable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),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},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=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 c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return 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(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.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()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.leftthis.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
              • #{label}
              • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(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"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},destroy:function(){var b=this.options;return 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 b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(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"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.21"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a + + + + jQuery UI Example Page + + + + + + + +

                Welcome to jQuery UI!

                +

                This page demonstrates the widgets you downloaded using the theme you selected in the download builder. We've included and linked to minified versions of jQuery, your personalized copy of jQuery UI (js/jquery-ui-1.8.21.custom.min.js), and css/ui-lightness/jquery-ui-1.8.21.custom.css which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs.

                +

                You've downloaded components and a theme that are compatible with jQuery 1.3+. Please make sure you are using jQuery 1.3+ in your production environment.

                + +

                YOUR COMPONENTS:

                + + +

                Accordion

                +
                +
                +

                First

                +
                Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
                +
                +
                +

                Second

                +
                Phasellus mattis tincidunt nibh.
                +
                +
                +

                Third

                +
                Nam dui erat, auctor a, dignissim quis.
                +
                +
                + + +

                Autocomplete

                +
                + +
                + + +

                Button

                + +
                +
                + + + +
                +
                + + + +

                Tabs

                +
                + +
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                +
                Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.
                +
                Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
                +
                + + +

                Dialog

                +

                Open Dialog

                + + +

                Overlay and Shadow Classes (not currently used in UI widgets)

                +
                +

                Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat.

                Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci.

                Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat.

                Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam.

                Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante.

                Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi.

                + + +
                +
                +
                +

                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

                +
                +
                + +
                + + + +
                +

                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

                +
                + + +

                Framework Icons (content color preview)

                +
                  + +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • +
                • + +
                • +
                • +
                • +
                • +
                • +
                + + + +

                Slider

                +
                + + +

                Datepicker

                +
                + + +

                Progressbar

                +
                + + +

                Highlight / Error

                +
                +
                +

                + Hey! Sample ui-state-highlight style.

                +
                +
                +
                +
                +
                +

                + Alert: Sample ui-state-error style.

                +
                +
                + + + + + diff --git a/static/grappelli_orig/js/ui/jquery-ui-1.8.21.custom.zip b/static/grappelli_orig/js/ui/jquery-ui-1.8.21.custom.zip new file mode 100644 index 00000000..9435105a Binary files /dev/null and b/static/grappelli_orig/js/ui/jquery-ui-1.8.21.custom.zip differ diff --git a/static/grappelli_orig/js/ui/js/jquery-1.7.2.min.js b/static/grappelli_orig/js/ui/js/jquery-1.7.2.min.js new file mode 100644 index 00000000..16ad06c5 --- /dev/null +++ b/static/grappelli_orig/js/ui/js/jquery-1.7.2.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 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 cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(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(;e=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)?+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.2",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!=null&&a==a.window},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){if(typeof c!="string"||!c)return null;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=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.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:p.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,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
                "+""+"
                ",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
                t
                ",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
                ",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});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;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-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.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];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,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\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,g=p.selector),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&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?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));o.match.globalPOS=p;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|bdi|canvas|data|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:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],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){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},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){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.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(;d1&&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||f.isXMLDoc(a)||!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,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$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))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=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)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.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(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),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)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.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(bM,"")).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||bN.test(this.nodeName)||bH.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(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\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:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},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:bY(bS),ajaxTransport:bY(bT),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?ca(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=cb(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=bG.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(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.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]!=="*"?", "+bW+"; 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=bZ(bT,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)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.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(cd,l),b.url===j&&(e&&(k=k.replace(cd,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 ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,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,ce&&delete cg[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);try{m.text=h.responseText}catch(a){}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=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("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({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),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/static/grappelli_orig/js/ui/js/jquery-ui-1.8.21.custom.min.js b/static/grappelli_orig/js/ui/js/jquery-ui-1.8.21.custom.min.js new file mode 100644 index 00000000..3fe9ccb7 --- /dev/null +++ b/static/grappelli_orig/js/ui/js/jquery-ui-1.8.21.custom.min.js @@ -0,0 +1,125 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.21",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}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_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(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.position.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.draggable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){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"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
                ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.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},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.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";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.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()}}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,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h
                ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e');h.css({zIndex:c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);return l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.21"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/d.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*d.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.selectable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
                ")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),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},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=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 c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return 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(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.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()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.leftthis.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}return f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];return this._clickHandler({target:b},b),this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(d.disabled)return;if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!g)return;return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),a.extend(a.ui.accordion,{version:"1.8.21",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size()){b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.autocomplete.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("
                  ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):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",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},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(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.dialog.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
                  ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
                  ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){return b.close(a),!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;return a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle),a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1===c._trigger("beforeClose",b))return;return c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d),c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;return e.modal&&!b||!e.stack&&!e.modal?d._trigger("focus",c):(e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c),d)},open:function(){if(this._isOpen)return;var b=this,c=b.options,d=b.uiDialog;return b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode!==a.ui.keyCode.TAB)return;var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey)return d.focus(1),!1;if(b.target===d[0]&&b.shiftKey)return e.focus(1),!1}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open"),b},_createButtons:function(b){var c=this,d=!1,e=a("
                  ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
                  ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){if(a==="click")return;a in f?e[a](b):e.attr(a,b)}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.21",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");return b||(this.uuid+=1,b=this.uuid),"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return a.fn.bgiframe&&c.bgiframe(),this.instances.push(c),c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;return a.browser.msie&&a.browser.version<7?(b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),b").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1){this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);return}if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.21"})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.tabs.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
                  ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
                • #{label}
                • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(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"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},destroy:function(){var b=this.options;return 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 b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(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"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.21"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a'))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.21"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
                  ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
                  '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
                  ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
                  '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
                  '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
                  '+this._get(a,"weekHeader")+"
                  '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
                  "+(j?""+(g[0]>0&&N==g[1]-1?'
                  ':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
                  ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
                  ",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.21",window["DP_jQuery_"+dpuuid]=$})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.progressbar.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
                  ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){return a===b?this._value():(this._setOption("value",a),this)},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.21"})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&b.length==3?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:(c=/rgba\(0, 0, 0, 0\)/.exec(b))?e.transparent:e[a.trim(b).toLowerCase()]}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};return a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete,[b,c,d,e]}function l(b){return!b||typeof b=="number"||a.fx.speeds[b]?!0:typeof b=="string"&&!a.effects[b]?!0:!1}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){return a.isFunction(d)&&(e=d,d=null),this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class")||"";a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.21",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;try{e.id}catch(f){e=document.body}return b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;return b.parent().is(".ui-effects-wrapper")?(c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus(),c):b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fade.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fold.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.highlight.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.pulsate.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show"),e=(b.options.times||5)*2-1,f=b.duration?b.duration/2:a.fx.speeds._default/2,g=c.is(":visible"),h=0;g||(c.css("opacity",0).show(),h=1),(d=="hide"&&g||d=="show"&&!g)&&e--;for(var i=0;i').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/static/grappelli_orig/js/urlify.js b/static/grappelli_orig/js/urlify.js new file mode 100644 index 00000000..d8f2549e --- /dev/null +++ b/static/grappelli_orig/js/urlify.js @@ -0,0 +1,140 @@ +var LATIN_MAP = { + 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç': + 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I', + 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': + 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ű': 'U', + 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a', 'â': 'a', 'ã': 'a', 'ä': + 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', + 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': + 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', + 'û': 'u', 'ü': 'u', 'ű': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y' +} +var LATIN_SYMBOLS_MAP = { + '©':'(c)' +} +var GREEK_MAP = { + 'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8', + 'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p', + 'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w', + 'ά':'a', 'έ':'e', 'ί':'i', 'ό':'o', 'ύ':'y', 'ή':'h', 'ώ':'w', 'ς':'s', + 'ϊ':'i', 'ΰ':'y', 'ϋ':'y', 'ΐ':'i', + 'Α':'A', 'Β':'B', 'Γ':'G', 'Δ':'D', 'Ε':'E', 'Ζ':'Z', 'Η':'H', 'Θ':'8', + 'Ι':'I', 'Κ':'K', 'Λ':'L', 'Μ':'M', 'Ν':'N', 'Ξ':'3', 'Ο':'O', 'Π':'P', + 'Ρ':'R', 'Σ':'S', 'Τ':'T', 'Υ':'Y', 'Φ':'F', 'Χ':'X', 'Ψ':'PS', 'Ω':'W', + 'Ά':'A', 'Έ':'E', 'Ί':'I', 'Ό':'O', 'Ύ':'Y', 'Ή':'H', 'Ώ':'W', 'Ϊ':'I', + 'Ϋ':'Y' +} +var TURKISH_MAP = { + 'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U', + 'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G' +} +var RUSSIAN_MAP = { + 'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh', + 'з':'z', 'и':'i', 'й':'j', 'к':'k', 'л':'l', 'м':'m', 'н':'n', 'о':'o', + 'п':'p', 'р':'r', 'с':'s', 'т':'t', 'у':'u', 'ф':'f', 'х':'h', 'ц':'c', + 'ч':'ch', 'ш':'sh', 'щ':'sh', 'ъ':'', 'ы':'y', 'ь':'', 'э':'e', 'ю':'yu', + 'я':'ya', + 'А':'A', 'Б':'B', 'В':'V', 'Г':'G', 'Д':'D', 'Е':'E', 'Ё':'Yo', 'Ж':'Zh', + 'З':'Z', 'И':'I', 'Й':'J', 'К':'K', 'Л':'L', 'М':'M', 'Н':'N', 'О':'O', + 'П':'P', 'Р':'R', 'С':'S', 'Т':'T', 'У':'U', 'Ф':'F', 'Х':'H', 'Ц':'C', + 'Ч':'Ch', 'Ш':'Sh', 'Щ':'Sh', 'Ъ':'', 'Ы':'Y', 'Ь':'', 'Э':'E', 'Ю':'Yu', + 'Я':'Ya' +} +var UKRAINIAN_MAP = { + 'Є':'Ye', 'І':'I', 'Ї':'Yi', 'Ґ':'G', 'є':'ye', 'і':'i', 'ї':'yi', 'ґ':'g' +} +var CZECH_MAP = { + 'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u', + 'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T', + 'Ů':'U', 'Ž':'Z' +} + +var POLISH_MAP = { + 'ą':'a', 'ć':'c', 'ę':'e', 'ł':'l', 'ń':'n', 'ó':'o', 'ś':'s', 'ź':'z', + 'ż':'z', 'Ą':'A', 'Ć':'C', 'Ę':'e', 'Ł':'L', 'Ń':'N', 'Ó':'o', 'Ś':'S', + 'Ź':'Z', 'Ż':'Z' +} + +var LATVIAN_MAP = { + 'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n', + 'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i', + 'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z' +} + +var ALL_DOWNCODE_MAPS=new Array() +ALL_DOWNCODE_MAPS[0]=LATIN_MAP +ALL_DOWNCODE_MAPS[1]=LATIN_SYMBOLS_MAP +ALL_DOWNCODE_MAPS[2]=GREEK_MAP +ALL_DOWNCODE_MAPS[3]=TURKISH_MAP +ALL_DOWNCODE_MAPS[4]=RUSSIAN_MAP +ALL_DOWNCODE_MAPS[5]=UKRAINIAN_MAP +ALL_DOWNCODE_MAPS[6]=CZECH_MAP +ALL_DOWNCODE_MAPS[7]=POLISH_MAP +ALL_DOWNCODE_MAPS[8]=LATVIAN_MAP + +var Downcoder = new Object(); +Downcoder.Initialize = function() +{ + if (Downcoder.map) // already made + return ; + Downcoder.map ={} + Downcoder.chars = '' ; + for(var i in ALL_DOWNCODE_MAPS) + { + var lookup = ALL_DOWNCODE_MAPS[i] + for (var c in lookup) + { + Downcoder.map[c] = lookup[c] ; + Downcoder.chars += c ; + } + } + Downcoder.regex = new RegExp('[' + Downcoder.chars + ']|[^' + Downcoder.chars + ']+','g') ; +} + +downcode= function( slug ) +{ + Downcoder.Initialize() ; + var downcoded ="" + var pieces = slug.match(Downcoder.regex); + if(pieces) + { + for (var i = 0 ; i < pieces.length ; i++) + { + if (pieces[i].length == 1) + { + var mapped = Downcoder.map[pieces[i]] ; + if (mapped != null) + { + downcoded+=mapped; + continue ; + } + } + downcoded+=pieces[i]; + } + } + else + { + downcoded = slug; + } + return downcoded; +} + + +function URLify(s, num_chars) { + // changes, e.g., "Petty theft" to "petty_theft" + // remove all these words from the string before urlifying + s = downcode(s); + removelist = ["a", "an", "as", "at", "before", "but", "by", "for", "from", + "is", "in", "into", "like", "of", "off", "on", "onto", "per", + "since", "than", "the", "this", "that", "to", "up", "via", + "with"]; + r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi'); + s = s.replace(r, ''); + // if downcode doesn't hit, the char will be stripped here + s = s.replace(/[^-\w\s]/g, ''); // remove unneeded chars + s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces + s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens + s = s.toLowerCase(); // convert to lowercase + return s.substring(0, num_chars);// trim to first num_chars chars +} + diff --git a/static/grappelli_orig/stylesheets/ie7.css b/static/grappelli_orig/stylesheets/ie7.css new file mode 100644 index 00000000..ada669ce --- /dev/null +++ b/static/grappelli_orig/stylesheets/ie7.css @@ -0,0 +1 @@ +.grp-layout-container-fluid .column{float:left}.grp-layout-container-fluid .column.span-fluid{float:left;white-space:normal;overflow:hidden} diff --git a/static/grappelli_orig/stylesheets/mueller/grid/output.css b/static/grappelli_orig/stylesheets/mueller/grid/output.css new file mode 100644 index 00000000..ccbdf9f4 --- /dev/null +++ b/static/grappelli_orig/stylesheets/mueller/grid/output.css @@ -0,0 +1 @@ +body{font-size:75%;line-height:1.333em}html>body{font-size:12px}.g-d-c,.g-all-c{width:940px}.g-d,.g-d-24,.g-d-23,.g-d-22,.g-d-21,.g-d-20,.g-d-19,.g-d-18,.g-d-17,.g-d-16,.g-d-15,.g-d-14,.g-d-13,.g-d-12,.g-d-11,.g-d-10,.g-d-9,.g-d-8,.g-d-7,.g-d-6,.g-d-5,.g-d-4,.g-d-3,.g-d-2,.g-d-1,.g-d-0{float:left;*zoom:1}.g-d:after,.g-d-24:after,.g-d-23:after,.g-d-22:after,.g-d-21:after,.g-d-20:after,.g-d-19:after,.g-d-18:after,.g-d-17:after,.g-d-16:after,.g-d-15:after,.g-d-14:after,.g-d-13:after,.g-d-12:after,.g-d-11:after,.g-d-10:after,.g-d-9:after,.g-d-8:after,.g-d-7:after,.g-d-6:after,.g-d-5:after,.g-d-4:after,.g-d-3:after,.g-d-2:after,.g-d-1:after,.g-d-0:after{content:"";display:table;clear:both}.g-d-f,.g-d-24,.g-all-f,.g-all-fl{margin-left:0 !important;margin-right:20px !important;clear:left}.g-d-l,.g-d-24,.g-all-l,.g-all-fl{margin-right:0 !important}.g-d-prepend24{padding-left:960px !important}.g-d-append24{padding-right:960px !important}.g-d-push24{position:relative;margin-left:960px !important;margin-right:-960px !important;margin-top:0;margin-bottom:0}.g-d-pull24{position:relative;margin-left:-940px !important}.g-d-prepend23{padding-left:920px !important}.g-d-append23{padding-right:920px !important}.g-d-push23{position:relative;margin-left:920px !important;margin-right:-920px !important;margin-top:0;margin-bottom:0}.g-d-pull23{position:relative;margin-left:-900px !important}.g-d-prepend22{padding-left:880px !important}.g-d-append22{padding-right:880px !important}.g-d-push22{position:relative;margin-left:880px !important;margin-right:-880px !important;margin-top:0;margin-bottom:0}.g-d-pull22{position:relative;margin-left:-860px !important}.g-d-prepend21{padding-left:840px !important}.g-d-append21{padding-right:840px !important}.g-d-push21{position:relative;margin-left:840px !important;margin-right:-840px !important;margin-top:0;margin-bottom:0}.g-d-pull21{position:relative;margin-left:-820px !important}.g-d-prepend20{padding-left:800px !important}.g-d-append20{padding-right:800px !important}.g-d-push20{position:relative;margin-left:800px !important;margin-right:-800px !important;margin-top:0;margin-bottom:0}.g-d-pull20{position:relative;margin-left:-780px !important}.g-d-prepend19{padding-left:760px !important}.g-d-append19{padding-right:760px !important}.g-d-push19{position:relative;margin-left:760px !important;margin-right:-760px !important;margin-top:0;margin-bottom:0}.g-d-pull19{position:relative;margin-left:-740px !important}.g-d-prepend18{padding-left:720px !important}.g-d-append18{padding-right:720px !important}.g-d-push18{position:relative;margin-left:720px !important;margin-right:-720px !important;margin-top:0;margin-bottom:0}.g-d-pull18{position:relative;margin-left:-700px !important}.g-d-prepend17{padding-left:680px !important}.g-d-append17{padding-right:680px !important}.g-d-push17{position:relative;margin-left:680px !important;margin-right:-680px !important;margin-top:0;margin-bottom:0}.g-d-pull17{position:relative;margin-left:-660px !important}.g-d-prepend16{padding-left:640px !important}.g-d-append16{padding-right:640px !important}.g-d-push16{position:relative;margin-left:640px !important;margin-right:-640px !important;margin-top:0;margin-bottom:0}.g-d-pull16{position:relative;margin-left:-620px !important}.g-d-prepend15{padding-left:600px !important}.g-d-append15{padding-right:600px !important}.g-d-push15{position:relative;margin-left:600px !important;margin-right:-600px !important;margin-top:0;margin-bottom:0}.g-d-pull15{position:relative;margin-left:-580px !important}.g-d-prepend14{padding-left:560px !important}.g-d-append14{padding-right:560px !important}.g-d-push14{position:relative;margin-left:560px !important;margin-right:-560px !important;margin-top:0;margin-bottom:0}.g-d-pull14{position:relative;margin-left:-540px !important}.g-d-prepend13{padding-left:520px !important}.g-d-append13{padding-right:520px !important}.g-d-push13{position:relative;margin-left:520px !important;margin-right:-520px !important;margin-top:0;margin-bottom:0}.g-d-pull13{position:relative;margin-left:-500px !important}.g-d-prepend12{padding-left:480px !important}.g-d-append12{padding-right:480px !important}.g-d-push12{position:relative;margin-left:480px !important;margin-right:-480px !important;margin-top:0;margin-bottom:0}.g-d-pull12{position:relative;margin-left:-460px !important}.g-d-prepend11{padding-left:440px !important}.g-d-append11{padding-right:440px !important}.g-d-push11{position:relative;margin-left:440px !important;margin-right:-440px !important;margin-top:0;margin-bottom:0}.g-d-pull11{position:relative;margin-left:-420px !important}.g-d-prepend10{padding-left:400px !important}.g-d-append10{padding-right:400px !important}.g-d-push10{position:relative;margin-left:400px !important;margin-right:-400px !important;margin-top:0;margin-bottom:0}.g-d-pull10{position:relative;margin-left:-380px !important}.g-d-prepend9{padding-left:360px !important}.g-d-append9{padding-right:360px !important}.g-d-push9{position:relative;margin-left:360px !important;margin-right:-360px !important;margin-top:0;margin-bottom:0}.g-d-pull9{position:relative;margin-left:-340px !important}.g-d-prepend8{padding-left:320px !important}.g-d-append8{padding-right:320px !important}.g-d-push8{position:relative;margin-left:320px !important;margin-right:-320px !important;margin-top:0;margin-bottom:0}.g-d-pull8{position:relative;margin-left:-300px !important}.g-d-prepend7{padding-left:280px !important}.g-d-append7{padding-right:280px !important}.g-d-push7{position:relative;margin-left:280px !important;margin-right:-280px !important;margin-top:0;margin-bottom:0}.g-d-pull7{position:relative;margin-left:-260px !important}.g-d-prepend6{padding-left:240px !important}.g-d-append6{padding-right:240px !important}.g-d-push6{position:relative;margin-left:240px !important;margin-right:-240px !important;margin-top:0;margin-bottom:0}.g-d-pull6{position:relative;margin-left:-220px !important}.g-d-prepend5{padding-left:200px !important}.g-d-append5{padding-right:200px !important}.g-d-push5{position:relative;margin-left:200px !important;margin-right:-200px !important;margin-top:0;margin-bottom:0}.g-d-pull5{position:relative;margin-left:-180px !important}.g-d-prepend4{padding-left:160px !important}.g-d-append4{padding-right:160px !important}.g-d-push4{position:relative;margin-left:160px !important;margin-right:-160px !important;margin-top:0;margin-bottom:0}.g-d-pull4{position:relative;margin-left:-140px !important}.g-d-prepend3{padding-left:120px !important}.g-d-append3{padding-right:120px !important}.g-d-push3{position:relative;margin-left:120px !important;margin-right:-120px !important;margin-top:0;margin-bottom:0}.g-d-pull3{position:relative;margin-left:-100px !important}.g-d-prepend2{padding-left:80px !important}.g-d-append2{padding-right:80px !important}.g-d-push2{position:relative;margin-left:80px !important;margin-right:-80px !important;margin-top:0;margin-bottom:0}.g-d-pull2{position:relative;margin-left:-60px !important}.g-d-prepend1{padding-left:40px !important}.g-d-append1{padding-right:40px !important}.g-d-push1{position:relative;margin-left:40px !important;margin-right:-40px !important;margin-top:0;margin-bottom:0}.g-d-pull1{position:relative;margin-left:-20px !important}.g-d-prepend0{padding-left:0px !important}.g-d-append0{padding-right:0px !important}.g-d-push0{position:relative;margin-left:0px !important;margin-right:0px !important;margin-top:0;margin-bottom:0}.g-d-pull0{position:relative;margin-left:20px !important}.g-d-24{width:940px}.g-d-23{margin-right:20px;width:900px}.g-d-22{margin-right:20px;width:860px}.g-d-21{margin-right:20px;width:820px}.g-d-20{margin-right:20px;width:780px}.g-d-19{margin-right:20px;width:740px}.g-d-18{margin-right:20px;width:700px}.g-d-17{margin-right:20px;width:660px}.g-d-16{margin-right:20px;width:620px}.g-d-15{margin-right:20px;width:580px}.g-d-14{margin-right:20px;width:540px}.g-d-13{margin-right:20px;width:500px}.g-d-12{margin-right:20px;width:460px}.g-d-11{margin-right:20px;width:420px}.g-d-10{margin-right:20px;width:380px}.g-d-9{margin-right:20px;width:340px}.g-d-8{margin-right:20px;width:300px}.g-d-7{margin-right:20px;width:260px}.g-d-6{margin-right:20px;width:220px}.g-d-5{margin-right:20px;width:180px}.g-d-4{margin-right:20px;width:140px}.g-d-3{margin-right:20px;width:100px}.g-d-2{margin-right:20px;width:60px}.g-d-1{margin-right:20px;width:20px}.g-d-0{margin-right:20px;width:-20px}.g-d-c-fluid .g-d-24{width:960px}.g-d-c-fluid .g-d-24,.g-d-c-fluid .g-d-24.g-all-l,.g-d-c-fluid .g-d-24.g-all-fl{width:940px}.g-d-c-fluid .g-d-24 .g-d-24{width:940px}.g-d-c-fluid .g-d-24 .g-d-23{width:900px}.g-d-c-fluid .g-d-24 .g-d-22{width:860px}.g-d-c-fluid .g-d-24 .g-d-21{width:820px}.g-d-c-fluid .g-d-24 .g-d-20{width:780px}.g-d-c-fluid .g-d-24 .g-d-19{width:740px}.g-d-c-fluid .g-d-24 .g-d-18{width:700px}.g-d-c-fluid .g-d-24 .g-d-17{width:660px}.g-d-c-fluid .g-d-24 .g-d-16{width:620px}.g-d-c-fluid .g-d-24 .g-d-15{width:580px}.g-d-c-fluid .g-d-24 .g-d-14{width:540px}.g-d-c-fluid .g-d-24 .g-d-13{width:500px}.g-d-c-fluid .g-d-24 .g-d-12{width:460px}.g-d-c-fluid .g-d-24 .g-d-11{width:420px}.g-d-c-fluid .g-d-24 .g-d-10{width:380px}.g-d-c-fluid .g-d-24 .g-d-9{width:340px}.g-d-c-fluid .g-d-24 .g-d-8{width:300px}.g-d-c-fluid .g-d-24 .g-d-7{width:260px}.g-d-c-fluid .g-d-24 .g-d-6{width:220px}.g-d-c-fluid .g-d-24 .g-d-5{width:180px}.g-d-c-fluid .g-d-24 .g-d-4{width:140px}.g-d-c-fluid .g-d-24 .g-d-3{width:100px}.g-d-c-fluid .g-d-24 .g-d-2{width:60px}.g-d-c-fluid .g-d-24 .g-d-1{width:20px}.g-d-c-fluid .g-d-24 .g-d-0{width:-20px}.g-d-c-fluid .g-d-23{width:920px}.g-d-c-fluid .g-d-23.g-d-l,.g-d-c-fluid .g-d-23.g-d-24,.g-d-c-fluid .g-d-23.g-all-l,.g-d-c-fluid .g-d-23.g-all-fl{width:900px}.g-d-c-fluid .g-d-23 .g-d-24{width:940px}.g-d-c-fluid .g-d-23 .g-d-23{width:900px}.g-d-c-fluid .g-d-23 .g-d-22{width:860px}.g-d-c-fluid .g-d-23 .g-d-21{width:820px}.g-d-c-fluid .g-d-23 .g-d-20{width:780px}.g-d-c-fluid .g-d-23 .g-d-19{width:740px}.g-d-c-fluid .g-d-23 .g-d-18{width:700px}.g-d-c-fluid .g-d-23 .g-d-17{width:660px}.g-d-c-fluid .g-d-23 .g-d-16{width:620px}.g-d-c-fluid .g-d-23 .g-d-15{width:580px}.g-d-c-fluid .g-d-23 .g-d-14{width:540px}.g-d-c-fluid .g-d-23 .g-d-13{width:500px}.g-d-c-fluid .g-d-23 .g-d-12{width:460px}.g-d-c-fluid .g-d-23 .g-d-11{width:420px}.g-d-c-fluid .g-d-23 .g-d-10{width:380px}.g-d-c-fluid .g-d-23 .g-d-9{width:340px}.g-d-c-fluid .g-d-23 .g-d-8{width:300px}.g-d-c-fluid .g-d-23 .g-d-7{width:260px}.g-d-c-fluid .g-d-23 .g-d-6{width:220px}.g-d-c-fluid .g-d-23 .g-d-5{width:180px}.g-d-c-fluid .g-d-23 .g-d-4{width:140px}.g-d-c-fluid .g-d-23 .g-d-3{width:100px}.g-d-c-fluid .g-d-23 .g-d-2{width:60px}.g-d-c-fluid .g-d-23 .g-d-1{width:20px}.g-d-c-fluid .g-d-23 .g-d-0{width:-20px}.g-d-c-fluid .g-d-22{width:880px}.g-d-c-fluid .g-d-22.g-d-l,.g-d-c-fluid .g-d-22.g-d-24,.g-d-c-fluid .g-d-22.g-all-l,.g-d-c-fluid .g-d-22.g-all-fl{width:860px}.g-d-c-fluid .g-d-22 .g-d-24{width:940px}.g-d-c-fluid .g-d-22 .g-d-23{width:900px}.g-d-c-fluid .g-d-22 .g-d-22{width:860px}.g-d-c-fluid .g-d-22 .g-d-21{width:820px}.g-d-c-fluid .g-d-22 .g-d-20{width:780px}.g-d-c-fluid .g-d-22 .g-d-19{width:740px}.g-d-c-fluid .g-d-22 .g-d-18{width:700px}.g-d-c-fluid .g-d-22 .g-d-17{width:660px}.g-d-c-fluid .g-d-22 .g-d-16{width:620px}.g-d-c-fluid .g-d-22 .g-d-15{width:580px}.g-d-c-fluid .g-d-22 .g-d-14{width:540px}.g-d-c-fluid .g-d-22 .g-d-13{width:500px}.g-d-c-fluid .g-d-22 .g-d-12{width:460px}.g-d-c-fluid .g-d-22 .g-d-11{width:420px}.g-d-c-fluid .g-d-22 .g-d-10{width:380px}.g-d-c-fluid .g-d-22 .g-d-9{width:340px}.g-d-c-fluid .g-d-22 .g-d-8{width:300px}.g-d-c-fluid .g-d-22 .g-d-7{width:260px}.g-d-c-fluid .g-d-22 .g-d-6{width:220px}.g-d-c-fluid .g-d-22 .g-d-5{width:180px}.g-d-c-fluid .g-d-22 .g-d-4{width:140px}.g-d-c-fluid .g-d-22 .g-d-3{width:100px}.g-d-c-fluid .g-d-22 .g-d-2{width:60px}.g-d-c-fluid .g-d-22 .g-d-1{width:20px}.g-d-c-fluid .g-d-22 .g-d-0{width:-20px}.g-d-c-fluid .g-d-21{width:840px}.g-d-c-fluid .g-d-21.g-d-l,.g-d-c-fluid .g-d-21.g-d-24,.g-d-c-fluid .g-d-21.g-all-l,.g-d-c-fluid .g-d-21.g-all-fl{width:820px}.g-d-c-fluid .g-d-21 .g-d-24{width:940px}.g-d-c-fluid .g-d-21 .g-d-23{width:900px}.g-d-c-fluid .g-d-21 .g-d-22{width:860px}.g-d-c-fluid .g-d-21 .g-d-21{width:820px}.g-d-c-fluid .g-d-21 .g-d-20{width:780px}.g-d-c-fluid .g-d-21 .g-d-19{width:740px}.g-d-c-fluid .g-d-21 .g-d-18{width:700px}.g-d-c-fluid .g-d-21 .g-d-17{width:660px}.g-d-c-fluid .g-d-21 .g-d-16{width:620px}.g-d-c-fluid .g-d-21 .g-d-15{width:580px}.g-d-c-fluid .g-d-21 .g-d-14{width:540px}.g-d-c-fluid .g-d-21 .g-d-13{width:500px}.g-d-c-fluid .g-d-21 .g-d-12{width:460px}.g-d-c-fluid .g-d-21 .g-d-11{width:420px}.g-d-c-fluid .g-d-21 .g-d-10{width:380px}.g-d-c-fluid .g-d-21 .g-d-9{width:340px}.g-d-c-fluid .g-d-21 .g-d-8{width:300px}.g-d-c-fluid .g-d-21 .g-d-7{width:260px}.g-d-c-fluid .g-d-21 .g-d-6{width:220px}.g-d-c-fluid .g-d-21 .g-d-5{width:180px}.g-d-c-fluid .g-d-21 .g-d-4{width:140px}.g-d-c-fluid .g-d-21 .g-d-3{width:100px}.g-d-c-fluid .g-d-21 .g-d-2{width:60px}.g-d-c-fluid .g-d-21 .g-d-1{width:20px}.g-d-c-fluid .g-d-21 .g-d-0{width:-20px}.g-d-c-fluid .g-d-20{width:800px}.g-d-c-fluid .g-d-20.g-d-l,.g-d-c-fluid .g-d-20.g-d-24,.g-d-c-fluid .g-d-20.g-all-l,.g-d-c-fluid .g-d-20.g-all-fl{width:780px}.g-d-c-fluid .g-d-20 .g-d-24{width:940px}.g-d-c-fluid .g-d-20 .g-d-23{width:900px}.g-d-c-fluid .g-d-20 .g-d-22{width:860px}.g-d-c-fluid .g-d-20 .g-d-21{width:820px}.g-d-c-fluid .g-d-20 .g-d-20{width:780px}.g-d-c-fluid .g-d-20 .g-d-19{width:740px}.g-d-c-fluid .g-d-20 .g-d-18{width:700px}.g-d-c-fluid .g-d-20 .g-d-17{width:660px}.g-d-c-fluid .g-d-20 .g-d-16{width:620px}.g-d-c-fluid .g-d-20 .g-d-15{width:580px}.g-d-c-fluid .g-d-20 .g-d-14{width:540px}.g-d-c-fluid .g-d-20 .g-d-13{width:500px}.g-d-c-fluid .g-d-20 .g-d-12{width:460px}.g-d-c-fluid .g-d-20 .g-d-11{width:420px}.g-d-c-fluid .g-d-20 .g-d-10{width:380px}.g-d-c-fluid .g-d-20 .g-d-9{width:340px}.g-d-c-fluid .g-d-20 .g-d-8{width:300px}.g-d-c-fluid .g-d-20 .g-d-7{width:260px}.g-d-c-fluid .g-d-20 .g-d-6{width:220px}.g-d-c-fluid .g-d-20 .g-d-5{width:180px}.g-d-c-fluid .g-d-20 .g-d-4{width:140px}.g-d-c-fluid .g-d-20 .g-d-3{width:100px}.g-d-c-fluid .g-d-20 .g-d-2{width:60px}.g-d-c-fluid .g-d-20 .g-d-1{width:20px}.g-d-c-fluid .g-d-20 .g-d-0{width:-20px}.g-d-c-fluid .g-d-19{width:760px}.g-d-c-fluid .g-d-19.g-d-l,.g-d-c-fluid .g-d-19.g-d-24,.g-d-c-fluid .g-d-19.g-all-l,.g-d-c-fluid .g-d-19.g-all-fl{width:740px}.g-d-c-fluid .g-d-19 .g-d-24{width:940px}.g-d-c-fluid .g-d-19 .g-d-23{width:900px}.g-d-c-fluid .g-d-19 .g-d-22{width:860px}.g-d-c-fluid .g-d-19 .g-d-21{width:820px}.g-d-c-fluid .g-d-19 .g-d-20{width:780px}.g-d-c-fluid .g-d-19 .g-d-19{width:740px}.g-d-c-fluid .g-d-19 .g-d-18{width:700px}.g-d-c-fluid .g-d-19 .g-d-17{width:660px}.g-d-c-fluid .g-d-19 .g-d-16{width:620px}.g-d-c-fluid .g-d-19 .g-d-15{width:580px}.g-d-c-fluid .g-d-19 .g-d-14{width:540px}.g-d-c-fluid .g-d-19 .g-d-13{width:500px}.g-d-c-fluid .g-d-19 .g-d-12{width:460px}.g-d-c-fluid .g-d-19 .g-d-11{width:420px}.g-d-c-fluid .g-d-19 .g-d-10{width:380px}.g-d-c-fluid .g-d-19 .g-d-9{width:340px}.g-d-c-fluid .g-d-19 .g-d-8{width:300px}.g-d-c-fluid .g-d-19 .g-d-7{width:260px}.g-d-c-fluid .g-d-19 .g-d-6{width:220px}.g-d-c-fluid .g-d-19 .g-d-5{width:180px}.g-d-c-fluid .g-d-19 .g-d-4{width:140px}.g-d-c-fluid .g-d-19 .g-d-3{width:100px}.g-d-c-fluid .g-d-19 .g-d-2{width:60px}.g-d-c-fluid .g-d-19 .g-d-1{width:20px}.g-d-c-fluid .g-d-19 .g-d-0{width:-20px}.g-d-c-fluid .g-d-18{width:720px}.g-d-c-fluid .g-d-18.g-d-l,.g-d-c-fluid .g-d-18.g-d-24,.g-d-c-fluid .g-d-18.g-all-l,.g-d-c-fluid .g-d-18.g-all-fl{width:700px}.g-d-c-fluid .g-d-18 .g-d-24{width:940px}.g-d-c-fluid .g-d-18 .g-d-23{width:900px}.g-d-c-fluid .g-d-18 .g-d-22{width:860px}.g-d-c-fluid .g-d-18 .g-d-21{width:820px}.g-d-c-fluid .g-d-18 .g-d-20{width:780px}.g-d-c-fluid .g-d-18 .g-d-19{width:740px}.g-d-c-fluid .g-d-18 .g-d-18{width:700px}.g-d-c-fluid .g-d-18 .g-d-17{width:660px}.g-d-c-fluid .g-d-18 .g-d-16{width:620px}.g-d-c-fluid .g-d-18 .g-d-15{width:580px}.g-d-c-fluid .g-d-18 .g-d-14{width:540px}.g-d-c-fluid .g-d-18 .g-d-13{width:500px}.g-d-c-fluid .g-d-18 .g-d-12{width:460px}.g-d-c-fluid .g-d-18 .g-d-11{width:420px}.g-d-c-fluid .g-d-18 .g-d-10{width:380px}.g-d-c-fluid .g-d-18 .g-d-9{width:340px}.g-d-c-fluid .g-d-18 .g-d-8{width:300px}.g-d-c-fluid .g-d-18 .g-d-7{width:260px}.g-d-c-fluid .g-d-18 .g-d-6{width:220px}.g-d-c-fluid .g-d-18 .g-d-5{width:180px}.g-d-c-fluid .g-d-18 .g-d-4{width:140px}.g-d-c-fluid .g-d-18 .g-d-3{width:100px}.g-d-c-fluid .g-d-18 .g-d-2{width:60px}.g-d-c-fluid .g-d-18 .g-d-1{width:20px}.g-d-c-fluid .g-d-18 .g-d-0{width:-20px}.g-d-c-fluid .g-d-17{width:680px}.g-d-c-fluid .g-d-17.g-d-l,.g-d-c-fluid .g-d-17.g-d-24,.g-d-c-fluid .g-d-17.g-all-l,.g-d-c-fluid .g-d-17.g-all-fl{width:660px}.g-d-c-fluid .g-d-17 .g-d-24{width:940px}.g-d-c-fluid .g-d-17 .g-d-23{width:900px}.g-d-c-fluid .g-d-17 .g-d-22{width:860px}.g-d-c-fluid .g-d-17 .g-d-21{width:820px}.g-d-c-fluid .g-d-17 .g-d-20{width:780px}.g-d-c-fluid .g-d-17 .g-d-19{width:740px}.g-d-c-fluid .g-d-17 .g-d-18{width:700px}.g-d-c-fluid .g-d-17 .g-d-17{width:660px}.g-d-c-fluid .g-d-17 .g-d-16{width:620px}.g-d-c-fluid .g-d-17 .g-d-15{width:580px}.g-d-c-fluid .g-d-17 .g-d-14{width:540px}.g-d-c-fluid .g-d-17 .g-d-13{width:500px}.g-d-c-fluid .g-d-17 .g-d-12{width:460px}.g-d-c-fluid .g-d-17 .g-d-11{width:420px}.g-d-c-fluid .g-d-17 .g-d-10{width:380px}.g-d-c-fluid .g-d-17 .g-d-9{width:340px}.g-d-c-fluid .g-d-17 .g-d-8{width:300px}.g-d-c-fluid .g-d-17 .g-d-7{width:260px}.g-d-c-fluid .g-d-17 .g-d-6{width:220px}.g-d-c-fluid .g-d-17 .g-d-5{width:180px}.g-d-c-fluid .g-d-17 .g-d-4{width:140px}.g-d-c-fluid .g-d-17 .g-d-3{width:100px}.g-d-c-fluid .g-d-17 .g-d-2{width:60px}.g-d-c-fluid .g-d-17 .g-d-1{width:20px}.g-d-c-fluid .g-d-17 .g-d-0{width:-20px}.g-d-c-fluid .g-d-16{width:640px}.g-d-c-fluid .g-d-16.g-d-l,.g-d-c-fluid .g-d-16.g-d-24,.g-d-c-fluid .g-d-16.g-all-l,.g-d-c-fluid .g-d-16.g-all-fl{width:620px}.g-d-c-fluid .g-d-16 .g-d-24{width:940px}.g-d-c-fluid .g-d-16 .g-d-23{width:900px}.g-d-c-fluid .g-d-16 .g-d-22{width:860px}.g-d-c-fluid .g-d-16 .g-d-21{width:820px}.g-d-c-fluid .g-d-16 .g-d-20{width:780px}.g-d-c-fluid .g-d-16 .g-d-19{width:740px}.g-d-c-fluid .g-d-16 .g-d-18{width:700px}.g-d-c-fluid .g-d-16 .g-d-17{width:660px}.g-d-c-fluid .g-d-16 .g-d-16{width:620px}.g-d-c-fluid .g-d-16 .g-d-15{width:580px}.g-d-c-fluid .g-d-16 .g-d-14{width:540px}.g-d-c-fluid .g-d-16 .g-d-13{width:500px}.g-d-c-fluid .g-d-16 .g-d-12{width:460px}.g-d-c-fluid .g-d-16 .g-d-11{width:420px}.g-d-c-fluid .g-d-16 .g-d-10{width:380px}.g-d-c-fluid .g-d-16 .g-d-9{width:340px}.g-d-c-fluid .g-d-16 .g-d-8{width:300px}.g-d-c-fluid .g-d-16 .g-d-7{width:260px}.g-d-c-fluid .g-d-16 .g-d-6{width:220px}.g-d-c-fluid .g-d-16 .g-d-5{width:180px}.g-d-c-fluid .g-d-16 .g-d-4{width:140px}.g-d-c-fluid .g-d-16 .g-d-3{width:100px}.g-d-c-fluid .g-d-16 .g-d-2{width:60px}.g-d-c-fluid .g-d-16 .g-d-1{width:20px}.g-d-c-fluid .g-d-16 .g-d-0{width:-20px}.g-d-c-fluid .g-d-15{width:600px}.g-d-c-fluid .g-d-15.g-d-l,.g-d-c-fluid .g-d-15.g-d-24,.g-d-c-fluid .g-d-15.g-all-l,.g-d-c-fluid .g-d-15.g-all-fl{width:580px}.g-d-c-fluid .g-d-15 .g-d-24{width:940px}.g-d-c-fluid .g-d-15 .g-d-23{width:900px}.g-d-c-fluid .g-d-15 .g-d-22{width:860px}.g-d-c-fluid .g-d-15 .g-d-21{width:820px}.g-d-c-fluid .g-d-15 .g-d-20{width:780px}.g-d-c-fluid .g-d-15 .g-d-19{width:740px}.g-d-c-fluid .g-d-15 .g-d-18{width:700px}.g-d-c-fluid .g-d-15 .g-d-17{width:660px}.g-d-c-fluid .g-d-15 .g-d-16{width:620px}.g-d-c-fluid .g-d-15 .g-d-15{width:580px}.g-d-c-fluid .g-d-15 .g-d-14{width:540px}.g-d-c-fluid .g-d-15 .g-d-13{width:500px}.g-d-c-fluid .g-d-15 .g-d-12{width:460px}.g-d-c-fluid .g-d-15 .g-d-11{width:420px}.g-d-c-fluid .g-d-15 .g-d-10{width:380px}.g-d-c-fluid .g-d-15 .g-d-9{width:340px}.g-d-c-fluid .g-d-15 .g-d-8{width:300px}.g-d-c-fluid .g-d-15 .g-d-7{width:260px}.g-d-c-fluid .g-d-15 .g-d-6{width:220px}.g-d-c-fluid .g-d-15 .g-d-5{width:180px}.g-d-c-fluid .g-d-15 .g-d-4{width:140px}.g-d-c-fluid .g-d-15 .g-d-3{width:100px}.g-d-c-fluid .g-d-15 .g-d-2{width:60px}.g-d-c-fluid .g-d-15 .g-d-1{width:20px}.g-d-c-fluid .g-d-15 .g-d-0{width:-20px}.g-d-c-fluid .g-d-14{width:560px}.g-d-c-fluid .g-d-14.g-d-l,.g-d-c-fluid .g-d-14.g-d-24,.g-d-c-fluid .g-d-14.g-all-l,.g-d-c-fluid .g-d-14.g-all-fl{width:540px}.g-d-c-fluid .g-d-14 .g-d-24{width:940px}.g-d-c-fluid .g-d-14 .g-d-23{width:900px}.g-d-c-fluid .g-d-14 .g-d-22{width:860px}.g-d-c-fluid .g-d-14 .g-d-21{width:820px}.g-d-c-fluid .g-d-14 .g-d-20{width:780px}.g-d-c-fluid .g-d-14 .g-d-19{width:740px}.g-d-c-fluid .g-d-14 .g-d-18{width:700px}.g-d-c-fluid .g-d-14 .g-d-17{width:660px}.g-d-c-fluid .g-d-14 .g-d-16{width:620px}.g-d-c-fluid .g-d-14 .g-d-15{width:580px}.g-d-c-fluid .g-d-14 .g-d-14{width:540px}.g-d-c-fluid .g-d-14 .g-d-13{width:500px}.g-d-c-fluid .g-d-14 .g-d-12{width:460px}.g-d-c-fluid .g-d-14 .g-d-11{width:420px}.g-d-c-fluid .g-d-14 .g-d-10{width:380px}.g-d-c-fluid .g-d-14 .g-d-9{width:340px}.g-d-c-fluid .g-d-14 .g-d-8{width:300px}.g-d-c-fluid .g-d-14 .g-d-7{width:260px}.g-d-c-fluid .g-d-14 .g-d-6{width:220px}.g-d-c-fluid .g-d-14 .g-d-5{width:180px}.g-d-c-fluid .g-d-14 .g-d-4{width:140px}.g-d-c-fluid .g-d-14 .g-d-3{width:100px}.g-d-c-fluid .g-d-14 .g-d-2{width:60px}.g-d-c-fluid .g-d-14 .g-d-1{width:20px}.g-d-c-fluid .g-d-14 .g-d-0{width:-20px}.g-d-c-fluid .g-d-13{width:520px}.g-d-c-fluid .g-d-13.g-d-l,.g-d-c-fluid .g-d-13.g-d-24,.g-d-c-fluid .g-d-13.g-all-l,.g-d-c-fluid .g-d-13.g-all-fl{width:500px}.g-d-c-fluid .g-d-13 .g-d-24{width:940px}.g-d-c-fluid .g-d-13 .g-d-23{width:900px}.g-d-c-fluid .g-d-13 .g-d-22{width:860px}.g-d-c-fluid .g-d-13 .g-d-21{width:820px}.g-d-c-fluid .g-d-13 .g-d-20{width:780px}.g-d-c-fluid .g-d-13 .g-d-19{width:740px}.g-d-c-fluid .g-d-13 .g-d-18{width:700px}.g-d-c-fluid .g-d-13 .g-d-17{width:660px}.g-d-c-fluid .g-d-13 .g-d-16{width:620px}.g-d-c-fluid .g-d-13 .g-d-15{width:580px}.g-d-c-fluid .g-d-13 .g-d-14{width:540px}.g-d-c-fluid .g-d-13 .g-d-13{width:500px}.g-d-c-fluid .g-d-13 .g-d-12{width:460px}.g-d-c-fluid .g-d-13 .g-d-11{width:420px}.g-d-c-fluid .g-d-13 .g-d-10{width:380px}.g-d-c-fluid .g-d-13 .g-d-9{width:340px}.g-d-c-fluid .g-d-13 .g-d-8{width:300px}.g-d-c-fluid .g-d-13 .g-d-7{width:260px}.g-d-c-fluid .g-d-13 .g-d-6{width:220px}.g-d-c-fluid .g-d-13 .g-d-5{width:180px}.g-d-c-fluid .g-d-13 .g-d-4{width:140px}.g-d-c-fluid .g-d-13 .g-d-3{width:100px}.g-d-c-fluid .g-d-13 .g-d-2{width:60px}.g-d-c-fluid .g-d-13 .g-d-1{width:20px}.g-d-c-fluid .g-d-13 .g-d-0{width:-20px}.g-d-c-fluid .g-d-12{width:480px}.g-d-c-fluid .g-d-12.g-d-l,.g-d-c-fluid .g-d-12.g-d-24,.g-d-c-fluid .g-d-12.g-all-l,.g-d-c-fluid .g-d-12.g-all-fl{width:460px}.g-d-c-fluid .g-d-12 .g-d-24{width:940px}.g-d-c-fluid .g-d-12 .g-d-23{width:900px}.g-d-c-fluid .g-d-12 .g-d-22{width:860px}.g-d-c-fluid .g-d-12 .g-d-21{width:820px}.g-d-c-fluid .g-d-12 .g-d-20{width:780px}.g-d-c-fluid .g-d-12 .g-d-19{width:740px}.g-d-c-fluid .g-d-12 .g-d-18{width:700px}.g-d-c-fluid .g-d-12 .g-d-17{width:660px}.g-d-c-fluid .g-d-12 .g-d-16{width:620px}.g-d-c-fluid .g-d-12 .g-d-15{width:580px}.g-d-c-fluid .g-d-12 .g-d-14{width:540px}.g-d-c-fluid .g-d-12 .g-d-13{width:500px}.g-d-c-fluid .g-d-12 .g-d-12{width:460px}.g-d-c-fluid .g-d-12 .g-d-11{width:420px}.g-d-c-fluid .g-d-12 .g-d-10{width:380px}.g-d-c-fluid .g-d-12 .g-d-9{width:340px}.g-d-c-fluid .g-d-12 .g-d-8{width:300px}.g-d-c-fluid .g-d-12 .g-d-7{width:260px}.g-d-c-fluid .g-d-12 .g-d-6{width:220px}.g-d-c-fluid .g-d-12 .g-d-5{width:180px}.g-d-c-fluid .g-d-12 .g-d-4{width:140px}.g-d-c-fluid .g-d-12 .g-d-3{width:100px}.g-d-c-fluid .g-d-12 .g-d-2{width:60px}.g-d-c-fluid .g-d-12 .g-d-1{width:20px}.g-d-c-fluid .g-d-12 .g-d-0{width:-20px}.g-d-c-fluid .g-d-11{width:440px}.g-d-c-fluid .g-d-11.g-d-l,.g-d-c-fluid .g-d-11.g-d-24,.g-d-c-fluid .g-d-11.g-all-l,.g-d-c-fluid .g-d-11.g-all-fl{width:420px}.g-d-c-fluid .g-d-11 .g-d-24{width:940px}.g-d-c-fluid .g-d-11 .g-d-23{width:900px}.g-d-c-fluid .g-d-11 .g-d-22{width:860px}.g-d-c-fluid .g-d-11 .g-d-21{width:820px}.g-d-c-fluid .g-d-11 .g-d-20{width:780px}.g-d-c-fluid .g-d-11 .g-d-19{width:740px}.g-d-c-fluid .g-d-11 .g-d-18{width:700px}.g-d-c-fluid .g-d-11 .g-d-17{width:660px}.g-d-c-fluid .g-d-11 .g-d-16{width:620px}.g-d-c-fluid .g-d-11 .g-d-15{width:580px}.g-d-c-fluid .g-d-11 .g-d-14{width:540px}.g-d-c-fluid .g-d-11 .g-d-13{width:500px}.g-d-c-fluid .g-d-11 .g-d-12{width:460px}.g-d-c-fluid .g-d-11 .g-d-11{width:420px}.g-d-c-fluid .g-d-11 .g-d-10{width:380px}.g-d-c-fluid .g-d-11 .g-d-9{width:340px}.g-d-c-fluid .g-d-11 .g-d-8{width:300px}.g-d-c-fluid .g-d-11 .g-d-7{width:260px}.g-d-c-fluid .g-d-11 .g-d-6{width:220px}.g-d-c-fluid .g-d-11 .g-d-5{width:180px}.g-d-c-fluid .g-d-11 .g-d-4{width:140px}.g-d-c-fluid .g-d-11 .g-d-3{width:100px}.g-d-c-fluid .g-d-11 .g-d-2{width:60px}.g-d-c-fluid .g-d-11 .g-d-1{width:20px}.g-d-c-fluid .g-d-11 .g-d-0{width:-20px}.g-d-c-fluid .g-d-10{width:400px}.g-d-c-fluid .g-d-10.g-d-l,.g-d-c-fluid .g-d-10.g-d-24,.g-d-c-fluid .g-d-10.g-all-l,.g-d-c-fluid .g-d-10.g-all-fl{width:380px}.g-d-c-fluid .g-d-10 .g-d-24{width:940px}.g-d-c-fluid .g-d-10 .g-d-23{width:900px}.g-d-c-fluid .g-d-10 .g-d-22{width:860px}.g-d-c-fluid .g-d-10 .g-d-21{width:820px}.g-d-c-fluid .g-d-10 .g-d-20{width:780px}.g-d-c-fluid .g-d-10 .g-d-19{width:740px}.g-d-c-fluid .g-d-10 .g-d-18{width:700px}.g-d-c-fluid .g-d-10 .g-d-17{width:660px}.g-d-c-fluid .g-d-10 .g-d-16{width:620px}.g-d-c-fluid .g-d-10 .g-d-15{width:580px}.g-d-c-fluid .g-d-10 .g-d-14{width:540px}.g-d-c-fluid .g-d-10 .g-d-13{width:500px}.g-d-c-fluid .g-d-10 .g-d-12{width:460px}.g-d-c-fluid .g-d-10 .g-d-11{width:420px}.g-d-c-fluid .g-d-10 .g-d-10{width:380px}.g-d-c-fluid .g-d-10 .g-d-9{width:340px}.g-d-c-fluid .g-d-10 .g-d-8{width:300px}.g-d-c-fluid .g-d-10 .g-d-7{width:260px}.g-d-c-fluid .g-d-10 .g-d-6{width:220px}.g-d-c-fluid .g-d-10 .g-d-5{width:180px}.g-d-c-fluid .g-d-10 .g-d-4{width:140px}.g-d-c-fluid .g-d-10 .g-d-3{width:100px}.g-d-c-fluid .g-d-10 .g-d-2{width:60px}.g-d-c-fluid .g-d-10 .g-d-1{width:20px}.g-d-c-fluid .g-d-10 .g-d-0{width:-20px}.g-d-c-fluid .g-d-9{width:360px}.g-d-c-fluid .g-d-9.g-d-l,.g-d-c-fluid .g-d-9.g-d-24,.g-d-c-fluid .g-d-9.g-all-l,.g-d-c-fluid .g-d-9.g-all-fl{width:340px}.g-d-c-fluid .g-d-9 .g-d-24{width:940px}.g-d-c-fluid .g-d-9 .g-d-23{width:900px}.g-d-c-fluid .g-d-9 .g-d-22{width:860px}.g-d-c-fluid .g-d-9 .g-d-21{width:820px}.g-d-c-fluid .g-d-9 .g-d-20{width:780px}.g-d-c-fluid .g-d-9 .g-d-19{width:740px}.g-d-c-fluid .g-d-9 .g-d-18{width:700px}.g-d-c-fluid .g-d-9 .g-d-17{width:660px}.g-d-c-fluid .g-d-9 .g-d-16{width:620px}.g-d-c-fluid .g-d-9 .g-d-15{width:580px}.g-d-c-fluid .g-d-9 .g-d-14{width:540px}.g-d-c-fluid .g-d-9 .g-d-13{width:500px}.g-d-c-fluid .g-d-9 .g-d-12{width:460px}.g-d-c-fluid .g-d-9 .g-d-11{width:420px}.g-d-c-fluid .g-d-9 .g-d-10{width:380px}.g-d-c-fluid .g-d-9 .g-d-9{width:340px}.g-d-c-fluid .g-d-9 .g-d-8{width:300px}.g-d-c-fluid .g-d-9 .g-d-7{width:260px}.g-d-c-fluid .g-d-9 .g-d-6{width:220px}.g-d-c-fluid .g-d-9 .g-d-5{width:180px}.g-d-c-fluid .g-d-9 .g-d-4{width:140px}.g-d-c-fluid .g-d-9 .g-d-3{width:100px}.g-d-c-fluid .g-d-9 .g-d-2{width:60px}.g-d-c-fluid .g-d-9 .g-d-1{width:20px}.g-d-c-fluid .g-d-9 .g-d-0{width:-20px}.g-d-c-fluid .g-d-8{width:320px}.g-d-c-fluid .g-d-8.g-d-l,.g-d-c-fluid .g-d-8.g-d-24,.g-d-c-fluid .g-d-8.g-all-l,.g-d-c-fluid .g-d-8.g-all-fl{width:300px}.g-d-c-fluid .g-d-8 .g-d-24{width:940px}.g-d-c-fluid .g-d-8 .g-d-23{width:900px}.g-d-c-fluid .g-d-8 .g-d-22{width:860px}.g-d-c-fluid .g-d-8 .g-d-21{width:820px}.g-d-c-fluid .g-d-8 .g-d-20{width:780px}.g-d-c-fluid .g-d-8 .g-d-19{width:740px}.g-d-c-fluid .g-d-8 .g-d-18{width:700px}.g-d-c-fluid .g-d-8 .g-d-17{width:660px}.g-d-c-fluid .g-d-8 .g-d-16{width:620px}.g-d-c-fluid .g-d-8 .g-d-15{width:580px}.g-d-c-fluid .g-d-8 .g-d-14{width:540px}.g-d-c-fluid .g-d-8 .g-d-13{width:500px}.g-d-c-fluid .g-d-8 .g-d-12{width:460px}.g-d-c-fluid .g-d-8 .g-d-11{width:420px}.g-d-c-fluid .g-d-8 .g-d-10{width:380px}.g-d-c-fluid .g-d-8 .g-d-9{width:340px}.g-d-c-fluid .g-d-8 .g-d-8{width:300px}.g-d-c-fluid .g-d-8 .g-d-7{width:260px}.g-d-c-fluid .g-d-8 .g-d-6{width:220px}.g-d-c-fluid .g-d-8 .g-d-5{width:180px}.g-d-c-fluid .g-d-8 .g-d-4{width:140px}.g-d-c-fluid .g-d-8 .g-d-3{width:100px}.g-d-c-fluid .g-d-8 .g-d-2{width:60px}.g-d-c-fluid .g-d-8 .g-d-1{width:20px}.g-d-c-fluid .g-d-8 .g-d-0{width:-20px}.g-d-c-fluid .g-d-7{width:280px}.g-d-c-fluid .g-d-7.g-d-l,.g-d-c-fluid .g-d-7.g-d-24,.g-d-c-fluid .g-d-7.g-all-l,.g-d-c-fluid .g-d-7.g-all-fl{width:260px}.g-d-c-fluid .g-d-7 .g-d-24{width:940px}.g-d-c-fluid .g-d-7 .g-d-23{width:900px}.g-d-c-fluid .g-d-7 .g-d-22{width:860px}.g-d-c-fluid .g-d-7 .g-d-21{width:820px}.g-d-c-fluid .g-d-7 .g-d-20{width:780px}.g-d-c-fluid .g-d-7 .g-d-19{width:740px}.g-d-c-fluid .g-d-7 .g-d-18{width:700px}.g-d-c-fluid .g-d-7 .g-d-17{width:660px}.g-d-c-fluid .g-d-7 .g-d-16{width:620px}.g-d-c-fluid .g-d-7 .g-d-15{width:580px}.g-d-c-fluid .g-d-7 .g-d-14{width:540px}.g-d-c-fluid .g-d-7 .g-d-13{width:500px}.g-d-c-fluid .g-d-7 .g-d-12{width:460px}.g-d-c-fluid .g-d-7 .g-d-11{width:420px}.g-d-c-fluid .g-d-7 .g-d-10{width:380px}.g-d-c-fluid .g-d-7 .g-d-9{width:340px}.g-d-c-fluid .g-d-7 .g-d-8{width:300px}.g-d-c-fluid .g-d-7 .g-d-7{width:260px}.g-d-c-fluid .g-d-7 .g-d-6{width:220px}.g-d-c-fluid .g-d-7 .g-d-5{width:180px}.g-d-c-fluid .g-d-7 .g-d-4{width:140px}.g-d-c-fluid .g-d-7 .g-d-3{width:100px}.g-d-c-fluid .g-d-7 .g-d-2{width:60px}.g-d-c-fluid .g-d-7 .g-d-1{width:20px}.g-d-c-fluid .g-d-7 .g-d-0{width:-20px}.g-d-c-fluid .g-d-6{width:240px}.g-d-c-fluid .g-d-6.g-d-l,.g-d-c-fluid .g-d-6.g-d-24,.g-d-c-fluid .g-d-6.g-all-l,.g-d-c-fluid .g-d-6.g-all-fl{width:220px}.g-d-c-fluid .g-d-6 .g-d-24{width:940px}.g-d-c-fluid .g-d-6 .g-d-23{width:900px}.g-d-c-fluid .g-d-6 .g-d-22{width:860px}.g-d-c-fluid .g-d-6 .g-d-21{width:820px}.g-d-c-fluid .g-d-6 .g-d-20{width:780px}.g-d-c-fluid .g-d-6 .g-d-19{width:740px}.g-d-c-fluid .g-d-6 .g-d-18{width:700px}.g-d-c-fluid .g-d-6 .g-d-17{width:660px}.g-d-c-fluid .g-d-6 .g-d-16{width:620px}.g-d-c-fluid .g-d-6 .g-d-15{width:580px}.g-d-c-fluid .g-d-6 .g-d-14{width:540px}.g-d-c-fluid .g-d-6 .g-d-13{width:500px}.g-d-c-fluid .g-d-6 .g-d-12{width:460px}.g-d-c-fluid .g-d-6 .g-d-11{width:420px}.g-d-c-fluid .g-d-6 .g-d-10{width:380px}.g-d-c-fluid .g-d-6 .g-d-9{width:340px}.g-d-c-fluid .g-d-6 .g-d-8{width:300px}.g-d-c-fluid .g-d-6 .g-d-7{width:260px}.g-d-c-fluid .g-d-6 .g-d-6{width:220px}.g-d-c-fluid .g-d-6 .g-d-5{width:180px}.g-d-c-fluid .g-d-6 .g-d-4{width:140px}.g-d-c-fluid .g-d-6 .g-d-3{width:100px}.g-d-c-fluid .g-d-6 .g-d-2{width:60px}.g-d-c-fluid .g-d-6 .g-d-1{width:20px}.g-d-c-fluid .g-d-6 .g-d-0{width:-20px}.g-d-c-fluid .g-d-5{width:200px}.g-d-c-fluid .g-d-5.g-d-l,.g-d-c-fluid .g-d-5.g-d-24,.g-d-c-fluid .g-d-5.g-all-l,.g-d-c-fluid .g-d-5.g-all-fl{width:180px}.g-d-c-fluid .g-d-5 .g-d-24{width:940px}.g-d-c-fluid .g-d-5 .g-d-23{width:900px}.g-d-c-fluid .g-d-5 .g-d-22{width:860px}.g-d-c-fluid .g-d-5 .g-d-21{width:820px}.g-d-c-fluid .g-d-5 .g-d-20{width:780px}.g-d-c-fluid .g-d-5 .g-d-19{width:740px}.g-d-c-fluid .g-d-5 .g-d-18{width:700px}.g-d-c-fluid .g-d-5 .g-d-17{width:660px}.g-d-c-fluid .g-d-5 .g-d-16{width:620px}.g-d-c-fluid .g-d-5 .g-d-15{width:580px}.g-d-c-fluid .g-d-5 .g-d-14{width:540px}.g-d-c-fluid .g-d-5 .g-d-13{width:500px}.g-d-c-fluid .g-d-5 .g-d-12{width:460px}.g-d-c-fluid .g-d-5 .g-d-11{width:420px}.g-d-c-fluid .g-d-5 .g-d-10{width:380px}.g-d-c-fluid .g-d-5 .g-d-9{width:340px}.g-d-c-fluid .g-d-5 .g-d-8{width:300px}.g-d-c-fluid .g-d-5 .g-d-7{width:260px}.g-d-c-fluid .g-d-5 .g-d-6{width:220px}.g-d-c-fluid .g-d-5 .g-d-5{width:180px}.g-d-c-fluid .g-d-5 .g-d-4{width:140px}.g-d-c-fluid .g-d-5 .g-d-3{width:100px}.g-d-c-fluid .g-d-5 .g-d-2{width:60px}.g-d-c-fluid .g-d-5 .g-d-1{width:20px}.g-d-c-fluid .g-d-5 .g-d-0{width:-20px}.g-d-c-fluid .g-d-4{width:160px}.g-d-c-fluid .g-d-4.g-d-l,.g-d-c-fluid .g-d-4.g-d-24,.g-d-c-fluid .g-d-4.g-all-l,.g-d-c-fluid .g-d-4.g-all-fl{width:140px}.g-d-c-fluid .g-d-4 .g-d-24{width:940px}.g-d-c-fluid .g-d-4 .g-d-23{width:900px}.g-d-c-fluid .g-d-4 .g-d-22{width:860px}.g-d-c-fluid .g-d-4 .g-d-21{width:820px}.g-d-c-fluid .g-d-4 .g-d-20{width:780px}.g-d-c-fluid .g-d-4 .g-d-19{width:740px}.g-d-c-fluid .g-d-4 .g-d-18{width:700px}.g-d-c-fluid .g-d-4 .g-d-17{width:660px}.g-d-c-fluid .g-d-4 .g-d-16{width:620px}.g-d-c-fluid .g-d-4 .g-d-15{width:580px}.g-d-c-fluid .g-d-4 .g-d-14{width:540px}.g-d-c-fluid .g-d-4 .g-d-13{width:500px}.g-d-c-fluid .g-d-4 .g-d-12{width:460px}.g-d-c-fluid .g-d-4 .g-d-11{width:420px}.g-d-c-fluid .g-d-4 .g-d-10{width:380px}.g-d-c-fluid .g-d-4 .g-d-9{width:340px}.g-d-c-fluid .g-d-4 .g-d-8{width:300px}.g-d-c-fluid .g-d-4 .g-d-7{width:260px}.g-d-c-fluid .g-d-4 .g-d-6{width:220px}.g-d-c-fluid .g-d-4 .g-d-5{width:180px}.g-d-c-fluid .g-d-4 .g-d-4{width:140px}.g-d-c-fluid .g-d-4 .g-d-3{width:100px}.g-d-c-fluid .g-d-4 .g-d-2{width:60px}.g-d-c-fluid .g-d-4 .g-d-1{width:20px}.g-d-c-fluid .g-d-4 .g-d-0{width:-20px}.g-d-c-fluid .g-d-3{width:120px}.g-d-c-fluid .g-d-3.g-d-l,.g-d-c-fluid .g-d-3.g-d-24,.g-d-c-fluid .g-d-3.g-all-l,.g-d-c-fluid .g-d-3.g-all-fl{width:100px}.g-d-c-fluid .g-d-3 .g-d-24{width:940px}.g-d-c-fluid .g-d-3 .g-d-23{width:900px}.g-d-c-fluid .g-d-3 .g-d-22{width:860px}.g-d-c-fluid .g-d-3 .g-d-21{width:820px}.g-d-c-fluid .g-d-3 .g-d-20{width:780px}.g-d-c-fluid .g-d-3 .g-d-19{width:740px}.g-d-c-fluid .g-d-3 .g-d-18{width:700px}.g-d-c-fluid .g-d-3 .g-d-17{width:660px}.g-d-c-fluid .g-d-3 .g-d-16{width:620px}.g-d-c-fluid .g-d-3 .g-d-15{width:580px}.g-d-c-fluid .g-d-3 .g-d-14{width:540px}.g-d-c-fluid .g-d-3 .g-d-13{width:500px}.g-d-c-fluid .g-d-3 .g-d-12{width:460px}.g-d-c-fluid .g-d-3 .g-d-11{width:420px}.g-d-c-fluid .g-d-3 .g-d-10{width:380px}.g-d-c-fluid .g-d-3 .g-d-9{width:340px}.g-d-c-fluid .g-d-3 .g-d-8{width:300px}.g-d-c-fluid .g-d-3 .g-d-7{width:260px}.g-d-c-fluid .g-d-3 .g-d-6{width:220px}.g-d-c-fluid .g-d-3 .g-d-5{width:180px}.g-d-c-fluid .g-d-3 .g-d-4{width:140px}.g-d-c-fluid .g-d-3 .g-d-3{width:100px}.g-d-c-fluid .g-d-3 .g-d-2{width:60px}.g-d-c-fluid .g-d-3 .g-d-1{width:20px}.g-d-c-fluid .g-d-3 .g-d-0{width:-20px}.g-d-c-fluid .g-d-2{width:80px}.g-d-c-fluid .g-d-2.g-d-l,.g-d-c-fluid .g-d-2.g-d-24,.g-d-c-fluid .g-d-2.g-all-l,.g-d-c-fluid .g-d-2.g-all-fl{width:60px}.g-d-c-fluid .g-d-2 .g-d-24{width:940px}.g-d-c-fluid .g-d-2 .g-d-23{width:900px}.g-d-c-fluid .g-d-2 .g-d-22{width:860px}.g-d-c-fluid .g-d-2 .g-d-21{width:820px}.g-d-c-fluid .g-d-2 .g-d-20{width:780px}.g-d-c-fluid .g-d-2 .g-d-19{width:740px}.g-d-c-fluid .g-d-2 .g-d-18{width:700px}.g-d-c-fluid .g-d-2 .g-d-17{width:660px}.g-d-c-fluid .g-d-2 .g-d-16{width:620px}.g-d-c-fluid .g-d-2 .g-d-15{width:580px}.g-d-c-fluid .g-d-2 .g-d-14{width:540px}.g-d-c-fluid .g-d-2 .g-d-13{width:500px}.g-d-c-fluid .g-d-2 .g-d-12{width:460px}.g-d-c-fluid .g-d-2 .g-d-11{width:420px}.g-d-c-fluid .g-d-2 .g-d-10{width:380px}.g-d-c-fluid .g-d-2 .g-d-9{width:340px}.g-d-c-fluid .g-d-2 .g-d-8{width:300px}.g-d-c-fluid .g-d-2 .g-d-7{width:260px}.g-d-c-fluid .g-d-2 .g-d-6{width:220px}.g-d-c-fluid .g-d-2 .g-d-5{width:180px}.g-d-c-fluid .g-d-2 .g-d-4{width:140px}.g-d-c-fluid .g-d-2 .g-d-3{width:100px}.g-d-c-fluid .g-d-2 .g-d-2{width:60px}.g-d-c-fluid .g-d-2 .g-d-1{width:20px}.g-d-c-fluid .g-d-2 .g-d-0{width:-20px}.g-d-c-fluid .g-d-1{width:40px}.g-d-c-fluid .g-d-1.g-d-l,.g-d-c-fluid .g-d-1.g-d-24,.g-d-c-fluid .g-d-1.g-all-l,.g-d-c-fluid .g-d-1.g-all-fl{width:20px}.g-d-c-fluid .g-d-1 .g-d-24{width:940px}.g-d-c-fluid .g-d-1 .g-d-23{width:900px}.g-d-c-fluid .g-d-1 .g-d-22{width:860px}.g-d-c-fluid .g-d-1 .g-d-21{width:820px}.g-d-c-fluid .g-d-1 .g-d-20{width:780px}.g-d-c-fluid .g-d-1 .g-d-19{width:740px}.g-d-c-fluid .g-d-1 .g-d-18{width:700px}.g-d-c-fluid .g-d-1 .g-d-17{width:660px}.g-d-c-fluid .g-d-1 .g-d-16{width:620px}.g-d-c-fluid .g-d-1 .g-d-15{width:580px}.g-d-c-fluid .g-d-1 .g-d-14{width:540px}.g-d-c-fluid .g-d-1 .g-d-13{width:500px}.g-d-c-fluid .g-d-1 .g-d-12{width:460px}.g-d-c-fluid .g-d-1 .g-d-11{width:420px}.g-d-c-fluid .g-d-1 .g-d-10{width:380px}.g-d-c-fluid .g-d-1 .g-d-9{width:340px}.g-d-c-fluid .g-d-1 .g-d-8{width:300px}.g-d-c-fluid .g-d-1 .g-d-7{width:260px}.g-d-c-fluid .g-d-1 .g-d-6{width:220px}.g-d-c-fluid .g-d-1 .g-d-5{width:180px}.g-d-c-fluid .g-d-1 .g-d-4{width:140px}.g-d-c-fluid .g-d-1 .g-d-3{width:100px}.g-d-c-fluid .g-d-1 .g-d-2{width:60px}.g-d-c-fluid .g-d-1 .g-d-1{width:20px}.g-d-c-fluid .g-d-1 .g-d-0{width:-20px}.g-d-c-fluid .g-d-0{width:0px}.g-d-c-fluid .g-d-0.g-d-l,.g-d-c-fluid .g-d-0.g-d-24,.g-d-c-fluid .g-d-0.g-all-l,.g-d-c-fluid .g-d-0.g-all-fl{width:-20px}.g-d-c-fluid .g-d-0 .g-d-24{width:940px}.g-d-c-fluid .g-d-0 .g-d-23{width:900px}.g-d-c-fluid .g-d-0 .g-d-22{width:860px}.g-d-c-fluid .g-d-0 .g-d-21{width:820px}.g-d-c-fluid .g-d-0 .g-d-20{width:780px}.g-d-c-fluid .g-d-0 .g-d-19{width:740px}.g-d-c-fluid .g-d-0 .g-d-18{width:700px}.g-d-c-fluid .g-d-0 .g-d-17{width:660px}.g-d-c-fluid .g-d-0 .g-d-16{width:620px}.g-d-c-fluid .g-d-0 .g-d-15{width:580px}.g-d-c-fluid .g-d-0 .g-d-14{width:540px}.g-d-c-fluid .g-d-0 .g-d-13{width:500px}.g-d-c-fluid .g-d-0 .g-d-12{width:460px}.g-d-c-fluid .g-d-0 .g-d-11{width:420px}.g-d-c-fluid .g-d-0 .g-d-10{width:380px}.g-d-c-fluid .g-d-0 .g-d-9{width:340px}.g-d-c-fluid .g-d-0 .g-d-8{width:300px}.g-d-c-fluid .g-d-0 .g-d-7{width:260px}.g-d-c-fluid .g-d-0 .g-d-6{width:220px}.g-d-c-fluid .g-d-0 .g-d-5{width:180px}.g-d-c-fluid .g-d-0 .g-d-4{width:140px}.g-d-c-fluid .g-d-0 .g-d-3{width:100px}.g-d-c-fluid .g-d-0 .g-d-2{width:60px}.g-d-c-fluid .g-d-0 .g-d-1{width:20px}.g-d-c-fluid .g-d-0 .g-d-0{width:-20px}.grp-cell .g-d-24+.g-d-fluid{margin-left:980px}.grp-cell .g-d-23+.g-d-fluid{margin-left:940px}.grp-cell .g-d-22+.g-d-fluid{margin-left:900px}.grp-cell .g-d-21+.g-d-fluid{margin-left:860px}.grp-cell .g-d-20+.g-d-fluid{margin-left:820px}.grp-cell .g-d-19+.g-d-fluid{margin-left:780px}.grp-cell .g-d-18+.g-d-fluid{margin-left:740px}.grp-cell .g-d-17+.g-d-fluid{margin-left:700px}.grp-cell .g-d-16+.g-d-fluid{margin-left:660px}.grp-cell .g-d-15+.g-d-fluid{margin-left:620px}.grp-cell .g-d-14+.g-d-fluid{margin-left:580px}.grp-cell .g-d-13+.g-d-fluid{margin-left:540px}.grp-cell .g-d-12+.g-d-fluid{margin-left:500px}.grp-cell .g-d-11+.g-d-fluid{margin-left:460px}.grp-cell .g-d-10+.g-d-fluid{margin-left:420px}.grp-cell .g-d-9+.g-d-fluid{margin-left:380px}.grp-cell .g-d-8+.g-d-fluid{margin-left:340px}.grp-cell .g-d-7+.g-d-fluid{margin-left:300px}.grp-cell .g-d-6+.g-d-fluid{margin-left:260px}.grp-cell .g-d-5+.g-d-fluid{margin-left:220px}.grp-cell .g-d-4+.g-d-fluid{margin-left:180px}.grp-cell .g-d-3+.g-d-fluid{margin-left:140px}.grp-cell .g-d-2+.g-d-fluid{margin-left:100px}.grp-cell .g-d-1+.g-d-fluid{margin-left:60px}.grp-cell .g-d-0+.g-d-fluid{margin-left:20px}.g-d-24 input[type=text],.g-d-24 input[type=password],.g-d-24 select,.g-d-24 textarea{width:100%}.g-d-23 input[type=text],.g-d-23 input[type=password],.g-d-23 select,.g-d-23 textarea{width:100%}.g-d-22 input[type=text],.g-d-22 input[type=password],.g-d-22 select,.g-d-22 textarea{width:100%}.g-d-21 input[type=text],.g-d-21 input[type=password],.g-d-21 select,.g-d-21 textarea{width:100%}.g-d-20 input[type=text],.g-d-20 input[type=password],.g-d-20 select,.g-d-20 textarea{width:100%}.g-d-19 input[type=text],.g-d-19 input[type=password],.g-d-19 select,.g-d-19 textarea{width:100%}.g-d-18 input[type=text],.g-d-18 input[type=password],.g-d-18 select,.g-d-18 textarea{width:100%}.g-d-17 input[type=text],.g-d-17 input[type=password],.g-d-17 select,.g-d-17 textarea{width:100%}.g-d-16 input[type=text],.g-d-16 input[type=password],.g-d-16 select,.g-d-16 textarea{width:100%}.g-d-15 input[type=text],.g-d-15 input[type=password],.g-d-15 select,.g-d-15 textarea{width:100%}.g-d-14 input[type=text],.g-d-14 input[type=password],.g-d-14 select,.g-d-14 textarea{width:100%}.g-d-13 input[type=text],.g-d-13 input[type=password],.g-d-13 select,.g-d-13 textarea{width:100%}.g-d-12 input[type=text],.g-d-12 input[type=password],.g-d-12 select,.g-d-12 textarea{width:100%}.g-d-11 input[type=text],.g-d-11 input[type=password],.g-d-11 select,.g-d-11 textarea{width:100%}.g-d-10 input[type=text],.g-d-10 input[type=password],.g-d-10 select,.g-d-10 textarea{width:100%}.g-d-9 input[type=text],.g-d-9 input[type=password],.g-d-9 select,.g-d-9 textarea{width:100%}.g-d-8 input[type=text],.g-d-8 input[type=password],.g-d-8 select,.g-d-8 textarea{width:100%}.g-d-7 input[type=text],.g-d-7 input[type=password],.g-d-7 select,.g-d-7 textarea{width:100%}.g-d-6 input[type=text],.g-d-6 input[type=password],.g-d-6 select,.g-d-6 textarea{width:100%}.g-d-5 input[type=text],.g-d-5 input[type=password],.g-d-5 select,.g-d-5 textarea{width:100%}.g-d-4 input[type=text],.g-d-4 input[type=password],.g-d-4 select,.g-d-4 textarea{width:100%}.g-d-3 input[type=text],.g-d-3 input[type=password],.g-d-3 select,.g-d-3 textarea{width:100%}.g-d-2 input[type=text],.g-d-2 input[type=password],.g-d-2 select,.g-d-2 textarea{width:100%}.g-d-1 input[type=text],.g-d-1 input[type=password],.g-d-1 select,.g-d-1 textarea{width:100%}.g-d-0 input[type=text],.g-d-0 input[type=password],.g-d-0 select,.g-d-0 textarea{width:100%}.l-show,.h-show,.hp-show,.hl-show,.t-show,.tp-show,.tl-show{display:none !important}.d-hide{display:none !important}.d-show{display:block !important}a.d-show,abbr.d-show,acronym.d-show,audio.d-show,b.d-show,basefont.d-show,bdo.d-show,big.d-show,br.d-show,canvas.d-show,cite.d-show,code.d-show,command.d-show,datalist.d-show,dfn.d-show,em.d-show,embed.d-show,font.d-show,i.d-show,img.d-show,input.d-show,keygen.d-show,kbd.d-show,label.d-show,mark.d-show,meter.d-show,output.d-show,progress.d-show,q.d-show,rp.d-show,rt.d-show,ruby.d-show,s.d-show,samp.d-show,select.d-show,small.d-show,span.d-show,strike.d-show,strong.d-show,sub.d-show,sup.d-show,textarea.d-show,time.d-show,tt.d-show,u.d-show,var.d-show,video.d-show,wbr.d-show{display:inline !important}fieldset.grp-module .g-d-fluid{position:relative;float:none;display:table-cell;width:10000px}fieldset.grp-module .grp-cell .g-d-fluid{float:left;width:auto;display:block}.g-d-c-fluid{position:relative;display:table;width:100%;table-layout:fixed}.g-d-c-fluid>*[class^=g-d]{position:relative;display:table-cell;float:none;margin-right:0 !important;padding-right:20px;vertical-align:top}.g-d-c-fluid>*[class^=g-d].g-d-l,.g-d-c-fluid>*[class^=g-d].g-d-24,.g-d-c-fluid>*[class^=g-d].g-all-l,.g-d-c-fluid>*[class^=g-d].g-all-fl{padding-right:0}.g-base-c,.g-d-c,.g-all-c{*zoom:1}.g-base-c:after,.g-d-c:after,.g-all-c:after{content:"";display:table;clear:both}.g-base-c.g-centered,.g-centered.g-d-c,.g-centered.g-all-c{float:none;margin:0 auto} diff --git a/static/grappelli_orig/stylesheets/mueller/screen.css b/static/grappelli_orig/stylesheets/mueller/screen.css new file mode 100644 index 00000000..e69de29b diff --git a/static/grappelli_orig/stylesheets/screen.css b/static/grappelli_orig/stylesheets/screen.css new file mode 100644 index 00000000..e49148c3 --- /dev/null +++ b/static/grappelli_orig/stylesheets/screen.css @@ -0,0 +1 @@ +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}body{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary{display:block}.grp-font-family,.grp-button,input[type="submit"],a.grp-button,button.grp-button,.ui-datepicker,#ui-timepicker,.ui-autocomplete,body{font-family:Arial,sans-serif}.grp-font-color,body{color:#444}.grp-font-color-quiet{color:#888}.grp-font-color-error{color:#bf3030}.grp-border-radius{-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.grp-border-radius-s{-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}.grp-form-field-border-radius{-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.grp-form-button-border-radius{-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;-khtml-border-radius:5px;border-radius:5px}.grp-margin-xl{margin:30px !important}.grp-margin-l{margin:20px !important}.grp-margin-m{margin:15px !important}.grp-margin{margin:10px !important}.grp-margin-s{margin:5px !important}.grp-margin-xs{margin:2px !important}.grp-margin-top-xl{margin-top:30px !important}.grp-margin-top-l{margin-top:20px !important}.grp-margin-top-m{margin-top:15px !important}.grp-margin-top{margin-top:10px !important}.grp-margin-top-s{margin-top:5px !important}.grp-margin-top-xs{margin-top:2px !important}.grp-margin-bottom-xl{margin-bottom:30px !important}.grp-margin-bottom-l{margin-bottom:20px !important}.grp-margin-bottom-m{margin-bottom:15px !important}.grp-margin-bottom{margin-bottom:10px !important}.grp-margin-bottom-s{margin-bottom:5px !important}.grp-margin-bottom-xs{margin-bottom:2px !important}.grp-margin-left-xl{margin-left:30px !important}.grp-margin-left-l{margin-left:20px !important}.grp-margin-left-m{margin-left:15px !important}.grp-margin-left{margin-left:10px !important}.grp-margin-left-s{margin-left:5px !important}.grp-margin-left-xs{margin-left:2px !important}.grp-margin-right-xl{margin-right:30px !important}.grp-margin-right-l{margin-right:20px !important}.grp-margin-right-m{margin-right:15px !important}.grp-margin-right{margin-right:10px !important}.grp-margin-right-s{margin-right:5px !important}.grp-margin-right-xs{margin-right:2px !important}.grp-margin-vertical-xl{margin-top:30px !important;margin-bottom:30px !important}.grp-margin-vertical-l{margin-top:20px !important;margin-bottom:20px !important}.grp-margin-vertical-m{margin-top:15px !important;margin-bottom:15px !important}.grp-margin-vertical{margin-top:10px !important;margin-bottom:10px !important}.grp-margin-vertical-s{margin-top:5px !important;margin-bottom:5px !important}.grp-margin-vertical-xs{margin-top:2px !important;margin-bottom:2px !important}.grp-margin-horizontal-xl{margin-left:30px !important;margin-right:30px !important}.grp-margin-horizontal-l{margin-left:20px !important;margin-right:20px !important}.grp-margin-horizontal-m{margin-left:15px !important;margin-right:15px !important}.grp-margin-horizontal{margin-left:10px !important;margin-right:10px !important}.grp-margin-horizontal-s{margin-left:5px !important;margin-right:5px !important}.grp-margin-horizontal-xs{margin-left:2px !important;margin-right:2px !important}.grp-no-margin{margin:0 !important}.grp-no-margin-top{margin-top:0 !important}.grp-no-margin-right{margin-right:0 !important}.grp-no-margin-bottom{margin-bottom:0 !important}.grp-no-margin-left{margin-left:0 !important}.grp-padding-xl{padding:30px !important}.grp-padding-l{padding:20px !important}.grp-padding-m{padding:15px !important}.grp-padding{padding:10px !important}.grp-padding-s{padding:5px !important}.grp-padding-xs{padding:2px !important}.grp-padding-top-xl{padding-top:30px !important}.grp-padding-top-l{padding-top:20px !important}.grp-padding-top-m{padding-top:15px !important}.grp-padding-top{padding-top:10px !important}.grp-padding-top-s{padding-top:5px !important}.grp-padding-top-xs{padding-top:2px !important}.grp-padding-bottom-xl{padding-bottom:30px !important}.grp-padding-bottom-l{padding-bottom:20px !important}.grp-padding-bottom-m{padding-bottom:15px !important}.grp-padding-bottom{padding-bottom:10px !important}.grp-padding-bottom-s{padding-bottom:5px !important}.grp-padding-bottom-xs{padding-bottom:2px !important}.grp-padding-left-xl{padding-left:30px !important}.grp-padding-left-l{padding-left:20px !important}.grp-padding-left-m{padding-left:15px !important}.grp-padding-left{padding-left:10px !important}.grp-padding-left-s{padding-left:5px !important}.grp-padding-left-xs{padding-left:2px !important}.grp-padding-right-xl{padding-right:30px !important}.grp-padding-right-l{padding-right:20px !important}.grp-padding-right-m{padding-right:15px !important}.grp-padding-right{padding-right:10px !important}.grp-padding-right-s{padding-right:5px !important}.grp-padding-right-xs{padding-right:2px !important}.grp-padding-vertical-xl{padding-top:30px !important;padding-bottom:30px !important}.grp-padding-vertical-l{padding-top:20px !important;padding-bottom:20px !important}.grp-padding-vertical-m{padding-top:15px !important;padding-bottom:15px !important}.grp-padding-vertical{padding-top:10px !important;padding-bottom:10px !important}.grp-padding-vertical-s{padding-top:5px !important;padding-bottom:5px !important}.grp-padding-vertical-xs{padding-top:2px !important;padding-bottom:2px !important}.grp-padding-horizontal-xl{padding-left:30px !important;padding-right:30px !important}.grp-padding-horizontal-l{padding-left:20px !important;padding-right:20px !important}.grp-padding-horizontal-m{padding-left:15px !important;padding-right:15px !important}.grp-padding-horizontal{padding-left:10px !important;padding-right:10px !important}.grp-padding-horizontal-s{padding-left:5px !important;padding-right:5px !important}.grp-padding-horizontal-xs{padding-left:2px !important;padding-right:2px !important}.grp-no-padding{padding:0 !important}.grp-no-padding-top{padding-top:0 !important}.grp-no-padding-right{padding-right:0 !important}.grp-no-padding-bottom{padding-bottom:0 !important}.grp-no-padding-left{padding-left:0 !important}.icons-sprite,.icons-add-another,.icons-back-link,.icons-breadcrumbs,.icons-date-hierarchy-back,.icons-datepicker,.icons-datetime-now,.icons-object-tools-add-link,.icons-object-tools-viewsite-link,.icons-related-lookup-m2m,.icons-related-lookup,.icons-related-remove,.icons-searchbox,.icons-selector-add-m2m-horizontal,.icons-selector-add-m2m-vertical,.icons-selector-filter,.icons-selector-remove-m2m-horizontal,.icons-selector-remove-m2m-vertical,.icons-sort-remove,.icons-sorted-ascending,.icons-sorted-descending,.icons-timepicker,.icons-tools-add-handler,.icons-tools-arrow-down-handler,.icons-tools-arrow-up-handler,.icons-tools-close-handler,.icons-tools-delete-handler,.icons-tools-drag-handler,.icons-tools-open-handler,.icons-tools-remove-handler,.icons-tools-trash-handler,.icons-tools-trash-list-toggle-handler,.icons-tools-viewsite-link,.icons-ui-datepicker-next,.icons-ui-datepicker-prev,a.grp-back-link,a.grp-back-link:hover,a.fb_show,a.related-lookup,a.related-lookup.m2m,.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup,a.grp-related-remove,button.ui-datepicker-trigger,button.ui-timepicker-trigger,button.ui-datetime-now,.grp-search-button,a.add-another,.grp-tools li a.grp-add-handler,.grp-tools li a.grp-delete-handler,.grp-tools li a.grp-remove-handler,.grp-tools li a.grp-drag-handler,.grp-tools li a.grp-viewsite-link,.grp-tools li a.grp-open-handler,.grp-tools li a.grp-close-handler,.grp-tools li a.grp-arrow-down-handler,.grp-tools li a.grp-arrow-up-handler,.grp-tools li a.grp-trash-handler,.grp-tools li a.grp-trash-list-toggle-handler,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-ascending,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-descending,.grp-date-hierarchy ul li a.grp-date-hierarchy-back,body.grp-filebrowser table td.grp-sorted.grp-ascending a,body.grp-filebrowser table th.grp-sorted.grp-ascending a,body.grp-filebrowser table td.grp-sorted.grp-descending a,body.grp-filebrowser table th.grp-sorted.grp-descending a,.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next,#grp-breadcrumbs>ul a,#grp-breadcrumbs>ul a:hover,#grp-page-tools ul li a#grp-open-all,#grp-page-tools ul li a#grp-close-all{background:url('../images/icons-s2649da6b63.png') no-repeat}.icons-add-another{background-position:0 0}.icons-add-another:hover,.icons-add-another.add-another_hover,.icons-add-another.add-another-hover{background-position:0 -24px}.icons-back-link{background-position:0 -48px}.icons-back-link:hover,.icons-back-link.back-link_hover,.icons-back-link.back-link-hover{background-position:0 -71px}.icons-breadcrumbs{background-position:0 -94px}.icons-breadcrumbs:hover,.icons-breadcrumbs.breadcrumbs_hover,.icons-breadcrumbs.breadcrumbs-hover{background-position:0 -118px}.icons-date-hierarchy-back{background-position:0 -142px}.icons-date-hierarchy-back:hover,.icons-date-hierarchy-back.date-hierarchy-back_hover,.icons-date-hierarchy-back.date-hierarchy-back-hover{background-position:0 -165px}.icons-datepicker{background-position:0 -188px}.icons-datepicker:hover,.icons-datepicker.datepicker_hover,.icons-datepicker.datepicker-hover{background-position:0 -211px}.icons-datetime-now{background-position:0 -234px}.icons-datetime-now:hover,.icons-datetime-now.datetime-now_hover,.icons-datetime-now.datetime-now-hover{background-position:0 -257px}.icons-object-tools-add-link{background-position:0 -280px}.icons-object-tools-viewsite-link{background-position:0 -304px}.icons-related-lookup-m2m{background-position:0 -328px}.icons-related-lookup-m2m:hover,.icons-related-lookup-m2m.related-lookup-m2m_hover,.icons-related-lookup-m2m.related-lookup-m2m-hover{background-position:0 -351px}.icons-related-lookup{background-position:0 -374px}.icons-related-lookup:hover,.icons-related-lookup.related-lookup_hover,.icons-related-lookup.related-lookup-hover{background-position:0 -397px}.icons-related-remove{background-position:0 -420px}.icons-related-remove:hover,.icons-related-remove.related-remove_hover,.icons-related-remove.related-remove-hover{background-position:0 -443px}.icons-searchbox{background-position:0 -466px}.icons-selector-add-m2m-horizontal{background-position:0 -481px}.icons-selector-add-m2m-horizontal:hover,.icons-selector-add-m2m-horizontal.selector-add-m2m-horizontal_hover,.icons-selector-add-m2m-horizontal.selector-add-m2m-horizontal-hover{background-position:0 -493px}.icons-selector-add-m2m-vertical{background-position:0 -505px}.icons-selector-add-m2m-vertical:hover,.icons-selector-add-m2m-vertical.selector-add-m2m-vertical_hover,.icons-selector-add-m2m-vertical.selector-add-m2m-vertical-hover{background-position:0 -518px}.icons-selector-filter{background-position:0 -531px}.icons-selector-remove-m2m-horizontal{background-position:0 -543px}.icons-selector-remove-m2m-horizontal:hover,.icons-selector-remove-m2m-horizontal.selector-remove-m2m-horizontal_hover,.icons-selector-remove-m2m-horizontal.selector-remove-m2m-horizontal-hover{background-position:0 -555px}.icons-selector-remove-m2m-vertical{background-position:0 -567px}.icons-selector-remove-m2m-vertical:hover,.icons-selector-remove-m2m-vertical.selector-remove-m2m-vertical_hover,.icons-selector-remove-m2m-vertical.selector-remove-m2m-vertical-hover{background-position:0 -580px}.icons-sort-remove{background-position:0 -593px}.icons-sort-remove:hover,.icons-sort-remove.sort-remove_hover,.icons-sort-remove.sort-remove-hover{background-position:0 -616px}.icons-sorted-ascending{background-position:0 -639px}.icons-sorted-descending{background-position:0 -662px}.icons-timepicker{background-position:0 -685px}.icons-timepicker:hover,.icons-timepicker.timepicker_hover,.icons-timepicker.timepicker-hover{background-position:0 -708px}.icons-tools-add-handler{background-position:0 -731px}.icons-tools-add-handler:hover,.icons-tools-add-handler.tools-add-handler_hover,.icons-tools-add-handler.tools-add-handler-hover{background-position:0 -755px}.icons-tools-arrow-down-handler{background-position:0 -779px}.icons-tools-arrow-down-handler:hover,.icons-tools-arrow-down-handler.tools-arrow-down-handler_hover,.icons-tools-arrow-down-handler.tools-arrow-down-handler-hover{background-position:0 -803px}.icons-tools-arrow-up-handler{background-position:0 -827px}.icons-tools-arrow-up-handler:hover,.icons-tools-arrow-up-handler.tools-arrow-up-handler_hover,.icons-tools-arrow-up-handler.tools-arrow-up-handler-hover{background-position:0 -851px}.icons-tools-close-handler{background-position:0 -875px}.icons-tools-close-handler:hover,.icons-tools-close-handler.tools-close-handler_hover,.icons-tools-close-handler.tools-close-handler-hover{background-position:0 -899px}.icons-tools-delete-handler{background-position:0 -923px}.icons-tools-delete-handler:hover,.icons-tools-delete-handler.tools-delete-handler_hover,.icons-tools-delete-handler.tools-delete-handler-hover{background-position:0 -947px}.icons-tools-drag-handler{background-position:0 -971px}.icons-tools-drag-handler:hover,.icons-tools-drag-handler.tools-drag-handler_hover,.icons-tools-drag-handler.tools-drag-handler-hover{background-position:0 -995px}.icons-tools-open-handler{background-position:0 -1019px}.icons-tools-open-handler:hover,.icons-tools-open-handler.tools-open-handler_hover,.icons-tools-open-handler.tools-open-handler-hover{background-position:0 -1043px}.icons-tools-remove-handler{background-position:0 -1067px}.icons-tools-remove-handler:hover,.icons-tools-remove-handler.tools-remove-handler_hover,.icons-tools-remove-handler.tools-remove-handler-hover{background-position:0 -1091px}.icons-tools-trash-handler{background-position:0 -1115px}.icons-tools-trash-handler:hover,.icons-tools-trash-handler.tools-trash-handler_hover,.icons-tools-trash-handler.tools-trash-handler-hover{background-position:0 -1139px}.icons-tools-trash-list-toggle-handler{background-position:0 -1163px}.icons-tools-trash-list-toggle-handler:hover,.icons-tools-trash-list-toggle-handler.tools-trash-list-toggle-handler_hover,.icons-tools-trash-list-toggle-handler.tools-trash-list-toggle-handler-hover{background-position:0 -1187px}.icons-tools-viewsite-link{background-position:0 -1211px}.icons-tools-viewsite-link:hover,.icons-tools-viewsite-link.tools-viewsite-link_hover,.icons-tools-viewsite-link.tools-viewsite-link-hover{background-position:0 -1235px}.icons-ui-datepicker-next{background-position:0 -1259px}.icons-ui-datepicker-next:hover,.icons-ui-datepicker-next.ui-datepicker-next_hover,.icons-ui-datepicker-next.ui-datepicker-next-hover{background-position:0 -1282px}.icons-ui-datepicker-prev{background-position:0 -1305px}.icons-ui-datepicker-prev:hover,.icons-ui-datepicker-prev.ui-datepicker-prev_hover,.icons-ui-datepicker-prev.ui-datepicker-prev-hover{background-position:0 -1328px}.icons-small-sprite,.icons-small-add-link,.icons-small-change-link,.icons-small-delete-link,.icons-small-link-external,.icons-small-link-internal,.icons-small-sort-remove,a.grp-link-external,a.grp-link-internal,.grp-actions li.grp-add-link a,.grp-actions li.grp-change-link a,.grp-actions li.grp-delete-link a,.grp-actions li.grp-delete-link>span:first-child,.grp-listing li.grp-add-link a,.grp-listing li.grp-change-link a,.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child,.grp-listing-small li.grp-add-link a,.grp-listing-small li.grp-change-link a,.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child{background:url('../images/icons-small-s4291b06aac.png') no-repeat}.icons-small-add-link{background-position:0 0}.icons-small-add-link:hover,.icons-small-add-link.add-link_hover,.icons-small-add-link.add-link-hover{background-position:0 -400px}.icons-small-change-link{background-position:0 -800px}.icons-small-change-link:hover,.icons-small-change-link.change-link_hover,.icons-small-change-link.change-link-hover{background-position:0 -1200px}.icons-small-delete-link{background-position:0 -1600px}.icons-small-link-external{background-position:0 -2000px}.icons-small-link-external:hover,.icons-small-link-external.link-external_hover,.icons-small-link-external.link-external-hover{background-position:0 -2400px}.icons-small-link-internal{background-position:0 -2800px}.icons-small-link-internal:hover,.icons-small-link-internal.link-internal_hover,.icons-small-link-internal.link-internal-hover{background-position:0 -3200px}.icons-small-sort-remove{background-position:0 -3600px}.grp-font-size-xl,h1,.h1{font-size:20px}.grp-font-size-l,h2{font-size:13px}.grp-font-size-m,h3{font-size:12px}.grp-font-size,h4,.grp-button,input[type="submit"],a.grp-button,button.grp-button,body{font-size:12px}.grp-font-size-s,.grp-actions{font-size:11px}.grp-font-size-xs{font-size:10px}.grp-line-height-xl,h1,.h1{line-height:24px}.grp-line-height-l,h2{line-height:18px}.grp-line-height-m,h3{line-height:16px}.grp-line-height,h4,.grp-actions,.grp-button,input[type="submit"],a.grp-button,button.grp-button,body{line-height:16px}.grp-line-height-s{line-height:14px}.grp-line-height-xs{line-height:13px}a{text-decoration:none;color:#309bbf}a:hover{color:#444}a.grp-back-link{display:inline-block;width:16px;height:16px;background-position:0 -51px}a.grp-back-link:hover,a.grp-back-link.back-link_hover,a.grp-back-link.back-link-hover{background-position:0 -71px}a.grp-back-link:hover{background-position:0 -74px}a.grp-back-link.grp-icon-text{padding-left:24px;width:auto}a.grp-link-external{padding-left:18px;color:#62bbd9;background-position:0 -2000px}a.grp-link-external:hover,a.grp-link-external.link-external_hover,a.grp-link-external.link-external-hover{background-position:0 -2400px}a.grp-link-external:hover{color:#444}a.grp-link-internal{padding-left:18px;background-position:0 -2800px}a.grp-link-internal:hover,a.grp-link-internal.link-internal_hover,a.grp-link-internal.link-internal-hover{background-position:0 -3200px}h1,.h1{padding:20px 0 10px;font-weight:bold}h2{font-weight:bold}h3{font-weight:bold}h4{font-weight:bold}h1 span,h2 span,h3 span,h4 span{display:inline-block;margin-left:10px;font-weight:normal}em{font-style:italic}strong{font-weight:bold}body.grp-doc article#grp-content section.grp-doc-section{margin-top:40px;border-top:5px solid #d94800}body.grp-doc article#grp-content section.grp-doc-section:first-child{margin-top:0}body.grp-doc span.anchor-helper{position:relative;top:-80px}body.grp-doc .grp-doc-code-source{padding-top:15px;border-top:1px dashed #c30}body.grp-doc .grp-doc-description{margin-bottom:20px}body.grp-doc .grp-doc-description h1{margin-top:30px;padding-top:40px;border-top:3px solid #c30}body.grp-doc .grp-doc-description h2{font-size:16px;line-height:16px;margin:40px 0 10px}body.grp-doc .grp-doc-description h3{font-size:16px;line-height:24px;margin:20px 0 10px}body.grp-doc .grp-doc-description p{margin:10px 0;font-size:14px;line-height:24px}body.grp-doc .grp-doc-class,body.grp-doc .grp-doc-id,body.grp-doc .grp-doc-dom,body.grp-doc .grp-doc-file,body.grp-doc .grp-doc-django{display:inline-block;margin:-2px 0;padding:0 5px;font-size:12px;font-weight:bold;line-height:18px;border:1px solid #d9d9c3;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px;background:#f2f2e6}body.grp-doc .grp-doc-dom span:before{content:"<"}body.grp-doc .grp-doc-dom span:after{content:">"}body.grp-doc code{position:relative;display:inline-block;margin:0 5px;padding:0 10px 20px;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-size:11px;border:1px solid #d9d9c3;background:#f2f2e6;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}body.grp-doc pre{margin:10px 0;padding:0}body.grp-doc pre code{display:block;margin:0;padding:0 20px 15px}.grp-float-left{float:left !important}.grp-float-right{float:right !important}.grp-transparent{border:0 !important;background-color:transparent !important}p.grp-help{max-width:758px;padding:3px 0 0;color:#9a9a9a;font-size:11px !important;line-height:14px;white-space:normal !important}p.grp-help:first-child{margin-top:5px}.grp-description{font-size:11px}.grp-cells p.grp-help,.grp-td p.grp-help{max-width:278px}p.grp-readonly{position:relative;display:inline-block;margin:4px 0 0 !important;padding:0 !important;color:#666;font-size:12px;font-weight:bold}p.grp-readonly+p.grp-readonly{margin-left:20px}.grp-tabular p.grp-readonly{margin-top:5px !important}.grp-row img{font-size:1px;line-height:1px;vertical-align:middle}.fb_show+p.grp-help a{display:inline-block;padding:3px;font-size:0;line-height:0}.fb_show+p.grp-help a img{margin:0;font-size:0;line-height:0}p.file-upload{margin:6px 0 3px;font-size:11px;line-height:14px}p.file-upload span.clearable-file-input{display:block;margin:5px 0 -12px}p.file-upload span.clearable-file-input input{margin:1px 0 0}p.file-upload span.clearable-file-input label{margin:0 0 0 5px}tr p.file-upload{margin:0}p.preview{margin:5px 0 0}tr p.preview{margin:9px 0 -5px}p.preview a{display:inline-block;padding:3px;font-size:0;line-height:0;border:1px solid #309bbf;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}p.preview a:hover{border:1px solid #444}.grp-rte{font-size:13px;line-height:18px}.grp-rte h4{margin:5px 0}.grp-rte p,.grp-rte ul,.grp-rte ol,.grp-rte blockquote,.grp-rte dl,.grp-rte dt,.grp-rte dd{margin:10px 0}.grp-rte p:only-child,.grp-rte ul:only-child,.grp-rte ol:only-child,.grp-rte blockquote:only-child,.grp-rte dl:only-child,.grp-rte dt:only-child,.grp-rte dd:only-child{margin:5px 0}.grp-rte ul{margin-left:30px}.grp-rte ul li{margin-left:20px;list-style-type:disc;list-style-position:outside}.grp-rte ul li ul{margin-top:-5px !important}.grp-rte ul li ul li{list-style-type:circle}.grp-docutils .grp-module h4{padding:0;font-size:13px;border:0;background:none}.grp-docutils .grp-module h4 p{margin:0}.grp-docutils table p{margin:0 !important}.grp-docutils code,.grp-docutils pre{font-size:11px;font-family:"Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace}.grp-docutils pre.literal-block{margin:10px;padding:6px 8px;background:#fff}.grp-docutils .grp-group h2+.grp-row>p{padding:3px 10px 0}span.grp-anchor{position:relative;float:left;clear:both;top:-80px}.grp-nowrap{white-space:nowrap}p.datetime br{display:none}p.datetime input.vTimeField{margin-left:6px}a.add-another img,a.related-lookup img{opacity:0}a.related-lookup img{display:none}fieldset.grp-module .grp-row label{margin:6px 0 6px;display:inline-block;font-family:Arial,sans-serif;font-size:11px;line-height:13px;color:#444}fieldset.grp-module .grp-row label.required{font-weight:bold}input[type="text"],input[type="password"],input[type="submit"],input[type="reset"],textarea,select{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#fdfdfd;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-o-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}input[type="text"]:focus,input[type="text"].grp-state-focus,input[type="password"]:focus,input[type="password"].grp-state-focus,input[type="submit"]:focus,input[type="submit"].grp-state-focus,input[type="reset"]:focus,input[type="reset"].grp-state-focus,textarea:focus,textarea.grp-state-focus,select:focus,select.grp-state-focus{border:1px solid #aaa;-moz-box-shadow:#ccc 0 0 6px;-webkit-box-shadow:#ccc 0 0 6px;-o-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.grp-errors input[type="text"],.grp-errors input[type="password"],.grp-errors input[type="submit"],.grp-errors input[type="reset"],.grp-errors textarea,.grp-errors select{border-color:#bf3030}.grp-errors label{color:#bf3030 !important}.grp-errors ul.radiolist.inline label,.grp-errors ul.checkboxlist.inline label{color:#444 !important}.grp-errors input[type="text"],.grp-errors input[type="password"],.grp-errors input[type="submit"],.grp-errors input[type="reset"],.grp-errors textarea,.grp-errors select{border-color:#bf3030 !important}.grp-errors .selector input,.grp-errors .selector select,.grp-errors .selector textarea{border:1px solid #ccc !important}.grp-errors ul.errorlist{padding:3px 0 0;color:#bf3030;font-size:11px !important;line-height:14px}select{padding:4px 3px 4px 2px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding:4px 28px 4px 5px;-webkit-appearance:textfield;background:#fff url("../img/icons/icon-form-select.png") 100% 50% no-repeat}}select[multiple=multiple]{padding-right:5px;height:160px}@media screen and (-webkit-min-device-pixel-ratio:0){select[multiple=multiple]{background-image:none}}textarea{vertical-align:top;padding:5px 5px;height:60px}fieldset.monospace textarea{font-family:"Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace}.grp-row input[type=checkbox],.grp-row input[type=radio]{position:relative;top:1px}.grp-row input[type=checkbox]+label,.grp-row input[type=radio]+label{position:relative;margin:0 0 0 5px}input[type=text].grp-search-field{margin-right:-5px;padding-left:10px;padding-right:30px;-moz-border-radius:20px;-webkit-border-radius:20px;-o-border-radius:20px;-ms-border-radius:20px;-khtml-border-radius:20px;border-radius:20px}ul.radiolist,ul.checkboxlist{position:relative;float:none;display:inline-block;margin:5px 0 0;padding:0;font-size:11px;line-height:15px;font-weight:normal}ul.radiolist label,ul.checkboxlist label{float:none;display:inline-block;margin:0 !important;padding:0 !important;width:auto !important;white-space:nowrap}ul.radiolist li+li,ul.checkboxlist li+li{margin-top:2px}.grp-row>ul.radiolist,.grp-row>ul.checkboxlist{margin:0}ul.radiolist.inline,ul.checkboxlist.inline{position:relative;float:none;display:inline-block;margin:5px 0 0;padding:0;font-size:11px;line-height:15px;font-weight:normal;max-width:760px;float:left;display:inline;margin-top:5px;margin-bottom:3px;padding-right:20px}ul.radiolist.inline label,ul.checkboxlist.inline label{float:none;display:inline-block;margin:0 !important;padding:0 !important;width:auto !important;white-space:nowrap}ul.radiolist.inline li+li,ul.checkboxlist.inline li+li{margin-top:2px}ul.radiolist.inline li,ul.checkboxlist.inline li{float:left;display:inline;margin-top:0 !important;margin-bottom:2px;padding-right:20px}.grp-module.grp-tbody ul.radiolist.inline,.grp-module.grp-tbody ul.checkboxlist.inline{white-space:normal}.grp-module.grp-tbody ul.radiolist.inline li,.grp-module.grp-tbody ul.checkboxlist.inline li{position:relative;float:left;display:inline}.grp-row.grp-cells ul.radiolist.inline li,.grp-row.grp-cells ul.checkboxlist.inline li{float:none}.selector{position:relative;float:left;overflow:hidden;width:758px}.selector .selector-available,.selector .selector-chosen{float:left;width:366px;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#ddd}.selector .selector-available.stacked,.selector .selector-chosen.stacked{width:756px}.selector .selector-available h2,.selector .selector-chosen h2{padding:7px 5px 6px 7px;font-size:12px;line-height:13px;font-weight:bold}.selector .selector-available h2 img,.selector .selector-chosen h2 img{display:none}.selector ul.selector-chooser{float:left;margin:110px 2px 0;padding:0;width:18px}.selector .selector-chosen h2{border-bottom:0 !important}.selector .selector-filter{padding:3px 5px 2px 2px;min-height:25px;font-weight:bold;color:#666;border-top:1px solid #e4e4e4;border-bottom:1px solid #e4e4e4;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-o-border-top-left-radius:3px;-ms-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;-o-border-top-right-radius:3px;-ms-border-top-right-radius:3px;-khtml-border-top-right-radius:3px;border-top-right-radius:3px;line-height:25px;text-indent:25px;background:url("../images/icons/searchbox.png") 6px 50% no-repeat}.selector .selector-filter input[type=text]{position:relative;margin:0;width:326px !important;max-width:326px !important}.selector .selector-filter img{display:none}.selector .selector-filter h2+select{position:relative;top:-1px}.selector select[multiple=multiple]{margin:0 0 0 -1px;padding-left:3px;max-width:368px !important;width:368px !important;height:200px;-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;-ms-border-radius:0;-khtml-border-radius:0;border-radius:0}.selector a.selector-add{background-image:url("../images/icons/selector-add-m2m-horizontal.png")}.selector a.selector-add:hover{background-image:url("../images/icons/selector-add-m2m-horizontal_hover.png")}.selector a.selector-remove{background-image:url("../images/icons/selector-remove-m2m-horizontal.png")}.selector a.selector-remove:hover{background-image:url("../images/icons/selector-remove-m2m-horizontal_hover.png")}.selector a.selector-chooseall,.selector a.selector-clearall{display:block;margin:0;padding:2px 7px;font-size:11px;line-height:13px;font-weight:bold}.selector.stacked .selector-available,.selector.stacked .selector-chosen{width:756px}.selector.stacked .selector-filter input[type=text]{width:716px !important;max-width:716px !important}.selector.stacked .selector-chosen .selector-filter:after{content:" " url("../images/icons/selector-add-m2m-vertical_hover.png")}.selector.stacked select[multiple=multiple]{width:758px !important;max-width:758px !important}.selector.stacked ul.selector-chooser{margin:4px 0 0 356px;width:36px}.selector.stacked ul.selector-chooser li{float:left}.selector.stacked a.selector-add{background-image:url("../images/icons/selector-add-m2m-vertical.png")}.selector.stacked a.selector-add:hover{background-image:url("../images/icons/selector-add-m2m-vertical_hover.png")}.selector.stacked a.selector-remove{background-image:url("../images/icons/selector-remove-m2m-vertical.png")}.selector.stacked a.selector-remove:hover{background-image:url("../images/icons/selector-remove-m2m-vertical_hover.png")}.selector a.selector-add,.selector a.selector-remove{display:block;width:18px;height:18px;color:transparent !important;background-position:50% 0;background-repeat:no-repeat}ul.errorlist+.selector{margin-top:8px !important}p.errornote{position:relative;float:left;clear:both;margin:0 0 5px;padding:5px 10px;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;color:#fff;font-weight:bold;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#bf3030}p.errornote+ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;margin:5px 0 0;margin:-5px 0 0}p.errornote+ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}p.errornote+ul.errorlist li{padding:5px 10px}p.errornote+ul.errorlist li+li{border-top:1px solid #bf3030}ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030}ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-login .errornote,.errornote.grp-login-errors{margin-bottom:0 !important;padding:8px 10px 6px !important;-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;-ms-border-radius:0;-khtml-border-radius:0;border-radius:0}.errornote.grp-login-errors{margin-bottom:0 !important;padding:8px 12px}.grp-row ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;margin:2px 0 0}.grp-row ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-row ul.errorlist li{padding:3px 0 0;border-top:0 !important}.grp-tabular p.errornote{margin:2px 0 0}.grp-tabular p.errornote+ul.errorlist{margin:0}.grp-tabular ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;margin:5px 0 0}.grp-tabular ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-tabular ul.errorlist li{padding:5px 10px}.grp-tabular ul.errorlist li+li{border-top:1px solid #bf3030}.grp-tabular .grp-tbody ul.errorlist{margin:0}.grp-tabular .grp-td ul.errorlist{clear:both;*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;margin:2px 0 0}.grp-tabular .grp-td ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-tabular .grp-td ul.errorlist li{padding:3px 0 0;border-top:0 !important}.grp-stacked p.errornote{margin:0}.grp-stacked p.errornote+ul.errorlist{margin:0}.grp-stacked ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;margin:5px 0 0;margin:3px 0}.grp-stacked ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-stacked ul.errorlist li{padding:5px 10px}.grp-stacked ul.errorlist li+li{border-top:1px solid #bf3030}.grp-stacked h3+*+ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;margin:2px 0 0;margin:0 !important;padding:5px 10px 8px;border-top:1px solid #fff;border-bottom:1px solid #ddd}.grp-stacked h3+*+ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-stacked h3+*+ul.errorlist li{padding:3px 0 0;border-top:0 !important}.grp-stacked .grp-row ul.errorlist{*zoom:1;font-size:11px;line-height:13px;font-weight:bold;color:#bf3030;margin:2px 0 0}.grp-stacked .grp-row ul.errorlist:after{content:"\0020";display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.grp-stacked .grp-row ul.errorlist li{padding:3px 0 0;border-top:0 !important}.grp-error td.mceIframeContainer{border:1px solid #bf3030 !important;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.grp-errors a.add-another+ul.errorlist{clear:both}input[type=text],input[type=password],.vDateField,.vTimeField,.vIntegerField,.vPositiveSmallIntegerField,.vManyToManyRawIdAdminField,.vForeignKeyRawIdAdminField{width:118px}input.vTextField,input.vURLField,input.vFileBrowseField,textarea,.vLargeTextField,.vXMLLargeTextField{width:278px}.row select{min-width:118px}.vLargeTextField{height:118px}.grp-row .vTextField,.grp-row .vURLField,.grp-row .vFileBrowseField,.grp-row textarea,.grp-row .vLargeTextField,.grp-row .vXMLLargeTextField,.grp-autocomplete-wrapper-m2m{width:758px}.grp-row select{max-width:758px}.grp-autocomplete-wrapper-m2m ul.grp-repr,.grp-autocomplete-wrapper-m2m ul.grp-repr li{max-width:700px}.grp-changelist-results table .vTextField,.grp-changelist-results table .vURLField,.grp-changelist-results table .vFileBrowseField,.grp-changelist-results table textarea,.grp-changelist-results table .vLargeTextField,.grp-changelist-results table .vXMLLargeTextField,.grp-changelist-results table select{max-width:278px}.grp-module.grp-table select,.grp-module.grp-table .grp-autocomplete-wrapper-m2m,.grp-module.grp-table .grp-autocomplete-wrapper-fk{max-width:278px}.grp-module.grp-table .grp-autocomplete-wrapper-m2m,.grp-module.grp-table .grp-autocomplete-wrapper-fk{width:278px}.grp-module.grp-table .grp-autocomplete-wrapper-m2m ul.grp-repr,.grp-module.grp-table .grp-autocomplete-wrapper-m2m ul.grp-repr li{max-width:222px}.grp-cell input[type=text],.grp-cell input[type=password],.grp-cell select,.grp-cell .grp-autocomplete-wrapper-m2m,.grp-cell .grp-autocomplete-wrapper-fk{max-width:280px}.grp-cell .grp-autocomplete-wrapper-m2m,.grp-cell .grp-autocomplete-wrapper-fk{width:280px}.grp-cell .grp-autocomplete-wrapper-m2m ul.grp-repr,.grp-cell .grp-autocomplete-wrapper-m2m ul.grp-repr li{max-width:222px}.grp-autocomplete-wrapper-m2m,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#fdfdfd;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-o-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}.grp-autocomplete-wrapper-m2m:focus,.grp-autocomplete-wrapper-m2m.grp-state-focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input:focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input.grp-state-focus{border:1px solid #aaa;-moz-box-shadow:#ccc 0 0 6px;-webkit-box-shadow:#ccc 0 0 6px;-o-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.grp-autocomplete-wrapper-m2m:focus,.grp-autocomplete-wrapper-m2m.grp-state-focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input:focus,.grp-autocomplete-wrapper-fk input.ui-autocomplete-input.grp-state-focus{background-color:#e1f0f5}.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup{position:absolute}.grp-autocomplete-wrapper-m2m.grp-state-focus a.grp-related-remove,.grp-autocomplete-wrapper-m2m.grp-state-focus a.related-lookup,.grp-autocomplete-wrapper-fk.grp-state-focus a.grp-related-remove,.grp-autocomplete-wrapper-fk.grp-state-focus a.related-lookup{border:1px solid #aaa !important}.grp-autocomplete-wrapper-m2m a.grp-related-remove,.grp-autocomplete-wrapper-m2m div.grp-loader,.grp-autocomplete-wrapper-fk a.grp-related-remove,.grp-autocomplete-wrapper-fk div.grp-loader{display:inline-block;position:absolute;right:24px;top:0;font-size:0;line-height:0;width:23px;height:23px;border:1px solid #ccc}.grp-autocomplete-wrapper-m2m div.grp-loader,.grp-autocomplete-wrapper-fk div.grp-loader{background:#fdfdfd url("../img/backgrounds/loading-small.gif") 50% 50% no-repeat scroll}.grp-autocomplete-wrapper-m2m.grp-autocomplete-preremove input.ui-autocomplete-input,.grp-autocomplete-wrapper-m2m.grp-autocomplete-preremove li.grp-repr a,.grp-autocomplete-wrapper-fk.grp-autocomplete-preremove input.ui-autocomplete-input,.grp-autocomplete-wrapper-fk.grp-autocomplete-preremove li.grp-repr a{color:#bf3030 !important}.grp-autocomplete-wrapper-m2m li.grp-repr.grp-autocomplete-preremove a,.grp-autocomplete-wrapper-fk li.grp-repr.grp-autocomplete-preremove a{color:#bf3030 !important}.grp-autocomplete-wrapper-m2m{display:inline-block;position:relative;padding:0;height:auto !important;vertical-align:top;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;overflow:visible}.grp-autocomplete-wrapper-m2m ul.grp-repr{float:left;padding-right:55px;width:100%;max-width:700px;overflow:hidden;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.grp-autocomplete-wrapper-m2m ul.grp-repr li{float:left;display:inline;overflow:hidden;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;text-overflow:ellipsis;max-width:700px}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-repr{margin:3px 5px 0 1px;font-weight:bold;line-height:18px}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-repr a.grp-m2m-remove{color:#555;padding-left:5px}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-search{margin-top:1px;margin-bottom:1px;background:transparent}.grp-autocomplete-wrapper-m2m ul.grp-repr li.grp-search input[type=text]{margin:0 0 -1px;padding:0 4px;width:100px;height:22px;font-size:12px;line-height:16px;outline:0;border:0;-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;background:transparent;cursor:text}.grp-autocomplete-wrapper-m2m a.related-lookup{top:-1px;right:-1px}.grp-autocomplete-wrapper-m2m a.grp-related-remove+a.grp-related-lookup{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;-o-border-bottom-left-radius:0;-ms-border-bottom-left-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-left-radius:0}.grp-autocomplete-wrapper-m2m a.grp-related-remove,.grp-autocomplete-wrapper-m2m a.grp-related-remove+div.grp-loader{top:-1px;right:23px}.grp-autocomplete-wrapper-fk{display:inline-block;position:relative;width:auto !important;height:auto !important;margin:0 !important;padding:0 !important;vertical-align:top;font-size:0 !important;line-height:0 !important;background:transparent !important}.grp-autocomplete-wrapper-fk input.ui-autocomplete-input{padding-right:55px}.grp-errors .grp-autocomplete-wrapper-m2m,.grp-errors .grp-autocomplete-wrapper-fk input.ui-autocomplete-input,.grp-errors a.grp-related-remove{border-color:#bf3030 !important}#changelist table div.autocomplete-wrapper-fk a.grp-related-remove,#changelist table div.autocomplete-wrapper-m2m a.grp-related-remove,#changelist table div.autocomplete-wrapper-fk div.grp-loader,#changelist table div.autocomplete-wrapper-m2m div.grp-loader{top:-5px}.grp-autocomplete-wrapper-m2m input.vManyToManyRawIdAdminField,.grp-autocomplete-wrapper-fk input.vForeignKeyRawIdAdminField,.grp-autocomplete-wrapper-fk input.vIntegerField{position:absolute;left:0;top:-40px;width:10px;height:10px;color:transparent !important;border:0 !important;background:transparent !important;box-shadow:none !important;-moz-box-shadow:none !important;-webkit-box-shadow:none !important;cursor:default !important}.grp-actions{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;float:right;font-weight:bold}.grp-actions li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}.grp-actions li:first-child,.grp-actions li.first{padding-left:0}.grp-actions li:last-child{padding-right:0}.grp-actions li.last{padding-right:0}.grp-actions li.grp-add-link a,.grp-actions li.grp-add-link>span:first-child,.grp-actions li.grp-change-link a,.grp-actions li.grp-change-link>span:first-child,.grp-actions li.grp-delete-link a,.grp-actions li.grp-delete-link>span:first-child{padding-left:20px;display:block;font-weight:bold}.grp-actions li.grp-add-link a{background-position:0 0}.grp-actions li.grp-add-link a:hover,.grp-actions li.grp-add-link a.add-link_hover,.grp-actions li.grp-add-link a.add-link-hover{background-position:0 -400px}.grp-actions li.grp-change-link a{background-position:0 -800px}.grp-actions li.grp-change-link a:hover,.grp-actions li.grp-change-link a.change-link_hover,.grp-actions li.grp-change-link a.change-link-hover{background-position:0 -1200px}.grp-actions li.grp-delete-link a,.grp-actions li.grp-delete-link>span:first-child{background-position:0 -1600px}.grp-group{position:relative;float:left;clear:both;margin:0 -4px 5px;padding:2px;width:100%;border:2px solid #ccc;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;-khtml-border-radius:5px;border-radius:5px;background:#fff}.grp-group.grp-closed{border:2px solid #ddd}.grp-group.grp-closed:hover{border:2px solid #ccc}.grp-module h2{padding:5px 10px 4px;text-shadow:0 1px 0 #f5f5f5;border-bottom:1px solid #ccc;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-o-border-top-left-radius:3px;-ms-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;-o-border-top-right-radius:3px;-ms-border-top-right-radius:3px;-khtml-border-top-right-radius:3px;border-top-right-radius:3px;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e5e5e5), color-stop(100%, #dbdbdb));background-image:-webkit-linear-gradient(#e5e5e5,#dbdbdb);background-image:-moz-linear-gradient(#e5e5e5,#dbdbdb);background-image:-o-linear-gradient(#e5e5e5,#dbdbdb);background-image:-ms-linear-gradient(#e5e5e5,#dbdbdb);background-image:linear-gradient(#e5e5e5,#dbdbdb)}.grp-module h3{padding:5px 10px;text-shadow:0 1px 0 #f5f5f5;border-top:1px solid #f5f5f5;border-bottom:1px solid #ccc;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e5e5e5), color-stop(100%, #dbdbdb));background-image:-webkit-linear-gradient(#e5e5e5,#dbdbdb);background-image:-moz-linear-gradient(#e5e5e5,#dbdbdb);background-image:-o-linear-gradient(#e5e5e5,#dbdbdb);background-image:-ms-linear-gradient(#e5e5e5,#dbdbdb);background-image:linear-gradient(#e5e5e5,#dbdbdb)}@media screen and (-webkit-min-device-pixel-ratio:0){.grp-module h3{padding:5px 10px 4px}}.grp-module h4{padding:5px 10px;text-shadow:0 1px 0 #f5f5f5;border-top:1px solid #f5f5f5;border-bottom:1px solid #ccc;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eaeaea), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eaeaea,#e0e0e0);background-image:-moz-linear-gradient(#eaeaea,#e0e0e0);background-image:-o-linear-gradient(#eaeaea,#e0e0e0);background-image:-ms-linear-gradient(#eaeaea,#e0e0e0);background-image:linear-gradient(#eaeaea,#e0e0e0)}@media screen and (-webkit-min-device-pixel-ratio:0){.grp-module h4{padding:5px 10px 4px}}.grp-group>h2{padding:5px 10px 4px;text-shadow:0 1px 0 #f5f5f5;border-bottom:1px solid #ccc;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-o-border-top-left-radius:3px;-ms-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;-o-border-top-right-radius:3px;-ms-border-top-right-radius:3px;-khtml-border-top-right-radius:3px;border-top-right-radius:3px;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e5e5e5), color-stop(100%, #dbdbdb));background-image:-webkit-linear-gradient(#e5e5e5,#dbdbdb);background-image:-moz-linear-gradient(#e5e5e5,#dbdbdb);background-image:-o-linear-gradient(#e5e5e5,#dbdbdb);background-image:-ms-linear-gradient(#e5e5e5,#dbdbdb);background-image:linear-gradient(#e5e5e5,#dbdbdb);border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.grp-group.grp-open>h2{margin-bottom:2px}.grp-group.grp-tabular.grp-open>h2{margin-bottom:0}.grp-group .grp-module>h3{border-top:0 !important;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-o-border-top-left-radius:3px;-ms-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;-o-border-top-right-radius:3px;-ms-border-top-right-radius:3px;-khtml-border-top-right-radius:3px;border-top-right-radius:3px}.grp-group .grp-module>h3:only-child,.grp-group .grp-module>h3:last-child{border-bottom:0}.grp-module{position:relative;float:left;clear:both;margin:0 0 5px;padding:0;width:100%;border:1px solid #ccc;background:#eee;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.grp-module .grp-module{margin:0;border:0}.grp-module .grp-module+.grp-module{border-top:1px solid #d9d9d9;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-o-border-top-left-radius:0;-ms-border-top-left-radius:0;-khtml-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;-o-border-top-right-radius:0;-ms-border-top-right-radius:0;-khtml-border-top-right-radius:0;border-top-right-radius:0}.grp-group>.grp-module{margin:2px 0 0}.grp-group>.grp-module:first-child{margin-top:0}.grp-group h2.grp-collapse-handler+.grp-module{margin-top:0}.grp-change-form .grp-module{min-width:960px}.grp-empty-form{display:none !important}.grp-collapse.grp-closed *,.grp-collapse.grp-closed .grp-row:not(tr).grp-cells,.grp-collapse.grp-closed .grp-table,.grp-collapse.grp-closed .grp-table *{display:none}.grp-collapse.grp-closed>.grp-collapse-handler,.grp-collapse.grp-closed>.grp-collapse-handler *,.grp-collapse.grp-closed .grp-tools,.grp-collapse.grp-closed .grp-tools *{display:block !important}.grp-collapse .grp-collapse-handler{cursor:pointer}.grp-collapse h2.grp-collapse-handler{text-shadow:0 1px 0 #c4e9f5}.grp-collapse.grp-open>h2.grp-collapse-handler{border-bottom:1px solid #ccc;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;-o-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-khtml-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;-o-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-khtml-border-top-right-radius:2px;border-top-right-radius:2px;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a1d4e5), color-stop(100%, #bcdfeb));background-image:-webkit-linear-gradient(#a1d4e5,#bcdfeb);background-image:-moz-linear-gradient(#a1d4e5,#bcdfeb);background-image:-o-linear-gradient(#a1d4e5,#bcdfeb);background-image:-ms-linear-gradient(#a1d4e5,#bcdfeb);background-image:linear-gradient(#a1d4e5,#bcdfeb)}.grp-collapse.grp-closed>h2.grp-collapse-handler{-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #bcdfeb), color-stop(100%, #a1d4e5));background-image:-webkit-linear-gradient(#bcdfeb,#a1d4e5);background-image:-moz-linear-gradient(#bcdfeb,#a1d4e5);background-image:-o-linear-gradient(#bcdfeb,#a1d4e5);background-image:-ms-linear-gradient(#bcdfeb,#a1d4e5);background-image:linear-gradient(#bcdfeb,#a1d4e5)}.grp-collapse.grp-closed>h2.grp-collapse-handler:hover{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a1d4e5), color-stop(100%, #bcdfeb));background-image:-webkit-linear-gradient(#a1d4e5,#bcdfeb);background-image:-moz-linear-gradient(#a1d4e5,#bcdfeb);background-image:-o-linear-gradient(#a1d4e5,#bcdfeb);background-image:-ms-linear-gradient(#a1d4e5,#bcdfeb);background-image:linear-gradient(#a1d4e5,#bcdfeb)}.grp-collapse.grp-module.grp-closed>h2.grp-collapse-handler{border-bottom:0}.grp-collapse h3.grp-collapse-handler{text-shadow:0 1px 0 #fff}.grp-collapse.grp-open>h3.grp-collapse-handler{border-top:1px solid #e2f2f7;border-bottom:1px solid #d9d9d9;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;-o-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-khtml-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;-o-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-khtml-border-top-right-radius:2px;border-top-right-radius:2px;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #cee9f2), color-stop(100%, #e1f0f5));background-image:-webkit-linear-gradient(#cee9f2,#e1f0f5);background-image:-moz-linear-gradient(#cee9f2,#e1f0f5);background-image:-o-linear-gradient(#cee9f2,#e1f0f5);background-image:-ms-linear-gradient(#cee9f2,#e1f0f5);background-image:linear-gradient(#cee9f2,#e1f0f5)}.grp-collapse.grp-closed>h3.grp-collapse-handler{border-bottom:0;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e1f0f5), color-stop(100%, #cee9f2));background-image:-webkit-linear-gradient(#e1f0f5,#cee9f2);background-image:-moz-linear-gradient(#e1f0f5,#cee9f2);background-image:-o-linear-gradient(#e1f0f5,#cee9f2);background-image:-ms-linear-gradient(#e1f0f5,#cee9f2);background-image:linear-gradient(#e1f0f5,#cee9f2)}.grp-collapse.grp-closed>h3.grp-collapse-handler:hover{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #cee9f2), color-stop(100%, #e1f0f5));background-image:-webkit-linear-gradient(#cee9f2,#e1f0f5);background-image:-moz-linear-gradient(#cee9f2,#e1f0f5);background-image:-o-linear-gradient(#cee9f2,#e1f0f5);background-image:-ms-linear-gradient(#cee9f2,#e1f0f5);background-image:linear-gradient(#cee9f2,#e1f0f5)}.grp-module .grp-row:not(tr){position:relative;float:left;clear:both;padding:5px 10px;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;border-top:1px solid #fff;border-bottom:1px solid #ddd}.grp-module .grp-row:not(tr):first-child{border-top:0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;-o-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-khtml-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;-o-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-khtml-border-top-right-radius:2px;border-top-right-radius:2px}.grp-module .grp-row:not(tr):last-of-type{border-bottom:0;-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;-o-border-bottom-left-radius:2px;-ms-border-bottom-left-radius:2px;-khtml-border-bottom-left-radius:2px;border-bottom-left-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;-o-border-bottom-right-radius:2px;-ms-border-bottom-right-radius:2px;-khtml-border-bottom-right-radius:2px;border-bottom-right-radius:2px}.grp-module .grp-row:not(tr).grp-cells{display:table-row;padding-top:0;padding-bottom:0}.grp-module .grp-row:not(tr).grp-cells .grp-cell{display:table-cell;vertical-align:top;position:relative;padding:8px 20px 8px 0;height:100%;white-space:nowrap;border-right:1px solid #ddd;overflow:visible}.grp-module .grp-row:not(tr).grp-cells .grp-cell+.grp-cell{padding-left:20px;border-left:1px solid #fff}.grp-module .grp-row:not(tr).grp-cells .grp-cell:last-of-type{padding-right:0;border-right:0 !important}.grp-module .grp-row:not(tr).grp-cells .grp-cell .g-d-fluid{white-space:normal;float:none;width:auto !important}.grp-module .grp-row+.grp-module>.grp-row:first-child,.grp-module h2+.grp-module>.grp-row:first-child,.grp-module .grp-module+.grp-module>.grp-row:first-child{border-top:1px solid #fff}fieldset.grp-module .grp-row{padding:8px 10px;overflow:hidden}.grp-listing{border-top:1px solid #fff}.grp-listing:first-child{border-top:0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;-o-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-khtml-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;-o-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-khtml-border-top-right-radius:2px;border-top-right-radius:2px}.grp-listing li.grp-add-link a,.grp-listing li.grp-add-link>span:first-child,.grp-listing li.grp-change-link a,.grp-listing li.grp-change-link>span:first-child,.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child{padding-left:20px;display:block;font-weight:bold}.grp-listing li.grp-add-link a{background-position:0 0}.grp-listing li.grp-add-link a:hover,.grp-listing li.grp-add-link a.add-link_hover,.grp-listing li.grp-add-link a.add-link-hover{background-position:0 -400px}.grp-listing li.grp-change-link a{background-position:0 -800px}.grp-listing li.grp-change-link a:hover,.grp-listing li.grp-change-link a.change-link_hover,.grp-listing li.grp-change-link a.change-link-hover{background-position:0 -1200px}.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child{background-position:0 -1600px}.grp-listing li.grp-add-link,.grp-listing li.grp-change-link,.grp-listing li.grp-delete-link{padding-left:25px}.grp-listing li.grp-add-link a,.grp-listing li.grp-add-link>span:first-child,.grp-listing li.grp-change-link a,.grp-listing li.grp-change-link>span:first-child,.grp-listing li.grp-delete-link a,.grp-listing li.grp-delete-link>span:first-child{display:block;margin-left:-20px;padding-left:20px}.grp-listing li.grp-add-link a{background-position:0 -2px}.grp-listing li.grp-add-link a:hover{background-position:0 -402px}.grp-listing li.grp-change-link a{background-position:0 -802px}.grp-listing li.grp-change-link a:hover{background-position:0 -1202px}.grp-listing li.grp-delete-link>span:first-child{background-position:0 -1602px}.grp-listing-small{border-top:1px solid #fff;font-size:11px;line-height:13px}.grp-listing-small:first-child{border-top:0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;-o-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-khtml-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;-o-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-khtml-border-top-right-radius:2px;border-top-right-radius:2px}.grp-listing-small li.grp-add-link a,.grp-listing-small li.grp-add-link>span:first-child,.grp-listing-small li.grp-change-link a,.grp-listing-small li.grp-change-link>span:first-child,.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child{padding-left:20px;display:block;font-weight:bold}.grp-listing-small li.grp-add-link a{background-position:0 0}.grp-listing-small li.grp-add-link a:hover,.grp-listing-small li.grp-add-link a.add-link_hover,.grp-listing-small li.grp-add-link a.add-link-hover{background-position:0 -400px}.grp-listing-small li.grp-change-link a{background-position:0 -800px}.grp-listing-small li.grp-change-link a:hover,.grp-listing-small li.grp-change-link a.change-link_hover,.grp-listing-small li.grp-change-link a.change-link-hover{background-position:0 -1200px}.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child{background-position:0 -1600px}.grp-listing-small li.grp-add-link,.grp-listing-small li.grp-change-link,.grp-listing-small li.grp-delete-link{padding-left:25px}.grp-listing-small li.grp-add-link a,.grp-listing-small li.grp-add-link>span:first-child,.grp-listing-small li.grp-change-link a,.grp-listing-small li.grp-change-link>span:first-child,.grp-listing-small li.grp-delete-link a,.grp-listing-small li.grp-delete-link>span:first-child{display:block;margin-left:-20px;padding-left:20px}.grp-listing-small li.grp-add-link a{background-position:0 -2px}.grp-listing-small li.grp-add-link a:hover{background-position:0 -402px}.grp-listing-small li.grp-change-link a{background-position:0 -802px}.grp-listing-small li.grp-change-link a:hover{background-position:0 -1202px}.grp-listing-small li.grp-delete-link>span:first-child{background-position:0 -1602px}.grp-stacked .grp-module.grp-add-item,.grp-tabular .grp-module.grp-add-item{height:28px;font-weight:bold;border-color:transparent;background:transparent}.grp-stacked .grp-module.grp-add-item>a,.grp-tabular .grp-module.grp-add-item>a{font-weight:bold;padding:5px 10px;position:relative;top:6px}.grp-stacked .grp-module{margin-bottom:2px}.grp-stacked .grp-module .grp-module{-moz-border-radius:0 0 2px 2px;-webkit-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-khtml-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px;border-top:1px solid #fff}.grp-stacked h2{margin-bottom:2px}.grp-stacked.grp-closed h2{margin-bottom:0}.grp-tabular .grp-table{display:table;margin:0 0 -2px;width:100%;border:0 none;border-collapse:separate;border-spacing:0 2px;background:none}@media screen and (-webkit-min-device-pixel-ratio:0){.grp-tabular .grp-table{margin-bottom:-1px;border-spacing:0 1px !important}}.grp-tabular .grp-table .grp-tr{display:table-row}.grp-tabular .grp-table .grp-th,.grp-tabular .grp-table .grp-td{display:table-cell;float:none;height:100%;margin-right:0;overflow:hidden;padding:1px 20px;vertical-align:top;white-space:nowrap;border-left:1px solid #FFFFFF;border-right:1px solid #E0E0E0}.grp-tabular .grp-table .grp-th:first-of-type,.grp-tabular .grp-table .grp-td:first-of-type{padding-left:10px}.grp-tabular .grp-table .grp-thead{display:table-header-group;color:#aaa;font-size:11px;font-weight:bold}.grp-tabular .grp-table .grp-thead .grp-th,.grp-tabular .grp-table .grp-thead .grp-td{background:none;border-top:0}.grp-tabular .grp-table .grp-thead .grp-th:last-of-type,.grp-tabular .grp-table .grp-thead .grp-td:last-of-type{border-right:0}.grp-tabular .grp-table .grp-tbody{display:table-row-group;margin-top:0}.grp-tabular .grp-table .grp-tbody .grp-th,.grp-tabular .grp-table .grp-tbody .grp-td{padding-bottom:5px;padding-top:5px;border-bottom:1px solid #D4D4D4;border-top:1px solid #D4D4D4;background:#eee}.grp-tabular .grp-table .grp-tbody .grp-th:first-of-type,.grp-tabular .grp-table .grp-tbody .grp-td:first-of-type{border-left:1px solid #CCCCCC}.grp-tabular .grp-table .grp-tbody .grp-th:first-child,.grp-tabular .grp-table .grp-tbody .grp-td:first-child{-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;-o-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-khtml-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;-o-border-bottom-left-radius:2px;-ms-border-bottom-left-radius:2px;-khtml-border-bottom-left-radius:2px;border-bottom-left-radius:2px}.grp-tabular .grp-table .grp-tbody .grp-th.grp-tools-container,.grp-tabular .grp-table .grp-tbody .grp-td.grp-tools-container{padding-left:0;width:100%;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;-o-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-khtml-border-top-right-radius:2px;border-top-right-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;-o-border-bottom-right-radius:2px;-ms-border-bottom-right-radius:2px;-khtml-border-bottom-right-radius:2px;border-bottom-right-radius:2px}.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-th,.grp-tabular .grp-table .grp-tbody.grp-predelete .grp-td{background:#f2e6e6}.grp-tabular .grp-table .grp-tfoot{display:table-footer-group;color:#aaa}.grp-tabular .grp-table .grp-tfoot .grp-td:last-of-type{border-right:0}.grp-tabular .grp-table .grp-module{float:none;clear:none;background:0;border:0}.grp-horizontal-list-container{margin:0;padding:0;border:0;overflow:hidden;*zoom:1}.grp-horizontal-list{margin:0;padding:0;border:0;overflow:hidden;*zoom:1}.grp-horizontal-list li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}.grp-horizontal-list li:first-child,.grp-horizontal-list li.first{padding-left:0}.grp-horizontal-list li:last-child{padding-right:0}.grp-horizontal-list li.last{padding-right:0}.grp-horizontal-list-right>li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:right;padding-left:5px;padding-right:5px}.grp-horizontal-list-right>li:first-child,.grp-horizontal-list-right>li.first{padding-right:0}.grp-horizontal-list-right>li:last-child{padding-left:0}.grp-horizontal-list-right>li.last{padding-left:0}.grp-inline-list{list-style-type:none}.grp-inline-list,.grp-inline-list li{margin:0px;padding:0px;display:inline}.grp-inline-block-list{margin:0;padding:0;border:0;overflow:hidden;*zoom:1}.grp-inline-block-list li{list-style-image:none;list-style-type:none;margin-left:0;display:-moz-inline-box;-moz-box-orient:vertical;display:inline-block;vertical-align:middle;*vertical-align:auto;white-space:nowrap;padding-left:5px;padding-right:5px}.grp-inline-block-list li{*display:inline}.grp-predelete{background:#f2e6e6}.grp-predelete h2,.grp-collapse.grp-predelete>h2.grp-collapse-handler,.grp-predelete h3,.grp-collapse.grp-predelete>h3.grp-collapse-handler,.grp-predelete h4,.grp-collapse.grp-predelete .grp-collapse>h4.grp-collapse-handler{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fff2f2), color-stop(100%, #f2e6e6));background-image:-webkit-linear-gradient(#fff2f2,#f2e6e6);background-image:-moz-linear-gradient(#fff2f2,#f2e6e6);background-image:-o-linear-gradient(#fff2f2,#f2e6e6);background-image:-ms-linear-gradient(#fff2f2,#f2e6e6);background-image:linear-gradient(#fff2f2,#f2e6e6)}.grp-collapse.grp-predelete>h2.grp-collapse-handler:hover,.grp-collapse.grp-predelete>h3.grp-collapse-handler:hover,.grp-predelete .grp-collapse>h4.grp-collapse-handler:hover,.grp-collapse.grp-open.grp-predelete>h2.grp-collapse-handler,.grp-collapse.grp-open.grp-predelete>h3.grp-collapse-handler,.grp-predelete .grp-collapse.grp-open>h4.grp-collapse-handler{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f2e6e6), color-stop(100%, #fff2f2));background-image:-webkit-linear-gradient(#f2e6e6,#fff2f2);background-image:-moz-linear-gradient(#f2e6e6,#fff2f2);background-image:-o-linear-gradient(#f2e6e6,#fff2f2);background-image:-ms-linear-gradient(#f2e6e6,#fff2f2);background-image:linear-gradient(#f2e6e6,#fff2f2)}.grp-predelete,.grp-predelete .grp-module,.grp-predelete .grp-th,.grp-predelete .grp-td{background:#f2e6e6}.button-state-blue,input[type=button],button,a.fb_show,a.related-lookup,a.related-lookup.m2m,.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup,button.ui-datepicker-trigger,button.ui-timepicker-trigger,button.ui-datetime-now,.grp-pulldown-container .grp-pulldown-handler:hover,.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler,.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler:hover,.grp-pulldown-container .grp-pulldown-content,.grp-pulldown-container .grp-pulldown-content:hover{color:#fff;border:1px solid #ccc;background-color:#e1f0f5}.button-state-grey,input[type=button]:hover,button:hover,a.fb_show:hover,a.related-lookup:hover,a.related-lookup.m2m:hover,.grp-autocomplete-wrapper-m2m a.related-lookup:hover,.grp-autocomplete-wrapper-fk a.related-lookup:hover,button.ui-datepicker-trigger:hover,button.ui-timepicker-trigger:hover,button.ui-datetime-now:hover,.grp-pulldown-container .grp-pulldown-handler{color:#444;border:1px solid #ccc;background-color:#eee}.button-state-white,a.grp-related-remove,a.grp-related-remove:hover{border:1px solid #ccc;background-color:#fdfdfd}.button-state-red{color:#fff;border:1px solid #ccc;background-color:#bf3030}.button-state-transparent{border:1px solid transparent;background-color:transparent;background-image:none}.grp-button{position:relative;display:inline-block;margin:0;padding:5px;height:28px;font-weight:bold;-moz-border-radius:5px !important;-webkit-border-radius:5px !important;-o-border-radius:5px !important;-ms-border-radius:5px !important;-khtml-border-radius:5px !important;border-radius:5px !important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top}@media screen and (-webkit-min-device-pixel-ratio:0){.grp-button{padding:5px 10px}}input[type="submit"]{position:relative;display:inline-block;margin:0;padding:5px;height:28px;font-weight:bold;-moz-border-radius:5px !important;-webkit-border-radius:5px !important;-o-border-radius:5px !important;-ms-border-radius:5px !important;-khtml-border-radius:5px !important;border-radius:5px !important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top;color:#fff;border:1px solid #2b8aab;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4fb2d3), color-stop(100%, #309bbf));background-image:-webkit-linear-gradient(#4fb2d3,#309bbf);background-image:-moz-linear-gradient(#4fb2d3,#309bbf);background-image:-o-linear-gradient(#4fb2d3,#309bbf);background-image:-ms-linear-gradient(#4fb2d3,#309bbf);background-image:linear-gradient(#4fb2d3,#309bbf)}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="submit"]{padding:5px 10px}}input[type="submit"]:hover,input[type="submit"]:focus{color:#fff;border:1px solid #373737;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:-ms-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer input[type="submit"]:hover,.grp-fixed-footer input[type="submit"]:focus{color:#444;border:1px solid #c8c8c8;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:-ms-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button,button.grp-button{position:relative;display:inline-block;margin:0;padding:5px;height:28px;font-weight:bold;-moz-border-radius:5px !important;-webkit-border-radius:5px !important;-o-border-radius:5px !important;-ms-border-radius:5px !important;-khtml-border-radius:5px !important;border-radius:5px !important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top;color:#fff;border:1px solid #2b8aab;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4fb2d3), color-stop(100%, #309bbf));background-image:-webkit-linear-gradient(#4fb2d3,#309bbf);background-image:-moz-linear-gradient(#4fb2d3,#309bbf);background-image:-o-linear-gradient(#4fb2d3,#309bbf);background-image:-ms-linear-gradient(#4fb2d3,#309bbf);background-image:linear-gradient(#4fb2d3,#309bbf);padding:5px 10px}@media screen and (-webkit-min-device-pixel-ratio:0){a.grp-button,button.grp-button{padding:5px 10px}}a.grp-button:hover,a.grp-button:focus,button.grp-button:hover,button.grp-button:focus{color:#fff;border:1px solid #373737;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:-ms-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button:hover,.grp-fixed-footer a.grp-button:focus,.grp-fixed-footer button.grp-button:hover,.grp-fixed-footer button.grp-button:focus{color:#444;border:1px solid #c8c8c8;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:-ms-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button.grp-delete-link,button.grp-button.grp-delete-link{color:#fff;border:1px solid #ab2b2b;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d34f4f), color-stop(100%, #bf3030));background-image:-webkit-linear-gradient(#d34f4f,#bf3030);background-image:-moz-linear-gradient(#d34f4f,#bf3030);background-image:-o-linear-gradient(#d34f4f,#bf3030);background-image:-ms-linear-gradient(#d34f4f,#bf3030);background-image:linear-gradient(#d34f4f,#bf3030)}a.grp-button.grp-delete-link:hover,a.grp-button.grp-delete-link:focus,button.grp-button.grp-delete-link:hover,button.grp-button.grp-delete-link:focus{color:#fff;border:1px solid #373737;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:-ms-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button.grp-delete-link:hover,.grp-fixed-footer a.grp-button.grp-delete-link:focus,.grp-fixed-footer button.grp-button.grp-delete-link:hover,.grp-fixed-footer button.grp-button.grp-delete-link:focus{color:#444;border:1px solid #c8c8c8;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:-ms-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button.grp-cancel-link,button.grp-button.grp-cancel-link{color:#fff;border:1px solid #7b7b7b;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a2a2a2), color-stop(100%, #888888));background-image:-webkit-linear-gradient(#a2a2a2,#888888);background-image:-moz-linear-gradient(#a2a2a2,#888888);background-image:-o-linear-gradient(#a2a2a2,#888888);background-image:-ms-linear-gradient(#a2a2a2,#888888);background-image:linear-gradient(#a2a2a2,#888888)}a.grp-button.grp-cancel-link:hover,a.grp-button.grp-cancel-link:focus,button.grp-button.grp-cancel-link:hover,button.grp-button.grp-cancel-link:focus{color:#fff;border:1px solid #373737;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:-ms-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button.grp-cancel-link:hover,.grp-fixed-footer a.grp-button.grp-cancel-link:focus,.grp-fixed-footer button.grp-button.grp-cancel-link:hover,.grp-fixed-footer button.grp-button.grp-cancel-link:focus{color:#444;border:1px solid #c8c8c8;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:-ms-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}a.grp-button.grp-reset-link,button.grp-button.grp-reset-link{color:#fff;border:1px solid #7b7b7b;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a2a2a2), color-stop(100%, #888888));background-image:-webkit-linear-gradient(#a2a2a2,#888888);background-image:-moz-linear-gradient(#a2a2a2,#888888);background-image:-o-linear-gradient(#a2a2a2,#888888);background-image:-ms-linear-gradient(#a2a2a2,#888888);background-image:linear-gradient(#a2a2a2,#888888)}a.grp-button.grp-reset-link:hover,a.grp-button.grp-reset-link:focus,button.grp-button.grp-reset-link:hover,button.grp-button.grp-reset-link:focus{color:#fff;border:1px solid #373737;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5e5e5e), color-stop(100%, #444444));background-image:-webkit-linear-gradient(#5e5e5e,#444444);background-image:-moz-linear-gradient(#5e5e5e,#444444);background-image:-o-linear-gradient(#5e5e5e,#444444);background-image:-ms-linear-gradient(#5e5e5e,#444444);background-image:linear-gradient(#5e5e5e,#444444)}.grp-fixed-footer a.grp-button.grp-reset-link:hover,.grp-fixed-footer a.grp-button.grp-reset-link:focus,.grp-fixed-footer button.grp-button.grp-reset-link:hover,.grp-fixed-footer button.grp-button.grp-reset-link:focus{color:#444;border:1px solid #c8c8c8;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#ffffff,#eeeeee);background-image:-moz-linear-gradient(#ffffff,#eeeeee);background-image:-o-linear-gradient(#ffffff,#eeeeee);background-image:-ms-linear-gradient(#ffffff,#eeeeee);background-image:linear-gradient(#ffffff,#eeeeee)}input[type=button],button,a.fb_show,a.related-lookup{position:relative;display:inline-block;margin:0 0 0 -25px;padding:0;width:25px;height:25px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;-o-border-top-right-radius:3px;-ms-border-top-right-radius:3px;-khtml-border-top-right-radius:3px;border-top-right-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;-o-border-bottom-right-radius:3px;-ms-border-bottom-right-radius:3px;-khtml-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;vertical-align:top}a.fb_show,a.related-lookup{display:inline-block;margin-bottom:-5px;background-position:0 -374px}a.fb_show:hover,a.fb_show.related-lookup_hover,a.fb_show.related-lookup-hover,a.related-lookup:hover,a.related-lookup.related-lookup_hover,a.related-lookup.related-lookup-hover{background-position:0 -397px}a.related-lookup+strong{position:relative;top:2px;margin-left:5px}a.related-lookup.m2m,.grp-autocomplete-wrapper-m2m a.related-lookup,.grp-autocomplete-wrapper-fk a.related-lookup{background-position:0 -328px}a.related-lookup.m2m:hover,a.related-lookup.m2m.related-lookup-m2m_hover,a.related-lookup.m2m.related-lookup-m2m-hover,.grp-autocomplete-wrapper-m2m a.related-lookup:hover,.grp-autocomplete-wrapper-m2m a.related-lookup.related-lookup-m2m_hover,.grp-autocomplete-wrapper-m2m a.related-lookup.related-lookup-m2m-hover,.grp-autocomplete-wrapper-fk a.related-lookup:hover,.grp-autocomplete-wrapper-fk a.related-lookup.related-lookup-m2m_hover,.grp-autocomplete-wrapper-fk a.related-lookup.related-lookup-m2m-hover{background-position:0 -351px}a.grp-related-remove{background-position:0 -420px}a.grp-related-remove:hover,a.grp-related-remove.related-remove_hover,a.grp-related-remove.related-remove-hover{background-position:0 -443px}button.ui-datepicker-trigger{background-position:0 -188px}button.ui-datepicker-trigger:hover,button.ui-datepicker-trigger.datepicker_hover,button.ui-datepicker-trigger.datepicker-hover{background-position:0 -211px}button.ui-timepicker-trigger{background-position:0 -685px}button.ui-timepicker-trigger:hover,button.ui-timepicker-trigger.timepicker_hover,button.ui-timepicker-trigger.timepicker-hover{background-position:0 -708px}button.ui-timepicker-trigger+button.ui-datetime-now{margin-left:6px !important;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}button.ui-datetime-now{background-position:0 -234px}button.ui-datetime-now:hover,button.ui-datetime-now.datetime-now_hover,button.ui-datetime-now.datetime-now-hover{background-position:0 -257px}.grp-search-button{background-position:0 -374px;border-color:transparent !important;background-color:transparent !important}.grp-search-button:hover,.grp-search-button.related-lookup_hover,.grp-search-button.related-lookup-hover{background-position:0 -397px}a.add-another{position:relative;display:inline-block;margin-left:3px;width:18px;height:18px;vertical-align:top;font-size:11px;line-height:16px;background-position:0 0}a.add-another:hover,a.add-another.add-another_hover,a.add-another.add-another-hover{background-position:0 -24px}.grp-row a.add-another{top:-7px}.grp-row ul.radiolist+a.add-another,.grp-row ul.checkboxlist+a.add-another{top:3px}p.grp-help+*+a.add-another{float:right;top:-20px;margin-bottom:-20px}.grp-td a.add-another{float:right}.radiolist.inline+a.add-another,.checkboxlist.inline+a.add-another{float:left;margin-left:-20px;margin-right:-10000px}.grp-row.grp-cells ul.radiolist.inline+a.add-another,.grp-row.grp-cells ul.checkboxlist.inline+a.add-another{float:none;margin-right:0}input:focus+button,.vDateField:focus+span a,.vTimeField:focus+span a,input:focus+a.fb_show,input:focus+a.related-lookup,input:focus+*+a.related-lookup,input:focus+a.add-another,.grp-state-focus a.related-lookup{border:1px solid #aaa !important}input:focus+.grp-search-button{border-color:transparent !important}.grp-errors input+button,.grp-errors .vDateField+span a,.grp-errors .vTimeField+span a,.grp-errors input+a.fb_show,.grp-errors input+a.related-lookup,.grp-errors input+*+a.related-lookup,.grp-errors input+a.add-another,.grp-errors .grp-state-focus a.related-lookup,.grp-errors a.grp-related-remove,.grp-errors .grp-state-focus a.related-remove{border-color:#bf3030 !important}img[src$="admin/img/icon-unknown.gif"],img[src$="admin/img/icon-no.gif"],img[src$="admin/img/icon-yes.gif"]{position:relative;height:0;width:0;top:0;margin:-2px 0;padding:8px;font-size:0}img[src$="admin/img/icon-unknown.gif"]{background:url("../img/icons/icon-unknown.png") 0 0 no-repeat}img[src$="admin/img/icon-no.gif"]{background:url("../img/icons/icon-no.png") 0 0 no-repeat}img[src$="admin/img/icon-yes.gif"]{background:url("../img/icons/icon-yes.png") 0 0 no-repeat}.grp-object-tools{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;position:relative;float:right;top:-40px;margin:0 0 -40px}.grp-object-tools li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}.grp-object-tools li:first-child,.grp-object-tools li.first{padding-left:0}.grp-object-tools li:last-child{padding-right:0}.grp-object-tools li.last{padding-right:0}.grp-object-tools li a{display:block;padding:4px 15px;font-weight:bold;-moz-border-radius:30px;-webkit-border-radius:30px;-o-border-radius:30px;-ms-border-radius:30px;-khtml-border-radius:30px;border-radius:30px;color:#fff;border:1px solid #777;opacity:.5;background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:-webkit-linear-gradient(#999999,#888888);background:-moz-linear-gradient(#999999,#888888);background:-o-linear-gradient(#999999,#888888);background:-ms-linear-gradient(#999999,#888888);background:linear-gradient(#999999,#888888)}.grp-object-tools li a.grp-state-focus{opacity:1}.grp-object-tools li a:hover{opacity:1 !important;border:1px solid #2987a6 !important;background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:-webkit-linear-gradient(#36b0d9,#309bbf);background:-moz-linear-gradient(#36b0d9,#309bbf);background:-o-linear-gradient(#36b0d9,#309bbf);background:-ms-linear-gradient(#36b0d9,#309bbf);background:linear-gradient(#36b0d9,#309bbf)}.grp-object-tools li a.grp-add-link{padding-left:28px;background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-webkit-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-moz-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-o-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-ms-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,linear-gradient(#999999,#888888)}.grp-object-tools li a.grp-add-link:hover{background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-webkit-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-moz-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-o-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,-ms-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -280px no-repeat,linear-gradient(#36b0d9,#309bbf)}.grp-object-tools li a.grp-viewsite-link,.grp-object-tools li a[target="_blank"]{padding-left:28px;background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #999999), color-stop(100%, #888888));background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-webkit-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-moz-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-o-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-ms-linear-gradient(#999999,#888888);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,linear-gradient(#999999,#888888)}.grp-object-tools li a.grp-viewsite-link:hover,.grp-object-tools li a[target="_blank"]:hover{background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #36b0d9), color-stop(100%, #309bbf));background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-webkit-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-moz-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-o-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,-ms-linear-gradient(#36b0d9,#309bbf);background:url('../images/icons-s2649da6b63.png') 0 -304px no-repeat,linear-gradient(#36b0d9,#309bbf)}.grp-tools{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;position:relative;float:right;top:-24px;margin:0 0 -24px;padding-right:5px;height:24px}.grp-tools li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:1px;padding-right:1px}.grp-tools li:first-child,.grp-tools li.first{padding-left:0}.grp-tools li:last-child{padding-right:0}.grp-tools li.last{padding-right:0}.grp-tools li a{display:block;width:24px;height:24px}.grp-tools li a.grp-icon-text,.grp-tools li a.grp-text{padding-left:24px;padding-right:6px;width:auto;line-height:24px;color:#444}.grp-tools li a.grp-icon-text:hover,.grp-tools li a.grp-text:hover{color:#309bbf}.grp-tools li a.grp-text{padding-left:8px}.grp-tools li a.grp-add-handler{background-position:0 -731px}.grp-tools li a.grp-add-handler:hover,.grp-tools li a.grp-add-handler.tools-add-handler_hover,.grp-tools li a.grp-add-handler.tools-add-handler-hover{background-position:0 -755px}.grp-tools li a.grp-delete-handler{background-position:0 -923px}.grp-tools li a.grp-delete-handler:hover,.grp-tools li a.grp-delete-handler.tools-delete-handler_hover,.grp-tools li a.grp-delete-handler.tools-delete-handler-hover{background-position:0 -947px}.grp-tools li a.grp-remove-handler{background-position:0 -1067px}.grp-tools li a.grp-remove-handler:hover,.grp-tools li a.grp-remove-handler.tools-remove-handler_hover,.grp-tools li a.grp-remove-handler.tools-remove-handler-hover{background-position:0 -1091px}.grp-tools li a.grp-drag-handler{background-position:0 -971px}.grp-tools li a.grp-drag-handler:hover,.grp-tools li a.grp-drag-handler.tools-drag-handler_hover,.grp-tools li a.grp-drag-handler.tools-drag-handler-hover{background-position:0 -995px}.grp-tools li a.grp-viewsite-link{background-position:0 -1211px}.grp-tools li a.grp-viewsite-link:hover,.grp-tools li a.grp-viewsite-link.tools-viewsite-link_hover,.grp-tools li a.grp-viewsite-link.tools-viewsite-link-hover{background-position:0 -1235px}.grp-tools li a.grp-open-handler{background-position:0 -1019px}.grp-tools li a.grp-open-handler:hover,.grp-tools li a.grp-open-handler.tools-open-handler_hover,.grp-tools li a.grp-open-handler.tools-open-handler-hover{background-position:0 -1043px}.grp-tools li a.grp-close-handler{background-position:0 -875px}.grp-tools li a.grp-close-handler:hover,.grp-tools li a.grp-close-handler.tools-close-handler_hover,.grp-tools li a.grp-close-handler.tools-close-handler-hover{background-position:0 -899px}.grp-tools li a.grp-arrow-down-handler{background-position:0 -779px}.grp-tools li a.grp-arrow-down-handler:hover,.grp-tools li a.grp-arrow-down-handler.tools-arrow-down-handler_hover,.grp-tools li a.grp-arrow-down-handler.tools-arrow-down-handler-hover{background-position:0 -803px}.grp-tools li a.grp-arrow-up-handler{background-position:0 -827px}.grp-tools li a.grp-arrow-up-handler:hover,.grp-tools li a.grp-arrow-up-handler.tools-arrow-up-handler_hover,.grp-tools li a.grp-arrow-up-handler.tools-arrow-up-handler-hover{background-position:0 -851px}.grp-tools li a.grp-trash-handler{background-position:0 -1115px}.grp-tools li a.grp-trash-handler:hover,.grp-tools li a.grp-trash-handler.tools-trash-handler_hover,.grp-tools li a.grp-trash-handler.tools-trash-handler-hover{background-position:0 -1139px}.grp-tools li a.grp-trash-list-toggle-handler{background-position:0 -1163px}.grp-tools li a.grp-trash-list-toggle-handler:hover,.grp-tools li a.grp-trash-list-toggle-handler.tools-trash-list-toggle-handler_hover,.grp-tools li a.grp-trash-list-toggle-handler.tools-trash-list-toggle-handler-hover{background-position:0 -1187px}.grp-tools input{position:absolute;top:-30px}.grp-module>h2+.grp-tools{top:-28px;right:1px;margin-bottom:-28px}.grp-module .grp-row>.grp-tools{top:-4px;right:-9px}fieldset.grp-module .grp-row>.grp-tools{top:0}.grp-group>h2+.grp-tools,.grp-stacked h2+.grp-tools{top:-28px;right:1px;margin-bottom:-28px}.grp-stacked.grp-open>h2+.grp-tools{top:-29px;right:1px;margin-bottom:-29px}.grp-tabular h2+.grp-tools{top:-27px;right:1px;margin-bottom:-27px}h3+.grp-tools{top:-24px;margin-bottom:-24px}.grp-open>h3+.grp-tools{top:-25px;margin-bottom:-25px}.grp-tools-container .grp-tools{top:0;right:-20px;margin-bottom:0}.grp-module.grp-add-item .grp-tools{top:2px}table{margin:0;padding:0;border-spacing:none;border-collapse:separate;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}table td,table th{vertical-align:text-top;padding:10px;font-size:11px;line-height:15px}table td.nowrap,table th.nowrap{white-space:nowrap}table thead th{vertical-align:top;padding:6px 10px 6px;font-size:11px;line-height:12px;color:#888;white-space:nowrap;border-left:1px solid #ccc;border-bottom:1px solid #ccc;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:-ms-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}table thead th:first-child{border-left:0}table thead th:first-of-type{-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;-o-border-top-left-radius:2px;-ms-border-top-left-radius:2px;-khtml-border-top-left-radius:2px;border-top-left-radius:2px}table thead th:last-of-type{-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;-o-border-top-right-radius:2px;-ms-border-top-right-radius:2px;-khtml-border-top-right-radius:2px;border-top-right-radius:2px}table thead th a{display:block;margin:-6px -10px;padding:6px 10px;height:100%;color:#59afcc}table thead th a:hover{color:#444}table tbody tr td,table tbody tr th{border-bottom:1px solid #e0e0e0;border-left:1px solid #e4e4e4;vertical-align:top}table tbody tr td:first-child,table tbody tr th:first-child{border-left:0 !important}table tbody tr th{font-size:12px;font-weight:bold}table tbody tr.grp-row-even td,table tbody tr.grp-row-even th,table tbody tr.grp-alt td,table tbody tr.grp-alt th{border-left:1px solid #e0e0e0;background:#f4f4f4}table tbody tr.grp-row-odd td,table tbody tr.grp-row-odd th{background:#fff}table tbody tr.grp-selected{background:#ffd}table tbody tr.grp-row-label td{border-bottom:0;color:#666}table tbody tr:last-child td,table tbody tr:last-child th{border-bottom:0}table tbody tr:last-child td:first-child,table tbody tr:last-child th:first-child{-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;-o-border-bottom-left-radius:2px;-ms-border-bottom-left-radius:2px;-khtml-border-bottom-left-radius:2px;border-bottom-left-radius:2px}table tbody tr:last-child td:last-child,table tbody tr:last-child th:last-child{-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;-o-border-bottom-right-radius:2px;-ms-border-bottom-right-radius:2px;-khtml-border-bottom-right-radius:2px;border-bottom-right-radius:2px}table tbody tr a.related-lookup+strong{top:0}table tfoot td{border-bottom:0;border-top:1px solid #d4d4d4}table tfoot td:first-child{border-left:0}@media screen and (-webkit-min-device-pixel-ratio:0){table td>a:first-child,table th>a:first-child{position:relative;top:1px}}table td>input[type=text],table td>input[type=password],table td>input[type=file],table td>input[type=checkbox],table td>input[type=radio],table td>select,table td>textarea,table th>input[type=text],table th>input[type=password],table th>input[type=file],table th>input[type=checkbox],table th>input[type=radio],table th>select,table th>textarea{position:relative;margin:-7px 0 -5px !important}@media screen and (-webkit-min-device-pixel-ratio:0){table td>input[type=text],table td>input[type=password],table td>input[type=file],table td>input[type=checkbox],table td>input[type=radio],table td>select,table td>textarea,table th>input[type=text],table th>input[type=password],table th>input[type=file],table th>input[type=checkbox],table th>input[type=radio],table th>select,table th>textarea{margin:-9px 0 -5px !important}}table td ul.radiolist,table td ul.checkboxlist,table th ul.radiolist,table th ul.checkboxlist{margin:-3px 0 -7px}table td ul.radiolist.inline,table td ul.checkboxlist.inline,table th ul.radiolist.inline,table th ul.checkboxlist.inline{margin:-3px 0 -7px;white-space:normal !important;max-width:400px}table td a.fb_show,table td a.related-lookup,table th a.fb_show,table th a.related-lookup{margin:-5px 0 -11px -25px}table td .grp-autocomplete-wrapper-m2m,table td .grp-autocomplete-wrapper-fk,table th .grp-autocomplete-wrapper-m2m,table th .grp-autocomplete-wrapper-fk{margin:-5px 0 !important}table td .grp-autocomplete-wrapper-m2m a.related-lookup,table td .grp-autocomplete-wrapper-fk a.related-lookup,table th .grp-autocomplete-wrapper-m2m a.related-lookup,table th .grp-autocomplete-wrapper-fk a.related-lookup{margin-top:0}table td a.add-another,table th a.add-another{top:-13px}table td ul.radiolist.inline+a.add-another,table td ul.checkboxlist.inline+a.add-another,table th ul.radiolist.inline+a.add-another,table th ul.checkboxlist.inline+a.add-another{top:-5px}table td>ul.errorlist,table th>ul.errorlist{margin-top:5px !important}table td>ul.errorlist:first-child,table th>ul.errorlist:first-child{margin:-2px 0 8px !important}table.grp-sortable thead th{margin:0;padding:0}table.grp-sortable thead th div.grp-text span{display:block;padding:6px 10px}table.grp-sortable thead th div.grp-text span input[type=checkbox]{margin:-6px 0 !important}table.grp-sortable thead th.sortable .grp-text{position:relative;float:left;display:block;margin:0;padding:0}table.grp-sortable thead th.sortable .grp-text a{margin:0;padding:6px 10px}table.grp-sortable thead th.sortable .grp-sortoptions{position:relative;display:block;float:right;clear:right;margin:0 5px 0 0}table.grp-sortable thead th.sortable .grp-sortoptions a{position:relative;float:left;display:inline-block;margin:0;padding:0}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-ascending,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-descending{width:21px;height:24px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove{visibility:hidden;background-position:0 -593px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove:hover,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove.sort-remove_hover,table.grp-sortable thead th.sortable .grp-sortoptions a.grp-sortremove.sort-remove-hover{background-position:0 -616px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-ascending{background-position:0 -639px}table.grp-sortable thead th.sortable .grp-sortoptions a.grp-descending{background-position:0 -662px}table.grp-sortable thead th.sortable .grp-sortoptions:hover a.grp-sortremove{visibility:visible}table.grp-sortable thead th.sortable .grp-sortoptions span.grp-sortpriority{position:relative;float:left;display:block;padding:6px 0 0;height:16px;font-weight:bold}table.grp-sortable thead th.sortable:hover{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e0e0e0), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#e0e0e0,#eeeeee);background-image:-moz-linear-gradient(#e0e0e0,#eeeeee);background-image:-o-linear-gradient(#e0e0e0,#eeeeee);background-image:-ms-linear-gradient(#e0e0e0,#eeeeee);background-image:linear-gradient(#e0e0e0,#eeeeee)}table.grp-sortable thead th.sortable.sorted.ascending{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e0e0e0), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#e0e0e0,#eeeeee);background-image:-moz-linear-gradient(#e0e0e0,#eeeeee);background-image:-o-linear-gradient(#e0e0e0,#eeeeee);background-image:-ms-linear-gradient(#e0e0e0,#eeeeee);background-image:linear-gradient(#e0e0e0,#eeeeee)}table.grp-sortable thead th.sortable.sorted.ascending:hover{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:-ms-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}table.grp-sortable thead th.sortable.sorted.descending{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:-ms-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}table.grp-sortable thead th.sortable.sorted.descending:hover{background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e0e0e0), color-stop(100%, #eeeeee));background-image:-webkit-linear-gradient(#e0e0e0,#eeeeee);background-image:-moz-linear-gradient(#e0e0e0,#eeeeee);background-image:-o-linear-gradient(#e0e0e0,#eeeeee);background-image:-ms-linear-gradient(#e0e0e0,#eeeeee);background-image:linear-gradient(#e0e0e0,#eeeeee)}table.grp-sortable thead th.sortable.sorted a{color:#444;font-weight:bold}thead th.optional{font-weight:normal !important}tr.row-label td{margin-top:-1px;padding-top:2px;padding-bottom:0;font-size:9px}table.xfull{width:100%}table#grp-change-history{width:100%}table#grp-change-history tbody th{width:160px}table#grp-change-history tbody td,table#grp-change-history tbody th{background:#eee}table.grp-full{width:100%}.grp-module>table.grp-full{border:0;-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;-ms-border-radius:0;-khtml-border-radius:0;border-radius:0}.model-index table th{padding:7px 10px 8px}.grp-pagination ul{margin:0;padding:0;border:0;overflow:hidden;*zoom:1}.grp-pagination ul li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0}.grp-pagination ul li:first-child,.grp-pagination ul li.first{padding-left:0}.grp-pagination ul li:last-child{padding-right:0}.grp-pagination ul li.last{padding-right:0}.grp-pagination ul li{margin-right:1px;border:1px solid #fff;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.grp-pagination ul li a,.grp-pagination ul li span{display:inline-block;padding:4px 8px 4px;min-width:25px;font-size:11px;font-weight:bold;text-align:center;border:1px solid;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.grp-pagination ul li a{color:#59afcc;border-color:#d9d9d9}.grp-pagination ul li a:hover{color:#444;border-color:#bdbdbd;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:-ms-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}.grp-pagination ul li span{color:#444;border-color:#bdbdbd;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #e0e0e0));background-image:-webkit-linear-gradient(#eeeeee,#e0e0e0);background-image:-moz-linear-gradient(#eeeeee,#e0e0e0);background-image:-o-linear-gradient(#eeeeee,#e0e0e0);background-image:-ms-linear-gradient(#eeeeee,#e0e0e0);background-image:linear-gradient(#eeeeee,#e0e0e0)}.grp-pagination ul li.grp-results{margin-right:4px}.grp-pagination ul li.grp-separator{border-color:transparent}.grp-pagination ul li.grp-separator span{padding:4px 0;min-width:10px;font-size:14px;border-color:transparent;background:transparent}.grp-pagination ul li.grp-showall{margin-left:4px}.grp-pagination ul li:last-child{clear:right}.grp-date-hierarchy ul{position:relative;float:left;clear:both;font-size:11px;line-height:16px;font-weight:bold}.grp-date-hierarchy ul li{position:relative;float:left}.grp-date-hierarchy ul li a,.grp-date-hierarchy ul li span{padding:2px 5px}.grp-date-hierarchy ul li a.grp-date-hierarchy-back{color:#59afcc;padding-left:10px;background-position:0 -142px}.grp-date-hierarchy ul li a.grp-date-hierarchy-back:hover,.grp-date-hierarchy ul li a.grp-date-hierarchy-back.date-hierarchy-back_hover,.grp-date-hierarchy ul li a.grp-date-hierarchy-back.date-hierarchy-back-hover{background-position:0 -165px}.grp-date-hierarchy ul li a.grp-date-hierarchy-back:hover{color:#444}form#grp-changelist-search{margin:1px 0 0;border:1px solid #fff;-moz-border-radius:20px;-webkit-border-radius:20px;-o-border-radius:20px;-ms-border-radius:20px;-khtml-border-radius:20px;border-radius:20px}.grp-pulldown-container{position:absolute;z-index:900;width:inherit;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;margin:-1px 0 0}.grp-pulldown-container .grp-pulldown-handler{display:block;margin:0;font-weight:bold;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;cursor:pointer;background-image:url("../images/icons/tools-arrow-down-handler_hover.png");background-position:100% 0;background-repeat:no-repeat;color:#309bbf}.grp-pulldown-container .grp-pulldown-handler:hover{color:#444;background-image:url("../images/icons/tools-arrow-down-handler.png")}.grp-pulldown-container.grp-pulldown-state-open{-moz-box-shadow:0 10px 50px #333;-webkit-box-shadow:0 10px 50px #333;-o-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333}.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler{color:#444;-moz-border-radius-bottomleft:0 !important;-webkit-border-bottom-left-radius:0 !important;-o-border-bottom-left-radius:0 !important;-ms-border-bottom-left-radius:0 !important;-khtml-border-bottom-left-radius:0 !important;border-bottom-left-radius:0 !important;-moz-border-radius-bottomright:0 !important;-webkit-border-bottom-right-radius:0 !important;-o-border-bottom-right-radius:0 !important;-ms-border-bottom-right-radius:0 !important;-khtml-border-bottom-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom:0 !important;background-image:url("../images/icons/tools-arrow-down-handler.png")}.grp-pulldown-container.grp-pulldown-state-open .grp-pulldown-handler:hover{color:#444;border-bottom:0 !important;background-image:url("../images/icons/tools-arrow-down-handler.png")}.grp-pulldown-container .grp-pulldown-content{padding:4px 8px;width:100%;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-o-border-bottom-left-radius:3px;-ms-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;-o-border-bottom-right-radius:3px;-ms-border-bottom-right-radius:3px;-khtml-border-bottom-right-radius:3px;border-bottom-right-radius:3px;border-top:0 !important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.grp-pulldown-container .grp-pulldown-content:hover{border-top:0 !important}.grp-pulldown-container ul li{position:relative;margin-bottom:5px}.grp-pulldown-container ul li label{display:inline-block;font-family:Arial,sans-serif;font-size:11px;line-height:13px;color:#444;color:#888;font-weight:bold}.grp-pulldown-container ul li label.required{font-weight:bold}.grp-pulldown-container ul li select{width:100% !important}li.grp-changelist-actions{padding:5px 0 !important;background:transparent !important}li.grp-changelist-actions select{position:relative;float:left;margin:1px 5px 0 0}li.grp-changelist-actions .grp-horizontal-list{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;margin:-1px 0}li.grp-changelist-actions .grp-horizontal-list li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0}li.grp-changelist-actions .grp-horizontal-list li:first-child,li.grp-changelist-actions .grp-horizontal-list li.first{padding-left:0}li.grp-changelist-actions .grp-horizontal-list li:last-child{padding-right:0}li.grp-changelist-actions .grp-horizontal-list li.last{padding-right:0}li.grp-changelist-actions .grp-horizontal-list li{margin-right:4px;border:1px solid #333;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px;-khtml-border-radius:4px;border-radius:4px}li.grp-changelist-actions .grp-horizontal-list .grp-button{padding:5px 10px 4px;height:27px;-moz-border-radius:3px !important;-webkit-border-radius:3px !important;-o-border-radius:3px !important;-ms-border-radius:3px !important;-khtml-border-radius:3px !important;border-radius:3px !important}li.grp-changelist-actions .grp-horizontal-list a{opacity:1 !important;color:#59afcc;font-weight:bold;border:1px solid #111;background:#222}li.grp-changelist-actions .grp-horizontal-list a:hover{color:#fff;border:1px solid #222;background:#555}li.grp-changelist-actions .grp-horizontal-list span{color:#bbb !important;cursor:default !important;border:1px solid #111 !important;background:#222 !important}li.grp-changelist-actions li.grp-all,li.grp-changelist-actions li.grp-question,li.grp-changelist-actions li.grp-clear-selection{display:none}.grp-submit-row.grp-fixed-footer>ul>li.grp-changelist-actions{padding:5px 0 !important}.grp-changelist-results{background:#eee url("../img/backgrounds/changelist-results.png") repeat scroll !important}body.grp-change-list .grp-pulldown-container{border:1px solid #fff}body.grp-change-list table{margin:-1px !important}body.grp-change-list table tr.grp-selected th,body.grp-change-list table tr.grp-selected td{background:#ffd}body.grp-delete-confirmation ul.grp-nested-list li{font-size:12px;font-weight:normal}body.grp-delete-confirmation ul.grp-nested-list li>ul li>ul{margin-left:6px}body.grp-delete-confirmation ul.grp-nested-list li>ul li>ul>li{margin:5px 0 5px -4px;padding-left:10px;border-left:4px solid #ddd}body.grp-delete-confirmation ul.grp-nested-list li+li{margin-top:5px}body.grp-delete-confirmation ul.grp-nested-list>li{margin-left:0;font-size:14px;font-weight:bold;position:relative;float:left;clear:both;margin:0 0 5px;padding:0;width:100%;border:1px solid #ccc;background:#eee;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;margin-top:2px !important;margin-bottom:0 !important;padding:8px 10px}body.grp-delete-confirmation ul.grp-nested-list>li .grp-module{margin:0;border:0}body.grp-delete-confirmation ul.grp-nested-list>li .grp-module+.grp-module{border-top:1px solid #d9d9d9;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-o-border-top-left-radius:0;-ms-border-top-left-radius:0;-khtml-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;-o-border-top-right-radius:0;-ms-border-top-right-radius:0;-khtml-border-top-right-radius:0;border-top-right-radius:0}body.grp-delete-confirmation ul.grp-nested-list>li+li{margin-top:0}body.grp-delete-confirmation ul.grp-nested-list>li>ul{margin-top:8px;border-top:1px solid #ddd}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li{margin-top:0 !important;padding-top:8px;padding-bottom:8px;font-size:13px;font-weight:bold;border-top:1px solid #fff;border-bottom:1px solid #ddd}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li:last-child{padding-bottom:0;border-bottom:0}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li>ul{margin-top:8px}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li>ul>li{font-weight:bold}body.grp-delete-confirmation ul.grp-nested-list>li>ul>li>ul>li>ul li ul li{color:#888}body.grp-filebrowser table td>a:first-child,body.grp-filebrowser table th>a:first-child{position:relative;top:0}body.grp-filebrowser table td.grp-sorted a,body.grp-filebrowser table th.grp-sorted a{padding-right:30px;color:#444;font-weight:bold}body.grp-filebrowser table td.grp-sorted.grp-ascending a,body.grp-filebrowser table th.grp-sorted.grp-ascending a{background-position:100% -639px}body.grp-filebrowser table td.grp-sorted.grp-descending a,body.grp-filebrowser table th.grp-sorted.grp-descending a{background-position:100% -662px}body.grp-filebrowser table td{padding:10px 10px 8px}body.grp-filebrowser table td ul.grp-actions{position:relative;top:-1px;left:-5px;margin:0 -5px -1px 0}.grp-module.ui-widget{border:none}.ui-widget-content{border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-o-border-bottom-left-radius:3px;-ms-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;-o-border-bottom-right-radius:3px;-ms-border-bottom-right-radius:3px;-khtml-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ui-sortable{position:relative;float:left;clear:both;width:100%}.ui-sortable .ui-sortable-helper,.ui-sortable .ui-sortable-placeholder{opacity:.8}.ui-sortable .ui-sortable-helper{margin:0;width:100% !important;height:auto !important;overflow:visible}.ui-sortable .grp-module.ui-sortable-placeholder{border:1px solid #ccc !important;background:transparent url("../img/backgrounds/ui-sortable-placeholder.png") 0 0 repeat scroll !important}.grp-group.grp-stacked .ui-sortable-placeholder{margin:0 0 2px}.grp-group.grp-stacked .ui-sortable-placeholder:first-child{margin-top:0}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-placeholder{overflow:hidden}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-placeholder .grp-th,.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-placeholder .grp-td{padding-top:0 !important;padding-bottom:0 !important;background:transparent !important}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-helper{border-top:0 !important}.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-helper .grp-th,.grp-group.grp-tabular .ui-sortable .grp-module.ui-sortable-helper .grp-td{background:#ffffcc !important}.grp-group.grp-stacked .ui-sortable-helper,.grp-group.grp-stacked .ui-sortable-helper .grp-module,.grp-group.grp-stacked .ui-sortable-helper h2,.grp-group.grp-stacked .ui-sortable-helper h3,.grp-group.grp-stacked .ui-sortable-helper h4,.grp-group.grp-stacked .grp-collapse.grp-predelete.ui-sortable-helper>h3.grp-collapse-handler,.grp-group.grp-stacked .grp-collapse.grp-open.predelete.ui-sortable-helper>h3.grp-collapse-handler,.grp-group.grp-stacked .grp-collapse.grp-predelete.ui-sortable-helper h4.grp-collapse-handler,.grp-group.grp-stacked .grp-collapse.grp-open.grp-predelete.ui-sortable-helper h4.grp-collapse-handler{background:#ffffcc !important}.datetime br{display:none}.datetimeshortcuts{width:40px;position:relative;margin-left:10px}.datetimeshortcuts a{margin-left:0 !important}.ui-datepicker{position:absolute;display:none;margin:-1px 0 0 !important;padding:3px 3px 0;width:auto !important;font-size:12px;border:1px solid #888;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#eee;-moz-box-shadow:0 10px 50px #333;-webkit-box-shadow:0 10px 50px #333;-o-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333}.ui-datepicker input,.ui-datepicker select,.ui-datepicker textarea,.ui-datepicker button{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#fdfdfd;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-o-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}.ui-datepicker input:focus,.ui-datepicker input.grp-state-focus,.ui-datepicker select:focus,.ui-datepicker select.grp-state-focus,.ui-datepicker textarea:focus,.ui-datepicker textarea.grp-state-focus,.ui-datepicker button:focus,.ui-datepicker button.grp-state-focus{border:1px solid #aaa;-moz-box-shadow:#ccc 0 0 6px;-webkit-box-shadow:#ccc 0 0 6px;-o-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.ui-datepicker .ui-widget-content{background:#eee;color:#222222}.ui-datepicker .ui-widget-content a{color:#444}.ui-datepicker .ui-widget-header{padding:2px 0;height:25px;background:#cccccc;color:#222222;font-weight:bold}.ui-datepicker .ui-widget-header a{color:#444}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:4px;width:20px;height:30px;background-color:transparent;background-position:50% 50%;background-repeat:no-repeat;cursor:pointer}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:none}.ui-datepicker .ui-datepicker-prev{left:3px;background-position:0 -1305px}.ui-datepicker .ui-datepicker-prev:hover,.ui-datepicker .ui-datepicker-prev.ui-datepicker-prev_hover,.ui-datepicker .ui-datepicker-prev.ui-datepicker-prev-hover{background-position:0 -1328px}.ui-datepicker .ui-datepicker-next{right:3px;background-position:0 -1259px}.ui-datepicker .ui-datepicker-next:hover,.ui-datepicker .ui-datepicker-next.ui-datepicker-next_hover,.ui-datepicker .ui-datepicker-next.ui-datepicker-next-hover{background-position:0 -1282px}.ui-datepicker .ui-datepicker-prev-hover{left:3px;border:none}.ui-datepicker .ui-datepicker-next-hover{right:3px;border:none}.ui-datepicker .ui-datepicker-title{margin:3px 25px 2px;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{float:left;font-size:1em;margin:-3px 0 -1px !important;min-width:30px}.ui-datepicker .ui-datepicker-title select.ui-datepicker-month-year{width:100%}.ui-datepicker .ui-datepicker-title select.ui-datepicker-month,.ui-datepicker .ui-datepicker-title select.ui-datepicker-year{width:49%}.ui-datepicker .ui-datepicker-title select.ui-datepicker-year{float:right}.ui-datepicker table{width:100%;font-size:11px;margin:0 0 2px}.ui-datepicker table th{padding:5px 0;text-align:center;color:#888;font-weight:bold;border:0;background:transparent}.ui-datepicker table td{min-width:25px;border:0;padding:1px}.ui-datepicker table td span,.ui-datepicker table td a{padding:3px 0 3px;margin:0 !important;text-align:center;display:block;color:#444;font-size:11px;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.ui-datepicker table td span.ui-state-default,.ui-datepicker table td a.ui-state-default{color:#444}.ui-datepicker table td span.ui-state-hover,.ui-datepicker table td a.ui-state-hover{color:#fff !important;border-color:transparent !important;background:#444 !important}.ui-datepicker table td span.ui-state-active,.ui-datepicker table td a.ui-state-active{background:#fff}.ui-datepicker table td span.ui-state-highlight,.ui-datepicker table td a.ui-state-highlight{border-color:#bababa;background:#d6d6d6}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border:0}.ui-datepicker .ui-datepicker-buttonpane button{float:left;margin:3px 0;padding:4px 5px 5px;height:25px;color:#aaa;font-size:11px;border:1px solid #c7c7c7;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:transparent;cursor:pointer}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:right;opacity:1 !important;color:#444;font-weight:bold;background:#cee9f2}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current.ui-state-hover{color:#fff !important;border-color:#444 !important;background:#444 !important}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-first .ui-datepicker-title{margin-right:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-first table{margin-right:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title{margin-right:5px !important;margin-left:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-middle table{margin-right:5px !important;margin-left:3px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-title{margin-left:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-group-last table{margin-left:5px !important}.ui-datepicker.ui-datepicker-multi .ui-datepicker-buttonpane{border:none}.ui-datepicker.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-row-break{clear:both;width:100%;font-size:0em}.ui-datepicker-append{margin-left:6px;color:#999;font-size:10px}.ui-datepicker td.ui-state-disabled{padding:1px;text-align:center}.ui-datepicker td.ui-state-disabled span{background:#ccc;color:#555 !important;font-weight:bold;font-size:11px;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}button.ui-datepicker-close{float:left !important;margin-right:4px !important}#ui-timepicker{position:absolute;display:none;margin:-1px 0 0 !important;padding:5px 3px 3px 5px;width:216px;font-size:12px;border:1px solid #888;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#eee;-moz-box-shadow:0 10px 50px #333;-webkit-box-shadow:0 10px 50px #333;-o-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333}#ui-timepicker input,#ui-timepicker select,#ui-timepicker textarea,#ui-timepicker button{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#fdfdfd;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-o-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}#ui-timepicker input:focus,#ui-timepicker input.grp-state-focus,#ui-timepicker select:focus,#ui-timepicker select.grp-state-focus,#ui-timepicker textarea:focus,#ui-timepicker textarea.grp-state-focus,#ui-timepicker button:focus,#ui-timepicker button.grp-state-focus{border:1px solid #aaa;-moz-box-shadow:#ccc 0 0 6px;-webkit-box-shadow:#ccc 0 0 6px;-o-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}#ui-timepicker .ui-widget-content{background:#eee;color:#222222}#ui-timepicker .ui-widget-content a{color:#444}#ui-timepicker .ui-widget-header{padding:2px 0;height:25px;background:#cccccc;color:#222222;font-weight:bold}#ui-timepicker .ui-widget-header a{color:#444}#ui-timepicker ul{position:relative;float:left;clear:both;width:auto}#ui-timepicker ul li.row{position:relative;float:left;display:block;margin:0 2px 2px 0;padding:2px 10px 1px;width:30px;font-size:11px;text-align:center;border:0;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;cursor:pointer}#ui-timepicker ul li.row.ui-state-default{color:#444;border:1px solid #c7c7c7 !important;background:#e1f0f5}#ui-timepicker ul li.row.ui-state-default:hover{color:#fff;border:1px solid #666 !important;background:#444}#ui-timepicker ul li.row.ui-state-active{border:1px solid #bababa !important;background:#d6d6d6}.ui-menu{display:block;margin:0;padding:2px;list-style:none}.ui-menu li:first-child span{display:block;padding:1px 4px;color:#888;font-weight:bold}.ui-menu li:first-child+li{margin-top:3px}.ui-menu li.ui-menu-item{margin:0;padding:0;width:100%}.ui-menu li.ui-menu-item a{display:block;margin:0;padding:3px 4px;color:#444;font-weight:bold;border:1px solid #c7c7c7;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px;background:#cee9f2;cursor:pointer}.ui-menu li.ui-menu-item a:hover,.ui-menu li.ui-menu-item a.ui-state-hover,.ui-menu li.ui-menu-item a.ui-state-active{color:#fff;border:1px solid #333;background:#444}.ui-menu li.ui-menu-item a.ui-state-hover,.ui-menu li.ui-menu-item a.ui-state-active{font-weight:bold;margin:0}.ui-menu li.ui-menu-item+li.ui-menu-item{margin-top:2px;border-top:0 !important}.ui-menu .ui-menu{margin-top:-3px}.ui-autocomplete{position:absolute;cursor:default;margin:-1px 0 0 !important;padding:3px;font-size:12px;border:1px solid #888;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#eee;-moz-box-shadow:0 10px 50px #333;-webkit-box-shadow:0 10px 50px #333;-o-box-shadow:0 10px 50px #333;box-shadow:0 10px 50px #333;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}.ui-autocomplete input,.ui-autocomplete select,.ui-autocomplete textarea,.ui-autocomplete button{margin:0;padding:2px 5px;height:25px;font-family:Arial,sans-serif;font-size:12px;line-height:14px;font-weight:bold;color:#555;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#fdfdfd;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-moz-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-webkit-box-shadow:0px 0px 5px #eee 0 1px 3px inset;-o-box-shadow:0px 0px 5px #eee 0 1px 3px inset;box-shadow:0px 0px 5px #eee 0 1px 3px inset;overflow:hidden;vertical-align:middle}.ui-autocomplete input:focus,.ui-autocomplete input.grp-state-focus,.ui-autocomplete select:focus,.ui-autocomplete select.grp-state-focus,.ui-autocomplete textarea:focus,.ui-autocomplete textarea.grp-state-focus,.ui-autocomplete button:focus,.ui-autocomplete button.grp-state-focus{border:1px solid #aaa;-moz-box-shadow:#ccc 0 0 6px;-webkit-box-shadow:#ccc 0 0 6px;-o-box-shadow:#ccc 0 0 6px;box-shadow:#ccc 0 0 6px;background:#fff;outline:0}.ui-autocomplete .ui-widget-content{background:#eee;color:#222222}.ui-autocomplete .ui-widget-content a{color:#444}.ui-autocomplete .ui-widget-header{padding:2px 0;height:25px;background:#cccccc;color:#222222;font-weight:bold}.ui-autocomplete .ui-widget-header a{color:#444}* html .ui-autocomplete{width:1px}body{position:relative;float:left;clear:both;overflow:hidden;*zoom:1;padding:0;width:100%;height:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;background:#fff;overflow:visible}.grp-column.grp-centered{position:relative;display:block;float:none !important;margin:0 auto !important}.grp-span-fluid{float:none;display:table-cell;width:10000px}body.grp-login #grp-context-navigation{display:none}body.grp-login #grp-content{top:36px}body.grp-login fieldset.grp-module{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-o-border-top-left-radius:0;-ms-border-top-left-radius:0;-khtml-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;-o-border-top-right-radius:0;-ms-border-top-right-radius:0;-khtml-border-top-right-radius:0;border-top-right-radius:0;border-color:#222;border-top:1px solid #111 !important;background:#222}body.grp-login fieldset.grp-module .grp-row{padding:10px;border-top:1px solid #333 !important;border-bottom:1px solid #111 !important}body.grp-login fieldset.grp-module .grp-row label{color:#fff}body.grp-login fieldset.grp-module .grp-row .errorlist{color:#ce3b3b}body.grp-login .grp-module.grp-submit-row,body.grp-login .grp-module.grp-submit-row ul{padding:0;border:0;background:transparent}body.grp-login .grp-module.grp-submit-row li,body.grp-login .grp-module.grp-submit-row ul li{float:right;background:transparent}header#grp-header{position:fixed;z-index:1000;float:left;clear:both;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}header#grp-header #grp-navigation{position:relative;float:left;clear:both;width:100%;padding:0 20px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;color:#fff;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(#333333,#222222);background-image:-moz-linear-gradient(#333333,#222222);background-image:-o-linear-gradient(#333333,#222222);background-image:-ms-linear-gradient(#333333,#222222);background-image:linear-gradient(#333333,#222222);overflow:hidden;*zoom:1;overflow:visible}header#grp-header #grp-navigation h1#grp-admin-title{position:relative;float:left;margin:0;padding:10px 0;font-size:12px;line-height:16px}header#grp-header #grp-navigation a{color:#4fb2d3}header#grp-header #grp-navigation a:hover{color:#fff}header#grp-header #grp-navigation ul li.grp-collapse{position:relative;z-index:1000}header#grp-header #grp-navigation ul li.grp-collapse>ul{display:none}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul{position:absolute;z-index:1010;display:block;margin:-1px 0 0 -1px;width:202px;border-top:1px solid #090909;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-o-border-bottom-left-radius:3px;-ms-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;-o-border-bottom-right-radius:3px;-ms-border-bottom-right-radius:3px;-khtml-border-bottom-right-radius:3px;border-bottom-right-radius:3px;background:#222}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul li{border-top:1px solid #3c3c3c;border-bottom:1px solid #090909}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul li:last-child{border-bottom:0}header#grp-header #grp-navigation ul li.grp-collapse.grp-open>ul li a{display:block;padding:5px 10px}header#grp-header #grp-navigation ul#grp-user-tools{margin:0 -10px 0 0;border-left:1px solid #090909}header#grp-header #grp-navigation ul#grp-user-tools>li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:0;padding-right:0;border-left:1px solid #343434;border-right:1px solid #090909}header#grp-header #grp-navigation ul#grp-user-tools>li:first-child,header#grp-header #grp-navigation ul#grp-user-tools>li.first{padding-left:0}header#grp-header #grp-navigation ul#grp-user-tools>li:last-child{padding-right:0}header#grp-header #grp-navigation ul#grp-user-tools>li.last{padding-right:0}header#grp-header #grp-navigation ul#grp-user-tools>li.grp-user-options-container{width:200px}header#grp-header #grp-navigation ul#grp-user-tools>li.grp-user-options-container:last-child{margin-right:11px}header#grp-header #grp-navigation ul#grp-user-tools>li:last-child{border-right:0}header#grp-header #grp-navigation ul#grp-user-tools>li a{display:block;padding:10px}header#grp-header #grp-user-tools{position:relative;float:right;font-weight:bold}#grp-content{position:relative;float:left;clear:both;top:80px;padding:0 20px 120px;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}#grp-context-navigation{position:relative;float:left;clear:both;width:100%;font-weight:bold;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #ccc;background:#eee}#grp-breadcrumbs{float:left}#grp-breadcrumbs>ul{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;padding:5px 20px;text-shadow:0 1px 0 #f5f5f5}#grp-breadcrumbs>ul li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}#grp-breadcrumbs>ul li:first-child,#grp-breadcrumbs>ul li.first{padding-left:0}#grp-breadcrumbs>ul li:last-child{padding-right:0}#grp-breadcrumbs>ul li.last{padding-right:0}#grp-breadcrumbs>ul a{display:block;padding-right:15px;background-position:100% -94px}#grp-breadcrumbs>ul a:hover,#grp-breadcrumbs>ul a.breadcrumbs_hover,#grp-breadcrumbs>ul a.breadcrumbs-hover{background-position:0 -118px}#grp-breadcrumbs>ul a:hover{background-position:100% -118px}#grp-page-tools{float:right;right:20px}#grp-page-tools #grp-toc-handler{display:none}#grp-page-tools #grp-toc-content{display:none}#grp-page-tools ul{margin:0;padding:0;border:0;overflow:hidden;*zoom:1;padding:0 20px;overflow:visible}#grp-page-tools ul li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:left;padding-left:5px;padding-right:5px}#grp-page-tools ul li:first-child,#grp-page-tools ul li.first{padding-left:0}#grp-page-tools ul li:last-child{padding-right:0}#grp-page-tools ul li.last{padding-right:0}#grp-page-tools ul li{position:relative;padding:1px 0 0}#grp-page-tools ul li a{display:block;padding:4px 5px 4px 0}#grp-page-tools ul li a.grp-tool{padding:0;width:18px;height:24px}#grp-page-tools ul li a#grp-open-all{background-position:0 -1019px}#grp-page-tools ul li a#grp-open-all:hover,#grp-page-tools ul li a#grp-open-all.tools-open-handler_hover,#grp-page-tools ul li a#grp-open-all.tools-open-handler-hover{background-position:0 -1043px}#grp-page-tools ul li a#grp-close-all{background-position:0 -875px}#grp-page-tools ul li a#grp-close-all:hover,#grp-page-tools ul li a#grp-close-all.tools-close-handler_hover,#grp-page-tools ul li a#grp-close-all.tools-close-handler-hover{background-position:0 -899px}.grp-messagelist{position:relative;float:none;clear:both;padding:0 0 20px;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.grp-messagelist li{font-weight:bold;padding:5px 10px;border:1px solid #8ccde2;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#b5deec}.grp-messagelist li.grp-success{border:1px solid #b7e28c;background:#d1ecb5}.grp-messagelist li.grp-warning{border:1px solid #f3d988;background:#f8e8b7}.grp-messagelist li.grp-error{border:1px solid #e7a1a1;background:#ecb5b5}.grp-messagelist li+li{margin-top:2px}.grp-submit-row{padding:0;border:0;-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;-ms-border-radius:0;-khtml-border-radius:0;border-radius:0;background:transparent}.grp-submit-row>ul{margin-top:10px;overflow:visible}.grp-submit-row>ul>li{list-style-image:none;list-style-type:none;margin-left:0;white-space:nowrap;display:inline;float:right;padding-left:0;padding-right:0;margin-left:10px;-moz-border-radius:7px;-webkit-border-radius:7px;-o-border-radius:7px;-ms-border-radius:7px;-khtml-border-radius:7px;border-radius:7px}.grp-submit-row>ul>li:first-child,.grp-submit-row>ul>li.first{padding-right:0}.grp-submit-row>ul>li:last-child{padding-left:0}.grp-submit-row>ul>li.last{padding-left:0}.grp-submit-row>ul>li.grp-float-left{margin-left:0;margin-right:10px}.grp-submit-row>ul>li input.grp-button,.grp-submit-row>ul>li a.grp-button,.grp-submit-row>ul>li button.grp-button{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=75);opacity:0.75}.grp-submit-row>ul>li input.grp-button.grp-default,.grp-submit-row>ul>li a.grp-button.grp-default,.grp-submit-row>ul>li button.grp-button.grp-default{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.grp-submit-row>ul>li input.grp-button:hover,.grp-submit-row>ul>li input.grp-button:focus,.grp-submit-row>ul>li a.grp-button:hover,.grp-submit-row>ul>li a.grp-button:focus,.grp-submit-row>ul>li button.grp-button:hover,.grp-submit-row>ul>li button.grp-button:focus{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.grp-submit-row>ul>li button.grp-button{width:auto}.grp-submit-row>ul>li .grp-button{-moz-box-shadow:0 0 10px #bbb;-webkit-box-shadow:0 0 10px #bbb;-o-box-shadow:0 0 10px #bbb;box-shadow:0 0 10px #bbb}.grp-submit-row.grp-fixed-footer>ul{margin-top:0}.grp-submit-row.grp-fixed-footer>ul>li{padding:5px !important;background:#444}.grp-submit-row.grp-fixed-footer>ul>li .grp-button{-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none}.grp-fixed-footer{position:fixed;float:left;bottom:0;left:0;margin:0;padding:10px 20px;width:100%;border:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;color:#fff;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(#333333,#222222);background-image:-moz-linear-gradient(#333333,#222222);background-image:-o-linear-gradient(#333333,#222222);background-image:-ms-linear-gradient(#333333,#222222);background-image:linear-gradient(#333333,#222222)}body.grp-popup #grp-navigation{display:none}body.grp-popup #grp-breadcrumbs{top:0}body.grp-popup #grp-content{top:20px} diff --git a/static/grappelli_orig/tinymce/changelog.txt b/static/grappelli_orig/tinymce/changelog.txt new file mode 100644 index 00000000..ec712077 --- /dev/null +++ b/static/grappelli_orig/tinymce/changelog.txt @@ -0,0 +1,1528 @@ +Version 3.5b2 (2012-03-15) + Rewrote the enter key logic to normalize browser behavior. + Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option. + Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node. + Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls. + Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection. + Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string. + Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default. +Version 3.5b1 (2012-03-08) + Added new event class that is faster and enables support for faking events. + Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema. + Added new schema option and support for the HTML5 schema. + Added new visualblocks plugin that shows html5 blocks with visual borders. + Added new types and selector options to make it easier to create editor instances with different configs. + Added new preview of formatting options in various listboxes. + Added new preview_styles option that enables control over what gets previewed. + Fixed bug where content css would be loaded twice into iframe. + Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed. + Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined. + Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting. + Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing. +Version 3.4.9.x (2012-02-xx) + Improved behaviour of backspacing into a table to be consistant across browsers and disable backspace when cursor immediately follows a table. + Improved edit CSS style plugin for single and multiple block selection and provide option to apply style to only selected text. + Fixed bug in Chrome where moving caret down in table and pasting throws errors. + Corrected reference to TinyMCE trim function. + Fixed bug where Ignore All in IE did not remove the underline from the selected word. + Fixed bug in html source editor word wrap option not wrapping text in Webkit browsers. + Fixed bug where it was possible to insert an invalid colour in the color pop-up dialog. + Fixed bug in Webkit where if anchor is on last line by itself caret can not be placed after it. +Version 3.4.9 (2012-02-23) + Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete. + Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents. + Fixed bug where pressing enter on end of list item with a heading would create a new item with heading. + Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled. + Fixed bug in Gecko where undo wasn't added when focus was lost. + Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line. + Fixed bug where right-click on formatted text in IE selected the entire line. + Fixed bug where text ending with space could not be unformatted in IE. + Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used. + Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts. + Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config. + Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser. + Fixed bug where content css files where loaded twice into the iframe. + Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse. +Version 3.4.8 (2012-02-02) + Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text. + Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked. + Fixed bug where wrong text align buttons are active when multiple block elements are selected. + Fixed bug where selected link not showing in target field of link dialog in some selection cases. + Use settings for remove_trailing_br so this can be turned off instead of hard coding the value. + Fixed bug in IE where the media plugin displayed null text when some values aren't filled in. + Added API method 'onSetAttrib' that fires when the attribute value on a node changes. + Fix font size dropdown value not being updated when text already has a font size in the advanced template. + Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times. + Fixed bug where caret cannot be placed after table if table is at end of document in IE. + Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur. + Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly. + Fixed bug where a stranded bullet point would get created in WebKit. + Fixed bug where selecting text in a blockquote and pressing backspace toggles the style. + Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property. + Fix white space in between spans from being deleted. + Fixed bug where scrollbars where visible in the character map dialog on Gecko. + Fixed issue with missing translation for one of the emoticons. + Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev. + Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout. + Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace. + Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber. + Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu. +Version 3.4.7 (2011-11-03) + Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office. + Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text. + Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row. + Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10. + Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph. + Fix new list items in IE8 not displayed on a new line when list contains nested list items. + Clear formatting in table cell breaks the cell. + Made media type list localisable. + Fix out of memory error when using prototype in media dialog. + Fixed bug where could not add a space in the middle of a th cell. + Fixed bug where adding a bullet between two existing bullets adds an extra one + Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in. + Fixed bug where pressing enter on an empty list item does not outdent properly in FF + Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell + Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox. + Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph. + Fixed bug where deleting part of the link text can cause a link with no destination to be saved. + Fixed bug where css style border widths wasn't handled correctly in table dialog. + Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop. + Fixed bug where scripts with custom script types wasn't properly passed though the editor. + Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled. + Made emoticons dialog use the keyboard naviation. + Added navigation instructions to the symbols dialog. + Added ability to set default values for the media plugin. + Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties. + Fixed bug where the symbols dialog was not accessible. + Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility. + Fixed bug where the advanced color picker wasn't working properly on FF 7. + Fixed issue where the advanced color picker was producing uppercase hex codes. + Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements. + Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit. + Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes. +Version 3.4.6 (2011-09-29) + Fixed bug where list items were being created for empty divs. + Added support in Media plugin for audio media using the embed tag + Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read. + Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers) + Fixed bug where classid attribute was not being checked from embed objects. + Fixed bug in jsrobot tests with intermittently failing. + Fixed bug where anchors wasn't updated properly if you edited them using IE 8. + Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor. + Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them. + Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin. + Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin. + Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin. + Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko. + Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly. + Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers. +Version 3.4.5 (2011-09-06) + Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes. + Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved. + Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats. + Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly. + Fixed bug in WebKit where console messages would be logged when deleting an empty document. + Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list + Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements. + Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases. + Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM. + Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized. + Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control. + Fixed bug where adjacent links would get merged on IE due to bugs in their link command. + Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe. + Fixed bug where floated images in WebKit wouldn't get properly linked. + Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode. + Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P. + Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit. + Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit. + Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7. + Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit. + Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents. + Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text. + Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled. + Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin. + Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped. +Version 3.4.4 (2011-08-04) + Added new html5 audio support. Patch contributed by Ronald M. Clifford. + Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin. + Fixed selection to match visual selection before applying formatting changes. + Fixed browser specific bugs in lists for WebKit and IE. + Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel. + Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser. + Fixed bug where formatting change would be lost after pressing enter. + Fixed bug in WebKit where deleting across blocks would add extra styles. + Fixed bug where moving cursor vertically in tables in WebKit wasn't working. + Fixed bug in IE where deleting would cause error in console. + Fixed bug where the formatter was not applying formats across list elements. + Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed. + Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden. + Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko. + Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements. + Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event. + Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them. + Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog. + Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location. +Version 3.4.3.2 (2011-06-30) + Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit. + Fixed bugs in tests in firefox5 and WebKit. + Fixed bug where selection of table cells would produce an exception on Gecko. + Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden. + Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup. + Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection. + Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes. + Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document. + Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them. + Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed. + Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element. + Fixed performance issue with the noneditable plugin where it would enable/disable controls to often. +Version 3.4.3.1 (2011-06-16) + Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin. + Fixed bug where custom buttons were not being rendered correctly when in high contrast mode. + Added support for iOS 5 that now supporting contentEditable in it's latest beta. + Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output. + Fixed bug where custom_elements option wasn't working properly on IE browsers. + Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements. + Fixed bug where attributes with wasn't properly encoded as XML entities. +Version 3.4.3 (2011-06-09) + Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location. + Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly. + Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8. + Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs. + Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied. + Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page. + Fixed bug where applying a heading style to a list item would cascade style to children list items. + Fixed bug where Editor loses focus when backspacing and changing styles in WebKit. + Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided. + Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari. + Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk. + Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded. + Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ). + Added possibility to change properties of all table cells in a column. + Added external_image_list option to get images list from user-defined variable or function. + Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome. + Fixed bug where table size inputs were to small for values with size units. + Fixed bug where table cell/row size input values were not validated. + Fixed bug where menu item line-height would be set to wrong value by external styles. + Fixed bug where hasUndo() would return wrong answer. + Fixed bug where page title would be set to undefined by fullpage plugin. + Fixed bug where HTML5 video properties were not updated in embedded media settings. + Fixed bug where HTML comment on the first line would cause an error. + Fixed bug where spellchecker menu was positioned incorrectly on IE. + Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list. + Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped. + Fixed bug where numeric entities with leading zeros would produce incorrect decoding. + Fixed bug where hexadecimal entities wasn't properly decoded. + Fixed bug where bookmarks wasn't properly stored/restored on undo/redo. + Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents. + Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements. + Fixed so contentEditable is used for the body of the editor if it's supported. + Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null. + Fixed performance issue with mceInsertCommand and inserting very simple contents. + Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic. + Fixed performance issue with table plugin where it checked for selected cells to often. + Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers. + Fixed bug where Gecko would remove single paragraphs if there where contents before/after it. + Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin. +Version 3.4.2 (2011-04-07) + Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text. + Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz. + Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers. + Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser. + Fixed bug where blocks containing a single anchor element would be treated as empty. + Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed. + Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed. + Fixed bug where image border color/style values were overwritten by advimage plugin. + Fixed bug where setting border in advimage plugin would throw error in IE. + Fixed bug where empty anchors list in link settings wasn't hidden. + Fixed bug where xhtmlextras popups were missing localized popup-size parameters. + Fixed bug where the context menu wouldn't select images on WebKit browsers. + Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior. + Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control. + Fixed bug where contextmenu wasn't disabled on noneditable elements. + Fixed bug where getStyle function would trigger error when called on element without style property. + Fixed bug where editor fail to load if Javascript Compressor was used. + Fixed bug where list-style-type=lower-greek would produce errors in IE<8. + Fixed bug where spellchecker plugin would produce errors on IE6-7. + Fixed bug where theme_advanced_containers configuration option causes error. + Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value. + Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size. + Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog. +Version 3.4.1 (2011-03-24) + Added significantly improved list handling via the new 'lists' plugin. + Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default. + Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color. + Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour. + Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled. + Fixed bug where selection locations on undo/redo didn't work correctly on specific contents. + Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe. + Fixed bug where some ascii numeric entities wasn't properly decoded. + Fixed bug where some non western language codes wasn't properly decoded/encoded. + Fixed bug where undo levels wasn't created when deleting contents on IE. + Fixed bug where the initial undo levels bookmark wasn't updated correctly. + Fixed bug where search/replace wouldn't be scoped to editor instances on IE8. + Fixed bug where IE9 would produce two br elements after block elements when pasting. + Fixed bug where IE would place the caret at an incorrect position after a paste operation. + Fixed bug where a paste operation using the keyboard would add an extra undo level. + Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted. + Fixed bug where the table plugin couldn't correctly handle invalid table structures. + Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin. + Fixed bug where toggle states on some of the list boxes didn't update correctly. + Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10. + Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin. + Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid. + Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme. + Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome. + Fixed bug with references to non-existing images in css of fullpage plugin. + Fixed bug where item could be unselected in spellchecker's language selector. + Fixed bug where some mispelled words could be not highlighted using spellchecker plugin. + Fixed bug where spellchecking would merge some words on IE. + Fixed bug where spellchecker context menu was not always positioned correctly. + Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled. + Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents. + Fixed bug where selecting the whole table would enable table tools for cells and rows. + Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin. + Fixed bug where setting text color in fullpage plugin doesn't work. + Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly. + Fixed bug where black spade suit character was not included in special character selector. + Fixed bug where setting invalid values for table cell size would throw an error in IE. + Fixed bug where spellchecking would remove whitespace characters from PRE block in IE. + Fixed bug where HR was inserted inside P elements instead of splitting them. + Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes. + Fixed bug where bullet lists weren't always detected correctly. + Fixed bug where deleting some paragraphs on IE would cause an exception. + Fixed bug where the json encoder logic wouldn't properly encode \ characters. + Fixed bug where the onChange event would be fired when the editor was first initialized. + Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class. + Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences. + Fixed issue where styles were not included when using the full page plugin. + Fixed issue where drag/drop operations wasn't properly added to the undo levels. + Fixed issue where colors wasn't correctly applied to elements with underline decoration. + Fixed issue where deleting some paragraphs on IE would cause an exception. +Version 3.4 (2011-03-10) + Added accessibility example with various accessibility options contributed by Ephox. + Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin. + Fixed bug where the image.htm had some strange td artifacts probably due to auto merging. + Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method. + Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent. + Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode. + Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode. + Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode. + Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox. + Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme. + Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x. + Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right. + Fixed bug where the formatter would align images when the selection range was collapsed. + Fixed bug where the image button would be active when the selection range was collapsed. + Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic. + Fixed bug where the table cell/row dialogs would produce empty attributes. + Fixed bug where the tfoot wouldn't be added to the top of the table. + Fixed bug where the formatter would merge siblings with white space between them. + Fixed bug where pasting headers and paragraphs would produce an extra paragraph. + Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color. + Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting. + Fixed bug where multiple BR elements at end of block elements where removed. + Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages. + Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode. + Fixed bug where the search/replace plugin wouldn't work correctly on IE 9. + Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox. + Fixed so the values entered in the color picker are forced to hex values. + Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade. + Removed obsolete calls in various plugins to the mceBeginUndoLevel command. +Version 3.4b3 (2011-02-10) + Added WAI-ARIA support for the main UI and dialogs this feature was contributed by Ephox. + Added iframe support to media plugin in order to handle the new YouTube HTML5 video formats. + Fixed bug where anchors would wrap the text contents after it due to a bug in the DomParser logic. + Fixed bug where the selected state wouldn't be removed on ListBox controls when a menu item was selected. + Fixed bug where IE could throw an unspecified error exception when the getBookmark logic was executed. + Fixed bug where IE would throw an invalid argument error when focus was applied to an empty editor instance. + Fixed bug where applying inline format wouldn't work if the start cell in the selection was empty. + Fixed bug where auto detection logic for YouTube and Google Video wouldn't work in the new media plugin. + Fixed bug where td elements would get a colspan/rowspan of 1 when created by the table plugin. + Fixed bug where removal/padding of empty elements wasn't handled correctly. + Fixed bug where internal elements would show up in element path. + Fixed bug where internal elements would get serialized as valid output. + Fixed bug where color wasn't correctly applied to anchor elements. + Fixed bug where float option in the style plugin dialog wouldn't be handled correctly on WebKit. + Fixed bug where the tinymce.dom.TreeWalker prev function wouldn't walk the DOM correctly. + Fixed bug where mceInsertContent command could produce empty block elements after the inserted content. + Fixed bug where mceInsertContent command wouldn't apply visual aids on tables and similar elements. + Fixed bug where empty block elements would get double br bogus elements in them. + Fixed bug where the color menu wouldn't apply the color correctly on IE when the viewport was to small. + Fixed bug where right clicking out side the body element of the editor iframe would prevent paste from working on IE. + Fixed bug where the onContextMenu event wouldn't fire correctly on IE if you clicked out side the body element. + Fixed bug where the onContextMenu event wouldn't fire correctly on modern Opera versions that now support it by default. + Fixed bug where legacy content wasn't converted correctly when inserted using mceInsertContent or through the source dialog. + Fixed bug where resizing images or tables wouldn't update the style attribute correctly or leave data-mce prefixed attributes. + Fixed bug where adding links wouldn't work correctly when using TinyMCE jQuery version with jQuery 1.5. + Fixed bug where single quotes inside param elements wasn't treated correctly by the media plugin. + Fixed bug where pasting plain text in WebKit wouldn't work correctly. It will now auto detect the WebKit bug and use plain text mode. + Fixed bug where the DomParser would fail to move out invalid elements within invalid elements on complex contents. + Fixed bug where paste as plain text would not decode html entities properly. + Fixed bug where large paragraphs would cause incorrect scrolling behavior if you would split them using enter. + Fixed bug where the SaxParser wouldn't properly parse some specific short ended elements. + Fixed so mceReplaceContent supports caret position and makes sure that the contents inserted gets validated. + Fixed so unnecessary traling br elements in blocks gets removed on Gecko/WebKit when using mceInsertContent command. + Moved some plugin css contents into the skin content css files to reduce the number of http requests. + Moved some plugin specific images into the theme img directory since they can then be shared. +Version 3.4b2 (2011-01-13) + Added new custom flash player, this player supports mp4 and flv and has skin support. + Fixed so mceInsertContent handles context correctly to enforce valid nesting of elements. + Fixed bug where scrolling would become jerky on IE on some contents. + Fixed bug where paste as plain text would throw exception of missing entities setting. + Fixed bug where anchor nodes where removed by the new serializer engine. + Fixed bug where IE would crash if when backspace where used on some specific contents. + Fixed bug where pasting of plain text in WebKit would result in merging of text lines. + Fixed bug where it wasn't possible to delete images or tables using backspace on IE9. + Fixed bug where urls in styles would generate a JS error due to incorrect scope. + Fixed bug where copy paste from Java applications would produce extra contents in FF on Mac. + Fixed bug where the verify_html option wouldn't allow all elements and attributes. +Version 3.4b1 (2010-12-20) + Added new serialization engine that increases performance and enforces valid output according to the specified schema settings. + Added new HTML parser logic used by the serialization engine and can handle malformed html contents. + Added new valid_children config option, enables more fine grain control of elements can be inside other elements. + Added new entities encoding logic boost performance and will only encode entities based on context i.e. attributes/text nodes. + Added new protect setting that enables users to protect template items from being removed by the serializer logic. + Added new {$caret} marker for the mceInsertContent command. Makes it possible to move the caret to a specific position when inserting contents. + Added new validation of anchor names. Only valid W3C names will be accepted. + Replaced the internal _mce_ prefixed attributes to the more standard HTML5 data-mce- prefix. This will also resolve future browser santiaztion issues. + Fixed bug where the paste plugin wouldn't convert Word lists with more than 9 items to real ol lists. Patch contributed by Mike (yogaboy). + Fixed bug where clicking on a format title would produce errors if the current selection didn't have any formats. + Fixed bug where paste of simple texts wouldn't work correctly in Gecko using the paste plugin since it keeps block formatting. + Fixed bug where confirm dialogs didn't display correctly due to resent IE9 fixes. + Fixed bug where spaces in URLs wouldn't be properly encoded to %20 if the user entered them in the link dialogs. Patch contributed by Ephox. + Fixed bug where the image alignment buttons wouldn't reposition the resize handles on FF due to a browser issue. Patch contributed by Ephox. + Fixed bug where the compareBoundaryPoints method of the IE Range class didn't work correctly. Patch contributed by Ephox. + Fixed bug where selection of elements using double click wouldn't select the clicked element but rather the parent node on FF. Patch contributed by Ephox. + Fixed bug where IE would scroll the user to the current selection causing parent document to scroll as well. Patch contributed by Ephox. + Fixed bug where style compression would incorrectly compress items with different values. It now only compresses if the values are the same. Patch contributed by Ephox. + Fixed bug where FF would add non breaking spaces outside TD elements if formatting was applied to table cells. Patch contributed by Ephox. + Fixed bug where the caret position would be lost on WebKit browsers if you pasted images multiple times. Patch contributed by Ephox. + Fixed bug where non word contents like * would be counted as words in the wordcount pluging. Patch contributed by David Balatero. + Fixed bug where the toggle absolute button in the layer plugin wouldn't remove the existing internal style attribute first. + Fixed bug where the autosave plugin would generate an exception on IE if the user had disabled userdata persistence. + Fixed bug where the paste plugin would remove dashed classes on IE since the regexps didn't include that character. + Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance. + Fixed bug where applying block formats to empty elements wouldn't render correctly on IE. + Fixed bug where the searchreplace plugin would add a f or r character when shortcuts where used on IE while using default dialogs. + Fixed bug where Opera wouldn't load scripts correctly since the onreadystate would fire even though the script wasn't loaded. + Fixed issue where   wouldn't be handled correctly in the bbcode plugin if entity_encoding was set to raw. + Fixed issue where contents would flicker since the content css files where asynchronously loaded. + Fixed bug where WebKit wouldn't create links on images with a float style. +Version 3.3.9.3 (2010-12-20) + Fixed issue where WebKit wouldn't correctly apply ins/del in xhtmlxtras plugin. + Fixed bug where paste as plaintext on WebKit wouldn't produce br and p elements correctly. + Fixed bug where the confirm dialog texts would be incorrectly placed due to recent IE 9 workarounds in the window.css. + Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance. +Version 3.3.9.2 (2010-09-29) + Fixed bug where placing the caret in IE 9 beta 1 would not work correctly if you clicked out side the document body element. + Fixed bug where IE 9 beta 1 wouldn't resize the editor correctly since the events didn't fire as previous versions did. + Fixed bug where FF would produce an error message when being rendered inside a hidden div element. + Fixed bug where resize logic could produce a cookie with a width/height less than the size of the container. + Fixed bug where content_css wouldn't populate the styles dropdown correctly. +Version 3.3.9.1 (2010-09-23) + Fixed bug where WebKit browsers wouldn't activate the image button when images where selected. + Fixed bug where Opera Presto 10.60 deletes elements when restoring bookmarks. + Fixed bug where IE9 beta1 doesn't handle regexp replacement values correctly. + Fixed bug where IE9 beta1 didn't render the inline dialogs correctly due to a bug with CSS clip. + Fixed bug where IE9 beta1 would produce error messages on load since they removed the document.recalc method. + Fixed bug where IE9 beta1 would produce since they haven't implemented document.implementation.createDocument correctly. + Fixed bug where IE9 beta1 would searchreplace doesn't work since their native DOM Range doesn't have a find method. + Fixed bug where IE9 beta1 would render the source view incorrectly due to incorrect viewport size measurements. + Fixed bug where IE9 beta1 would crash when running the basic functionality unit tests. + Fixed bug where IE9 beta1 would wrap elements in blocks correctly due to changes to the selection object. + Fixed bug where IE9 beta1 would fail to insert contents since they havn't implemented the createContextualFragment method in their DOM Range. + Fixed bug where IE9 beta1 would fail to handle image selection since they currently doesn't support control selections in their DOM Range. + Fixed bug where IE9 beta1 would fail to load scripts since they fire the onload event before the scripts are parsed and executed. +Version 3.3.9 (2010-09-08) + Fixed bug where inserting table rows into a table with subtable would produce an incorrect column count. + Fixed bug where the selection of cells in a table with subtables could produce invalid selections. + Fixed bug where the table plugin would produce a script error if you tried to move the caret before a first child table. + Fixed bug where the keep_styles feature on IE would move the caret to an incorrect location at the end of list blocks. + Fixed so attributes from legacy elements such as font gets retained when they get converted to spans. + Fixed minor issue where the select boxes wouldn't be set the not set by default in the table dialog. +Version 3.3.8 (2010-06-30) + On IE8+ and FireFox 3.5+, dragging an image now correctly adds an undo + event. + Fixed bug where WebKit would not move the caret to a correct position after a paste operation. + Fixed bug where WebKit would produce a div wrapper element when pasting some contents. + Fixed bug where the visual chars and nonbreaking plugin wouldn't show nbsp elements correctly. + Fixed bug where the format states would be enabled even after the format was removed. + Fixed bug where the delete key would move the caret to an incorrect position. + Fixed bug where it wasn't possible to toggle of the current font size/family/style by clicking the title item. + Fixed bug where the abbr element wouldn't get serialized correctly on IE6. + Fixed so that the examples checks if they are executed from the local file system since that might not work properly. +Version 3.3.7 (2010-06-10) + Fixed bug where context menu would produce an error on IE if you right clicked twice and left clicked once. + Fixed bug where resizing of the window on WebKit browsers in fullscreen mode wouldn't position the statusbar correctly. + Fixed bug where IE would produce an error if the editor was empty and you where undoing to that initial level. + Fixed bug where setting the table background on gecko would produce \" entities inside the url style property. + Fixed bug where the button states wouldn't be updated correctly on IE if you placed the caret inside the new element. + Fixed bug where undo levels wasn't properly added after applying styles or font sizes. + Fixed bug where IE would throw an error if you used "select all" on empty elements and applied formatting to that. + Fixed bug where IE could select one extra character when you did a bookmark call on a caret location. + Fixed bug where IE could produce a script error on delete since it would sometimes produce an invalid DOM. + Fixed bug where IE would return the wrong start element if the whole element was selected. + Fixed bug where formatting states wasn't updated on IE if you pressed enter at the end of a block with formatting. + Fixed bug where submenus for the context menu wasn't removed correctly when the editor was destroyed. + Fixed bug where Gecko could select the wrong element after applying format to multiple elements. + Fixed bug where Gecko would delete parts of the previous element if the selection range was a element selection. + Fixed bug where Gecko would not merge paragraph elements correctly if they contained br elements. + Fixed bug where the cleanup button could produce span artifacts if you pressed it twice in a row. + Fixed bug where the fullpage plugin header/footer would be have it's header reseted to it's initial state on undo. + Fixed bug where an empty paragraph would be collapsed if you performed a cleanup while having the caret inside it. + Fixed a few memory leaks on IE especially with drop menus in listboxes and the spellchecker. + Fixed so formats applied to the current caret gets merged to reduce the number of output elements. + Added the latest version of Sizzle for the CSS selector logic to fix a compatibility issue with prototype. +Version 3.3.6 (2010-05-20) + Fixed bug where a editor.focus call could produce errors on IE in very specific scenarios. + Fixed bug where Gecko would produce an error if you unformatted text inside an empty element. + Fixed bug where IE would produce an error if the caret was placed before a table and you used the align buttons. + Fixed bug where the font size drop down didn't display the a preview correctly. + Fixed bug where the paste plugin wouldn't include all contents some times on WebKit browsers. + Fixed bug where the plain text mode toggle wouldn't work properly on WebKit. + Fixed bug where the editors statusbar would become invisible when you resized the window in fullscreen mode. +Version 3.3.5.1 (2010-05-07) + Fixed a critical bug with the fullscreen plugin. Produced error messages when the state was toggled on/off. +Version 3.3.5 (2010-05-06) + Added new merge_with_parents option to formats, enables the control of removal of elements with similar parents. + Fixed so the default behavior for applying classes isn't a toggle state but the old behavior from before the 3.3 release. + Fixed bug where selecting contents using double click on Gecko would produce errors when using removing format. + Fixed bug where the IE DOM could get messed up when non valid contents was pasted into the editor. + Fixed bug where merging selected table cells using the context menu didn't work as expected. + Fixed bug where some nestled formatting would be applied incorrectly. + Fixed bug with enter in list items when using the force_br_newlines mode on WebKit patch contributed by Ryan Koopmans. + Fixed bug where undo/redo could produce js errors on some specific operations. + Fixed bug where the theme_advanced_font_sizes didn't work as before 3.3 when complex settings where used. + Fixed bug where the table plugin would copy cell/row id attributes when making new rows/cells. +Version 3.3.4 (2010-04-27) + Fixed bug where fullscreen plugin would add two editor instances to EditorManager collection. + Fixed bug where it was difficult to enter text on non western languages such as Japanese on IE. + Fixed bug where removing contents from nodes could result in an exception when using undo/redo. + Fixed bug with selection of images inside layers or other resizable containers on IE. + Fixed so editors isn't initialized on iPhone/iPad devices since they don't have caret support. +Version 3.3.3 (2010-04-19) + Added new script_loaded callback function setting for the jQuery plugin. + Added various fixes and new rpc methods for the spellchecker plugin. Patch contributed by Michael Peters. + Removed some unnecessary inline style information from some of the dialogs. + Fixed some issues with the chaining for the TinyMCE jQuery plugin. + Fixed so any extra arguments passed to patched jQuery functions gets passed through. Patch contributed by Lee Henson. + Fixed so spellchecking/contextmenu can be toggled on/off if the browser has native spellchecker support. + Fixed bug where some texts in the new paste plugin wasn't placed in language pack. + Fixed bug where IE would produce an incorrect information message when cutting. + Fixed bug where removing items using the xhtmlxtras plugin wouldn't work correctly. + Fixed bug where setting table background images would add extra quotes on Gecko. + Fixed bug where shortcut for bold/italic/underline wouldn't work properly on WebKit. + Fixed bug where IE would produce an error message if only contents was an image tag and bold was used. + Fixed bug where the caret would move if alignment was applied to empty block elements. + Fixed bug where some shortcut key commands wouldn't apply formatting correctly. +Version 3.3.2 (2010-03-25) + Fixed bug where it was possible to scale the editor iframe smaller than the editor UI. + Fixed bug where some of the resizing option didn't work with the new live resize. + Fixed bug where the format listbox didn't show nestled formats correctly. + Fixed bug where the native listboxes didn't work correctly. + Fixed bug where font size selection in using the legacyoutput plugin would produce errors. + Fixed so block and blockquote formats remove their matching element regardless of it's attributes. +Version 3.3.1 (2010-03-18) + Added new live resize feature, the editor contents is now visible while resizing. + Fixed bug where some valid_element patterns would produce an unknown property error. + Fixed bug where it wasn't possible to toggle off blockquotes. + Fixed bug where an undo level wasn't produced when applying formatting using the styles dropdown. + Fixed bug where IE 6/7 wouldn't perform caret formatting due to a focus/event bug in IE. + Fixed bug where undo/redo wasn't restoring the previous selection correctly. + Fixed bug where the caret would become invisible if you resized the editor in latest Gecko. + Fixed bug where the class attribute wasn't completely removed in IE 6/7 when the removeClass function was used. + Fixed so the matchNode method of the Formatter class returns the matched format rule. + Fixed so it's possible to apply formatting to both blocks and as inline elements. +Version 3.3 (2010-03-10) + Fixed bug where backspace on a table on IE would produce an empty tbody and some JS exceptions. + Fixed bug where some redundant children wasn't removed properly when applying inline styles to them. + Fixed bug where Chrome would produce incorect dialog sizes if the inlinepopups plugin wasn't used. + Fixed bug where spans with different classes would get merged if they where siblings to each other. + Fixed bug where IE 8 would crash if you used the spellchecker. + Fixed bug where Input Method for non western languages didn't work correctly. + Fixed bug where the UI would render incorrectly in FF 3.6 on Mac due to a bug n their rendering engine. + Fixed bug where WebKit wouldn't scroll down correctly if Shift+Enter was used. Patch contributed by Thomas Andersen. +Version 3.3rc1 (2010-02-23) + Fixed bug with new legacyoutput plugin not working correctly on it's own. + Fixed bug some performance issues with removing text formats. + Fixed bug where TinyMCE specific attributes wasn't removed properly by remove format. + Fixed bug where it wasn't possible to align images within inline elements. + Fixed bug where Ctrl+Delete/Backspace would produce an invalid argument exception on IE. + Fixed bug where the search/replace logic could produce an infinite loop on IE for reverse searches. + Fixed bug where cloning formats in cells didn't work properly on IE. + Fixed bug where IE6 would produce a horizontal scroll bar. + Fixed so remove jQuery method removes the TinyMCE instance as well as the specified textarea. + Fixed so selected rows and cells gets updated using the row/cell properties dialogs. +Version 3.3b2 (2010-02-04) + Fixed bug where sometimes img elements would be removed by split method in DOMUtils. + Fixed bug where merging of span elements could occur on bookmark nodes. + Fixed bug where classes wasn't properly removed when removeformat was used on IE 6. + Fixed bug where multiple calls to an tinyMCE.init with mode set to exact could produce the same unique ID. + Fixed bug with the IE selection implementation when it was feeded an document range. + Fixed bug where block elements formatting wasn't properly removed by removeformat on all browsers. + Fixed bug where selection location was lost if you performed a manual cleanup. + Fixed bug where removeformat wouldn't remove span elements within styled block elements. + Fixed bug where an error would be thrown if you clicked on the separator lines in menus. + Fixed bug with the jQuery plugin adding always adding a querystring value to other resources. + Fixed bug where IE would produce an error message if you had an empty editor instance. + Fixed bug where Shift+Enter didn't produce br elements on WebKit browsers. + Fixed bug where a temporary marker element wasn't removed by the paste plugin. + Fixed bug where inserting a table would produce two undo levels instead of one. +Version 3.3b1 (2010-01-25) + Added new text formatting engine. Fixes a lot of browser quirks and adds new possibilities. + Added new advlist plugin that enables you to set the formats of list elements. + Added new paste plugin logic that enables you to retain style information from Office. + Added new autosave plugin logic that automatically saves contents in local storage. + Added new valid_styles option. Adds the possibility to restrict styles and their order. + Added new theme_advanced_runtime_fontsize option to display the runtime font size in font size select box. + Added new jquery plugin version that handles the gzip compressor amongst other things. Contributed by Speednet. + Added new $ function to tinymce namespace and editor instances for the jQuery build. + Added the possibility to get editors by index as well as name in the tinyMCE.editors collection. + Fixed so the contents inside the editor renders in standards mode by default. + Fixed bug where it wasn't possible to move the caret on short documents running in standards mode on IE. + Fixed bug where the decode method of the DOMUtils class could end up in an endless loop. + Fixed bug where it was possible to bypass the paste cleanup on non IE browsers if you clicked while pasting. + Fixed bug where some attributes wasn't serialized correctly on IE if wildcard attribute patters where used. + Fixed bug where entity decoding was performed on strings that didn't have any valid entities in them. + Fixed bugs with the insertNode method of the IE DOMRange implementation. Patch contributed by Scott McNaught. + Rewrote the getBookmark/moveToBookmark selection logic to boost performance on larger documents. + Rewrote the table plugin to include new cell selection logic and fixed various bugs and issues. + Merged the tinyMCE, tinymce and tinymce.EditorManager into the same instance makes more sense. + Removed browser setting since the browser support for TinyMCE is not far better than it was when that setting was introduced. + Changed the mce_ attribute prefix to the more standard _mce_ prefix. This is similar to browser vendors prefixes. + Optimized performance with named entities on Gecko. Regexp replace was executing very slowly probably due to a Gecko bug. + Optimized performance of the IE specific selection/range implementation. + Removed the safari plugin since we now replaced all text formatting logic to custom code. +Version 3.2.7 (2009-09-22) + Fixed bug where uppercase paragraphs could still produce an invalid DOM tree on IE. + Fixed bug where split command didn't work on WebKit since the node serializer needs a real document to work with. + Fixed bug where it was impossible in Gecko to place the caret before a table if it was the first one. + Fixed bug where linking to urls like ../../ would produce an extra traling slash ../..//. + Fixed bug where the template cdate functionality was using an old 2.x API call. Patch contributed by vectorjohn. + Fixed bug where urls to the same site but different protocol would be converted when relative_urls where set to false. Patch contributed by Ted Rust. + Fixed bug where the paste plugin would remove mceItem prefixed classes. + Fixed bug where the paste plugin would sometimes add items in a reverse order on WebKit. + Fixed bug where the paste buttons would present an error message on Gecko even if you changed user.js. Patch contributed by Todd (teeaykay). + Fixed bug where Opera would crash if you had tables incorrectly placed inside paragraphs. + Fixed bug where styles elements wasn't properly processed if you had bad input HTML. + Fixed bug where style attributes wasn't properly forced into a specific format. + Fixed bug and issues with boolean attributes like checked, nowrap etc. + Fixed bug where input elements could override attributes on form elements. + Fixed bug where script or style elements could get modified by the DOMUtils processHTML method. + Fixed bug where the selected attribute could get lost when force root blocks logic got executed on IE. Patch contributed by Attila Mezei-Horvati. + Fixed bug where getAttribs method didn't handle boolean attributes correctly on IE. + Fixed so the paste from word dialog is presented if you paste content on an IE with to restrictive security settings. + Fixed so the paste_strip_class_attributes option is set to none by default in the paste plugin. + Removed default border=0 on tables for the default value of valid_elements. +Version 3.2.6 (2009-08-19) + Added new wordcount plugin, this will display the number of typed words as you write. Contributed by Andrew Ozz. + Added new getNext and getPrev methods to DOM utils. These will return the first matching sibling. + Fixed bug where it was impossible to place the caret after a table on Gecko. It will now add a paragraph after tables. + Fixed bug where inline dialogs would fail if used in a window opened using a showModalDialog. Patch contributed by Derek Britt. + Fixed bug where IE could sometimes render a unknown runtime error on invalid input HTML. + Fixed bug where some incorrectly placed tables wouldn't be moved outside the paragraphs on IE. + Fixed bug where uppercase script/style element wouldn't be handled correctly and converted to valid lowercase. + Fixed bug where some WebKit versions on Mac OS X would produce issues with hidden select fields. + Fixed bug where the media plugin would fail on WebKit since the node wasn't properly imported to the right document. + Fixed bug where absolute URLs for the TinyMCE script using a base href element would cause loading problems in IE 6/7. + Fixed bug where pasting using the paste plugin wasn't possible on IE with to restrictive security settings. + Fixed bug where pasting of whitespace was impossible using the new custom paste method. + Fixed bug where pasting on some WebKit browsers would not work if you pasted specific contents due to a WebKit bug. + Fixed bug where doctypes with multiple lines would not be parsed correctly by the fullpage plugin. Patch contributed by Colin. + Fixed bug where the autoresize plugin would break the fullscreen functionality. + Fixed bug where tables would be chopped up running on IE using invalid contents and pasting paragraphs into a cell. + Fixed bug where the each method of jQuery build didn't iterate styleSheets. We now use the TinyMCE API one instead. + Fixed bug where auto switching to paragraphs after headers some times failed in Gecko. + Fixed so all editor options gets passed to the Serializer class. Patch contributed by Jasper Mattsson. + Fixed so script/style blocks isn't wrapped in paragraphs as other inline elements. + Fixed so the XHR requests sends the X-Requested-With HTTP header. + Fixed so the data url scheme is handled in the tinymce.util.URI class. + Changed inline documentation to use moxiedoc style comments. + Removed the compat2x plugin people should have upgraded to the 3.x API by now. 3.0 was released more then a year ago. + Re-added Gecko specific message for users who doesn't understand the security concept regarding paste. +Version 3.2.5 (2009-06-29) + Added new jQuery plugin for the jQuery specific package. This enables you to more easily load and use TinyMCE. + Added new autoresize plugin contributed by Peter Dekkers. This plugin will auto resize the editor to the size of the contents. + Fixed so all packages have the same directory structure. Previous releases had a different structure for the production package. + Fixed so the paste from word dialog forces the contents to be processed as word contents even if it's not. + Fixed so the jQuery build adapter build works. It's currently only excluding Sizzle. + Fixed so noscript element contents is retained during the editing process. + Fixed bug where the getBookmark method would need a "simple" string input when the documented way is a boolean. + Fixed bug where invalid contents could break the fix_table_elements logic. + Fixed bug where Sizzle specific attributes would be serialized if the valid_elements was set to *[*]. + Fixed bug where IE would produce an error if you specified a relative content_css and opened the paste dialog. + Fixed bug where pasting images on IE would produce broken images if they came from an external site. + Fixed bug where memory was leaked if you add/remove controls dynamically. Some event handlers wasn't removed properly. + Fixed bug where domain relaxing wasn't treated correctly if you added it after the TinyMCE script element. + Fixed bug where the activeEditor wasn't set to null if the last editor instance was removed. + Fixed bug where IE was leaking memory on the onbeforeunload event due to some recently introduced logic. Patch contributed by Options. + Fixed bug where inserting tables in Safari 4 didn't work due to a new WebKit bug where some element names are reserved. + Fixed bug where URLs having a :// value in the query string would make it absolute regardless of URL settings. + Fixed the WebKit specific bug where DOM Ranges would fail if the node wasn't attached to something in a different way. + Removed the auto_resize option and the resizeToContent method from the tinymce.Editor class. Use the new autoresize plugin instead. +Version 3.2.4.1 (2009-05-25) + Fixed bug where Gecko browsers would produce an extra space after for example strong when loaded from sub domains. + Fixed bug where script elements would be removed if they where placed inside a paragraph element. + Fixed bug where IE 8 would produce 1 item remaining when loading CSS files dynamically with an empty cache. + Fixed bug where bound events would be removed from other editor instances if a specific one was removed. + Fixed various bugs and issues with script and style elements inside the editor. + Fixed so all script contents gets wrapped in CDATA sections so that they can be parsed using a XML parser. + Fixed so it's impossible for elements marked as closed to have child nodes rendered in output. +Version 3.2.4 (2009-05-21) + Added new paste_remove_styles/paste_remove_styles_if_webkit option to paste plugin concept contributed by Hadrien Gardeur. + Added new functionality to paste plugin contributed by Scott Eade aka monkeybrain. + Added new paste_block_drop option to the paste plugin this is disabled by default and will block any drag/drop event. + Added new bind/unbind methods to DOMUtils these works like Event.add/Event.remove but is easier to access. + Added new paste_dialog_width/paste_dialog_height options to paste pluign. Enables you to change the dialog sizes. + Fixed bug on IE 8 where it would sometimes produce a "1 item remaining" status message that would never finish. + Fixed bug on Safari 4 beta that would produce DOM Range exceptions on the DOMUtils split method since the browser has a bug. + Fixed bug where the paste plugin could accidentally think that some word sentences was supposed to be list elements. + Fixed bug where paste plugin would produce one extra empty undo level on some browsers. + Fixed bug where spans wasn't produced correctly on new line when the keep_styles option was enabled. + Fixed bug where the caret would be placed at the beginning of contents in IE 8 if you selected colors from the color pickers. + Fixed so the Event class is a normal class instead of a static one. The tinymce.dom.Event is now a global instance of that class. + Fixed so internal events for instances gets removed when the DOMUtils instance is removed. + Fixed so preventDefault and stopPropagation methods can be used on the event object in all browsers. +Version 3.2.3.1 (2009-05-05) + Fixed bug where paragraphs containing form elements such as input or textarea would be removed. + Fixed bug where some IE versions would produce a wrapper function for events attributes. + Fixed bug where table cell contents could be removed if you pressed return/enter at the end of the cell contents. + Fixed bug where the paste plugin would remove a extra character if the selection range was collapsed. + Fixed bug where creating tables with % width wouldn't be handled correctly on WebKit browsers. +Version 3.2.3 (2009-04-23) + Added new paste plugin logic. This new version will autodetect Word contents and clean it up. + Added a optional root element argument to getPos so you can tell it where to stop the calculation. + Added new DOM ready logic to remove the usage of document.write. We now use basically the same method as jQuery. + Fixed bug where WebKit browsers would fail when selecting all contents in the area using Ctrl+A. + Fixed bug where IE would produce paragraphs with empty inline style elements. + Fixed bug where WebKit browsers would fail when inserting tables with a non pixel width. + Fixed bug where block elements could get a redundant br element at the end of the element. + Fixed bug where the tabfocus plugin only worked with a single editor instance on page. + Fixed bug where IE 8 was loosing caret position if the selection was collapsed and a menu was clicked. + Fixed bug with application/xhtml+xml mode where menus wasn't working properly. + Fixed bug where the onstop workaround fix for IE would produce errors in an ASP update panel. + Fixed bug where the submit function override could produce errors if executed in the wrong scope. + Fixed bug where the area element wasn't closed by a short ending. + Fixed various number issues in the style plugins properties dialog. Contributed by datpaulchen. + Fixed issues with size suffix values in the style plugin dialog. + Fixed issue where hasDuplicate variable would leak out to the global space due to a bug in the Sizzle engine. + Fixed issue where the paste event would fire a dialog warning on IE since we extracted the text contents. + Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported. +Version 3.2.2.3 (2009-03-26) + Fixed regression bug with the getPos method, it would return invalid if the view port was to small. +Version 3.2.2.2 (2009-03-25) + Fixed so the DOMUtils getPos method can be used cross documents if needed. + Fixed bug where undo/redo wasn't working correctly in Gecko browsers. +Version 3.2.2.1 (2009-03-19) + Added support for tel: URL prefixes. Even though this doesn't match any official RFC. + Fixed so the select method of the Selection class selects the first best suitable contents. + Fixed bug where the regexps for www. prefixes for link and advlink dialogs would match wwwX. + Fixed bug where the preview dialog would fail to open if the content_css wasn't defined. Patch contributed by David Bildstrm (ChronoZ). + Fixed bug where editors wasn't converted in application/xhtml+xml mode due to an issue with Sizzle. + Fixed bug where alignment would fail if multiple lines where selected. + Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported. +Version 3.2.2 (2009-03-05) + Added new CSS selector engine. Sizzle the same one that jQuery and other libraries are using. + Added new is and getParents methods to the DOMUtils class. These use the new Sizzle engine to select elements. + Added new removeformat_selector option, enables you to specify a CSS selector pattern of elements to remove when using removeformat. + Fixed so the getParent method can take CSS expressions when selecting it's parents. + Added new ant based build process, includes a new javabased preprocessor and a yuicompressor ant task. + Moved the tab_focus logic into a plugin called tabfocus, so the old tab_focus option has been removed from the core. + Replaced the TinyMCE custom unit testing framework with Qunit and rewrote all tests to match the new logic. + Moved the examples/testcases to a root directory called tests since it now includes slickspeed. + Fixed bug where nbsp wasn't replaced correctly in ForceBlocks.js. Patch contributed by thorn. + Fixed bug where an dom exception would be thrown in Gecko when the theme_advanced_path path was set to false under xml application mode. + Fixed bug where it was impossible to get out of a link at the end of a block element in Gecko. + Fixed bug where the latest WebKit nightly would fail when changing font size and font family. + Fixed bug where the latest WebKit nightly would fail when opening dialogs due to changes to the arguments object. + Fixed bug where paragraphs wasn't added to elements positioned absolute using classes. + Fixed bug where font size values with dot's like 1.4em would produce a class instead of the style value. + Fixed bug where IE 8 would return an incorrect position for elements. + Fixed bug where IE 8 would render colorpicker/filepicker icons incorrectly. + Fixed bug where trailing slashes for directories in URLs would be removed. + Fixed bug where autostart and other boolean values in the media dialog wouldn't be stored/parsed correctly. + Fixed bug where the repaint call for the media plugin wouldn't be executed due to a typo in the source. + Fixed bug where id attribute of object elements wasn't kept intact by the media plugin. + Fixed bug where preview of embeded elements when the media_use_script option was used would fail. + Fixed bug where inlinepopups could be rendered at an incorrect location on IE 6 while dragging. + Fixed bug where the blocker shim could be placed at an incorrect location on IE 6. + Fixed bug where the multiple and size attributes of select elements would produce incorrect values while running in IE. + Fixed bug where IE would loose the caret position is you selected a color from the color drop down. + Fixed bug where remove format wouldn't work on IE since it couldn't remove span elements that had style information. + Fixed bug where Opera was removing links when removing formatting from selected contents. + Fixed bug where paragraphs could be produced inside non positional elements styled with the CSS position value of static. + Fixed bug where removeformat wouldn't work if you selected part of a span in IE. + Fixed bug where media plugin didn't retain the style attribute on embed/object elements. + Fixed bug where auto focus on empty editor instances could produce strange results if you inserted an image into it. + Fixed bug where   characters would be removed in FF when inserted with the mceInsertContent or selection.setContent methods. + Fixed bug where warning message of missing paste support wasn't displayed on WebKit browsers. + Fixed bug where anchor links could include other links. The selected range is now unlinked before adding news links to it. + Fixed memory leak when TinyMCE was used with prototype. Patch contributed by James Ots. + Fixed so the non documented fullpage_hide_in_source_view option for the fullpage plugin works again in the 3.x branch. + Fixed so tables doesn't get inserted into paragraphs by default since it's not W3C valid. Can be disabled by using the fix_table_elements option. + Fixed so the source view dialog sets a source_view state to the event object. Enables plugins to intercept the source view mode. + Fixed various validation issues with the html dialogs and pages. + Removed ask mode option since there is way better ways of doing this now. Use the add/remove control methods instead. + Removed logic for compatibility with Safari 2.x, this browser is no longer supported since no one is using it. + Removed the auto domain relaxing feature. If loading scripts cross sub domains it's better to specify the document.domain by hand. +Version 3.2.1.1 (2008-11-27) + Added new theme_advanced_default_background_color/theme_advanced_default_foreground_color options. Patch contributed by David Bildstrm (ChronoZ). + Fixed font style formatting compatibility issue with Adobe Air. + Fixed so legacy font elements get converted into spans even if cleanup_on_startup isn't enabled. + Fixed bug where pre elements could be incorrectly modified by an IE bug workaround. Patch contributed by hu vime. + Fixed bug where input elements inside inlinepopups wasn't editable in Firefox 2. + Fixed bug where the xhtmlxtras plugin wasn't replacing attribute values correctly. + Fixed bug where menu buttons in skin variants would look strange due to IE 8 fixes. + Fixed bug where WebKit browsers would on backspace take you back to the previous page if the editor was empty. + Fixed bug where DOMUtils decode method wouldn't handle strings larger than 4096kb due to node chunking. + Fixed bug where meta key wasn't handled as ctrl key on Mac OS X for custom keyboard short cuts. + Fixed bug where init event would get fired twice on WebKit on Mac OS X. +Version 3.2.1 (2008-11-04) + Added support for custom icon image for drop menus. Use icon_src to set a custom image directly. + Added new media_strict option to media plugin. Enables you to control if the flash embed is strict or not. Enabled by default. + Fixed so the editors script files gets dynamically loaded without using XHR or eval. + Fixed so the media plugin outputs valid XHTML object elements for Flash movies. Can be disabled with the media_strict option. + Fixed so dynamic loading doesn't require eval calls on non IE browsers for better Air support. + Fixed bug where the editor wasn't treated as empty if the remaining paragraph had attributes. + Fixed bug where id's of elements was removed ones they got wrapped in paragraphs. Patch contributed by ChronoZ. + Fixed bug where WebKit browsers where placing list elements inside paragraph elements. + Fixed bug where inserting images or links would produce absolute urls on WebKit browsers. + Fixed bug where values for checked, readonly, disabled and selected attributes was incorrect on IE. + Fixed bug where positive values for checked, readonly, disabled and selected attributes wasn't forced to valid values. + Fixed bug where selecting the first option in a native select box would produce an undefined error. + Fixed bug where tabindex 32768 could be outputted on IE if element attributes where cloned. + Fixed bug where the media dialogs preview window would display incorrect contents due to duplicate clsid prefixes. + Fixed bug where non pixel or percent heights for textarea elements would produce errors on IE. + Fixed bug where cdata sections in script elements wasn't handled correctly. + Fixed bug where nowrap of table cells would produce a 65535 value output. + Fixed bug where media plugin would produce an error if you selected the first item in the items list. + Fixed bug where media plugin would modify links with the item _value in them. + Fixed so table width/height is better forced if inline_styles is enabled. Patch contributed by daKmoR. + Fixed css for IE 8 such as opacity and other rendering quirks. +Version 3.2.0.2 (2008-10-02) + Fixed bug where the SelectBox and NativeSelectBox wasn't updated correctly if undefined was passed to them. + Fixed bug where the style dropdown wasn't correctly changed back to it's original state when element had no class. + Fixed bug where multiple pending font styles wasn't handled correctly. + Fixed so you can disable all auto css loading for dialogs by setting the popups_css option to false. +Version 3.2.0.1 (2008-09-17) + Fixed bug where font sizes and faces wouldn't be changed correctly when there was a parent with a different style. + Fixed bug where adding fonts to the same selection would produce redundant spans. +Version 3.2 (2008-09-11) + Added new text style support, it will now use span elements internally instead of font elements. + Added new improved support for the theme_advanced_font_sizes option, check the Wiki for details. + Added new keep_style setting that maintains the text style on return/enter on non IE browsers, enabled by default. + Added new onBeforeSetContent/onBeforeGetContent/onSetContent/onGetContent events to the Selection class. + Added new selectByIndex method to ListBox class. This enables you to select list items by an index instead of a value. + Added new possibility to the select method of the ListBox class. This can now have a selector function as it's value argument. + Added new possibility to skip the loading of popups css by setting the feature popup_css to the value false. + Added new possibility to skip translation of popups by setting the translate_i18n feature to false. + Added new element_format option enables you to produce HTML element endings instead of XHTML. But we are still in the XHTML is better camp. + Added missing allowfullscreen and quality options for flash elements, this will now get correctly stored. + Fixed bug where table cell dialog didn't close properly unless the accessibility_warnings option was set to false. + Fixed bug where the modal dialog blocker element for inlinepopups wasn't placed at a correct location if the page had scroll. + Fixed bug where non inline dialogs didn't close correctly if the inlinepopups plugin was used. + Fixed bug where non inline dialogs could make the modal dialog blocker to work incorrectly. + Fixed bug where style select wasn't populated correctly if you pressed the arrow. Patch by Hari Karam Singh. + Fixed bug where toggling the fullscreen mode didn't restore scrollbars on IE when the editor was inside a frame. Patch by Jacob Barrett. + Fixed bug where inserting flash contents using the template plugin didn't work correctly. + Fixed bug where inserting flash contents using the selection.setContent or mceInsertContent command didn't work correctly. + Fixed bug where IE would produce an exception if a comment started with -. + Fixed bug where the blockquote button would wrap lists incorrectly on non IE browsers. + Fixed bug where Opera would display BR elements in the element path. + Fixed bug where xhtmlxtras didn't insert elements correctly on IE. + Fixed bug where the buttons wasn't activated correctly in the xhtmlxtras plugin. + Fixed bug where adding an object as the style attribute for the dom setAttribs method wouldn't work. + Fixed bug where the background color would bleed out to parent container element in Gecko. + Fixed bug where the insert column actions for tables would fail if you did it in a thead or tfoot. Patch contributed by T Andersen (tan73). + Fixed bug where event blocker element wasn't positioned correctly for the inlinepopups plugin. + Fixed bug where pasting from Office 2007 would produce an odd comment in the contents. + Fixed bug where the paste as plain text could remove an extra character. Patch contributed by Speednet. + Fixed bug where some characters where missing for the paste_replace_list option. Patch contributed by Speednet. + Fixed bug where removing non existing editor instances by the mceRemoveControl command would produce an error. + Fixed bug where meta elements with the name description would produce errors in IE. + Fixed bug where color and background colors wouldn't be updated properly. + Fixed bug where the createMenuButton of tinymce.ControlManager didn't implement the last class argument. + Fixed bug where the editor_css option was relative from the TinyMCE installation directory not the current page. + Fixed bug where elements wouldn't be padded if the element contained bogus br elements. For example TD elements. + Fixed bug where parsing of in fullpage plugin would produce an error. + Fixed bug where relative urls with just ./ would become an empty string. + Fixed bug where outdent button would be disabled if inline_styles where set to false. + Fixed bug where replace with an empty search string would produce an error on IE. + Fixed bug where restoring the overflow state of the body in fullscreen plugin running on IE would produce vertical scrollbars. + Fixed bug where pressing return/enter in list items would sometimes move the caret the to top of the content area in FF. + Fixed bug where the style listbox wouldn't be updated correctly if you used the use_native_selects option. + Fixed bug where WebKit browsers would produce a div element when ending list elements using return. + Fixed so translation of popup contents only occurs if it's needed. + Optimized the URI object in regards or converting absolute URIs to relative URIs. +Version 3.1.1 (2008-08-18) + Added new getSize method to DOMUtils it will return the dimensions only of an element. + Added new alert/confirm methods to the tinyMCEPopup class to prevent focus problems and also to shorten method calls. + Added new plugin_preview_inline option to preview plugin to enable/disable native/inline dialogs. + Added new readonly option. If this is set the editor will only display the contents for the user. + Added missing tabindex and accesskey to input elements in the default valid_elements setup. + Updated firebug lite to 1.2, to enable it use the tiny_mce_dev.js?debug=1 on the development package. + Fixed so the preview dialog in the preview plugin uses inline dialogs/popups. + Fixed so CDATA sections remains intact through the serialization process of the DOM tree. + Fixed various issues with the getAttrib command. It will now return more correct values. + Fixed bug where the embed element wasn't properly parsed in the media plugin it now supports 3 formats. + Fixed bug where the noshade attribute was serialized incorrectly on IE. + Fixed bug where editing an existing link element didn't force it relative. + Fixed bug where image link creation fails on Safari if the image is aligned. + Fixed bug where it was possible to scroll the fullscreen mode in Opera 9.50. + Fixed bug where removal of center image alignment would fail. Patch contributed by Andrew Ozz. + Fixed bug where inlinedialogs didn't work properly if the doctype was incorrect in IE. + Fixed bug where cross domain loading didn't work correctly in Opera 9.50. + Fixed bug where breaking huge text blocks with return/enter key would scroll to end of block. + Fixed bug where replace button kept inserting the replacement text even if there is no more matches. + Fixed bug with fullpage plugin where value wasn't set correctly. Patch contributed by Pascal Chantelois. + Fixed bug where the dom utils setAttrib method call could produce an exception if the input was null/false. + Fixed bug where pressing backspace would sometimes remove one extra character in Gecko browsers. + Fixed bug where the native confirm/alert boxes would move focus to parent document if fired in dialogs. + Fixed bug where Opera 9.50 was telling you that the selection is collapsed even when it isn't. + Fixed bug where mceInsertContent would break up existing elements in Opera and Gecko. + Fixed bug where TinyMCE fails to detect some keyboard combos on Mac, contributed by MattyRob. + Fixed bug where replace all didn't move the caret to beginning of text before searching. + Fixed bug where the oninit callback wasn't executed correctly when the strict_loading_mode option was used, thanks goes to Nicholas Oxhoej. + Fixed bug where a access denied exception was thrown if some other script specified document.domain before loading TinyMCE. + Fixed so setting language to empty string will skip language loading if translations are made by some backend. + Fixed so dialog_type is automatically modal if you use the inlinepopups plugin use dialog_type : "window" to re-enable the old behavior. +Version 3.1.0.1 (2008-06-18) + Fixed bug where the Opera line break fix didn't work correctly on Mac OS X and Unix. + Fixed bug where IE was producing the default value the maxlength attribute of input elements. +Version 3.1.0 (2008-06-17) + Fixed bug where the paste as text didn't work correctly it encoded produced paragraphs and br elements. + Fixed bug where embed element in XHTML style didn't work correctly in the media plugin. + Fixed bug where style elements was forced empty in IE. The will now be wrapped in a comment just like script elements. + Fixed bug where some script elements wrapped in CDATA could fail to be serialized correctly. + Fixed bug where FF 3 produced -moz- internal styles in some style attributes. + Fixed bug where query strings and external URLs didn't work correctly in style attributes. + Fixed bug where shape attribute of area elements got serialized as rect regardless of it's initial value in IE 6. + Fixed bug where selection of elements inside layers would fail in IE since focus was moved to the document body. + Fixed bug where pressing enter/return in an editable select box would produce an __mce_add_custom__ class value. + Fixed bug where changing font size of text placed inside a colored text chunk would remove the parent node. + Fixed bug where Opera 9.5 final produced a strange line break behavior due to a workaround for previous Opera versions. + Fixed bug where text/background color would produce a strange focus problem when you tried to click on the body in IE. + Fixed issue where selecting the title of an listbox equals the old 2.x behavior of changing the value to an empty string. + Fixed issue where it was common for the media plugin to break if the _value attribute wasn't added for the param element. + Fixed issue where the wrong parent editor instance might be updated if you use fullscreen mode in an incorrect way. + Fixed issue where Safari was producing a warning about the base element not being closed correctly. + Removed redundant form element name matching from regexp in the DOMUtils class. +Version 3.0.9 (2008-06-02) + Added new contextmenu_offset_x/contextmenu_offset_y options for the contextmenu plugin. + Added cite attribute to the default rule for the blockquote element. + Added support for using arrow keys for selection of items in listboxes. + Added support for using arrow keys for selection of items in dropmenus. + Fixed bug where blockformat change on elements with BR inside them didn't change correctly on Firefox. + Fixed bug where removing table rows inside thead or tfoot would remove the whole table if it was the last one. + Fixed bug where XHR synchronous mode didn't execute the callback handlers synchronously. + Fixed bug where setting border to 0 didn't add border: 0 to the style attribute when using the advimage dialog. + Fixed bug where the selection of images and table cells didn't work correctly when the editor is placed in a frame and running on IE. + Fixed bug where the store/restore of a selection didn't work correctly in non IE browsers. + Fixed bug where only the first element would be invalid for the invalid_elements option. + Fixed bug where paste as plain text didn't encode the characters correctly when they where inserted. + Fixed bug where HTML source window couldn't be maximized on Gecko when the maximizable feature was enabled. + Fixed bug where color selection using the color picker could produce exception in IE. + Fixed bug where font size changes could produce produce extra redundant elements. + Fixed bug where IE could produce unknown runtime error if you replaced a image with another image from a separate frame. + Fixed bug where the domLoaded state for the Event class wasn't set correctly if the editor was loaded dynamically using the gzip compressor. + Fixed bug where handling of the base element for a page would produce incorrect urls. Based on a patch contributed by John LeSueur. + Fixed bug where table constraint alert boxes was presented with an empty value and wasn't the skinned inline ones. + Fixed bug where the onChange event wasn't fired when the form was submitted. It's now also triggered when the save method is called. + Fixed bug where encoding set to xml didn't work as expected. It now encodes the contents into XML entities. + Fixed bug where numrows didn't work correctly for the merge cells dialog of the table plugin. + Fixed bug where the onGetContent event was fired even when the no_events flag was set. + Fixed bug where the preview panels for the advimage and the media plugin could overflow on Safari and FF 3. + Fixed bug where the editing and removal of abbr elements using the xhtmlxtras plugin working correctly on IE. + Fixed bug where save button in the save plugin didn't work correctly on IE. + Fixed bug where dragging layers didn't work as expected since it would snap back to it's original location if you saved. + Fixed bug where the description of the template plugin dialog wasn't updated correctly. + Fixed bug where the values for frame and rules in the table dialogs where swapped. + Fixed bug where the elements like ins, del, cite, acronym and abbr didn't have the default editing style as the old 2.x branch. + Fixed bug where ask mode would lock the focused textarea if you pressed cancel in the confirm dialog on FF 3. + Fixed bug where ask mode would produce contents for empty textareas if you reloaded the page. + Fixed so the onGetContent event gets the full pass through object just like the other events. + Fixed so attributes for block elements remains the same when you change format of a element. +Version 3.0.8 (2008-04-30) + Fixed bug where IE would produce an error if textareas without names where converted. + Fixed bug where editor wasn't forced empty when there was only a single br or empty paragraph left. + Fixed bug where IE would produce an warning message if object elements where produced in the media plugins preview running on https. + Fixed bug where new addVer function didn't handle hash items correctly. Patch contributed by Mirek Burkon. + Fixed bug where font_size_style_values option wasn't applied correctly to fonts inside the editor. + Fixed bug where image selection could be lost if a image was edited using context menu on IE. + Fixed bug where style values wasn't updated properly due to an invalid regexp. + Fixed bug where IE 6 where displaying warning message about insecure items when inserting an image while using https. Patch contributed by Norifumi Sunaoka. + Fixed bug where IE was producing an auto save message if you selected a color from the color split button. + Fixed bug where backspace sometimes would move the caret to the end of the previous block in Gecko. + Fixed bug where the rowlayout manager didn't work as described in the documentation. + Fixed bug where the default options for the fullpage plugin wasn't applied correctly. + Fixed bug where selection would jump one character if you applied a styles to a words in non IE browsers. + Fixed bug where undo levels wasn't added correctly if you went back in undo history and added a new event. + Fixed bug where font size dropdown didn't mark the selected size in IE. + Fixed bug where the size of the editor was determined using clientWidth instead of offsetWidth. + Fixed so the onchange event doesn't fire on the initial undo level, it will also fire when the editor is blurred. + Fixed so the advhr plugin produces XHTML valid output instead of non standard attributes. + Fixed so blockquote gets converted into [quote] in when the bbcode plugin is enabled. + Fixed so theme_advanced_font_sizes can be named for example Font 1=1, Font 2=2 etc. + Fixed so editor_selector/editor_deselector can be regexps. By default only strings are allowed not part regexps like before. + Fixed so that the version suffix is optional. It still requires the build process so you need to export it manually. + Fixed so it's possible to tab to table cells in non Gecko browsers and also produce new rows if you tab at the end of a table. Contributed by Josh Peek. +Version 3.0.7 (2008-04-14) + Added new version suffix to all internal GET requests to make sure that the users cache gets cleared correctly. + Fixed issue with isDirty returning true event if it wasn't dirty on IE due to changes in tables during initialization. + Fixed memory leak in IE where if a page was unloaded before all images on the page was loaded it would leak. + Fixed bug in IE where underline and strikethrough could produce an exception error message. + Fixed bug where inserting paragraphs in totally empty table cells would produce odd effects. + Fixed bug where layer style data wasn't updated correctly due to some performance enhancements with the DOM serializer. + Fixed bug where it would convert the wrong element if there was two elements with the same name and id on the page. + Fixed bug where it was possible to add style information to the body element using the style plugin. + Fixed bug where Gecko would add an extra undo level some times due to the blur event. + Fixed bug where the underline icon would get active if the caret was inside a link element. + Fixed bug where merging th cells not working correctly. Patch contributed by Andr R. + Fixed bug where forecolorpicker and backcolorpicker buttons where rendered incorrectly when the o2k7 skin was used. + Fixed bug where comment couldn't contain -- since it's invalid markup. It will now at least not break on those invalid comments. + Fixed bug where apos wasn't handled correctly in IE. It will now convert apos to ' on IE since that browser doesn't support that entity. + Fixed bug where entities wasn't encoded correctly inside pre elements since they where protected from whitespace removal. + Fixed bug where color split buttons where rendered incorrectly on IE6 when using the non default theme. + Fixed so caret is placed after links ones they are created, to improve usability of the editor. + Fixed so you can select tables by clicking on it's borders in non IE browsers to normalize the behavior. + Fixed so the menus can be toggled by clicking once more on the icon in listboxes, menubuttons and splitbuttons based on code contributed by Josh Peek. + Fixed so buttons can be labeled, currently only works with the default skin, so it's kind of experimental. Patch contributed by Daniel Insley. + Fixed so forecolorpicker and backcolorpicker remembers the last selected color. Patch contributed by Shane Tomlinson. + Fixed so that you can only execute the mceAddEditor command once for the same instance name. + Fixed so command functions added with addCommand can pass though the call to default handles if it returns true. +Version 3.0.6.2 (2008-04-07) + Fixed bug where empty tables couldn't be edited correctly on non IE browsers if they where loaded into the editor. + Fixed bug where it was impossible to resize layers correctly in IE since it thought it was an image. + Fixed bug where an editor instance was stealing focus in IE resulting in a scroll to the editor on page reloads. + Fixed bug where Safari was crashing on Mac OS X if you closed dialogs using the Esc key. +Version 3.0.6.1 (2008-04-04) + Added support for the missing mceAddFrameControl command. The input for this command has changed so consult the Wiki. + Fixed bug where sub menus for the drop menus would leave an empty element behind. + Fixed memory leak in IE if the editor was placed in a frame or iframe. +Version 3.0.6 (2008-04-03) + Added elements to the default value of valid_elements option. It now contains all XHTML strict elements and a few transitional. + Added more accessibility fixes, it's now possible to navigate and close list boxes and split button menus with the keyboard. + Added missing getInfo method to the contextmenu and safari plugin, this caused problems for the Drupal module. + Added new inlinepopups_zindex option to the inlinepopups plugin so that you can configure the default start z-index. + Added new setControlType method to the tinymce.ControlManager class. This method enables you to override the default classes. + Added ability to specific an optional control class to use instead of the default one for the ControlManager methods. Based on concept by Josh Peek. + Fixed bug where attribute rules for the DOM Serializer couldn't contain - or _ characters in their names. + Fixed bug where inlinepopups event blocker and modal dialog blocker elements produced vertical scrollbars. + Fixed bug where there was a rendering issue with quirks mode in Safari moving the resize handle to an incorrect position. + Fixed bug with forecolor/backcolor controls on IE. Sometimes elements positioned relative will generate display errors. + Fixed bug where a p2 was leaking out in the global name space when you selected a color from the forecolor/backcolor controls. + Fixed bug where empty paragraphs didn't work as expected in browsers other than IE. + Fixed bug where the load method of the tinymce.dom.ScriptLoader didn't check if the file was already loaded. + Fixed bug where the load method for the PluginManager and ThemeManager didn't check if a plugin/theme by a specific name was all ready loaded. + Fixed bug where the theme_advanced_link_targets option didn't work correctly with the advanced themes link dialog. Patch contributed by Arnold B. + Fixed bug where the style command would merge classes into empty span elements. + Fixed bug where the style command would remove empty span elements outside the current selection. + Fixed bug where the fix for the Safari backspace bug removed all editor contents if it was filled with empty paragraphs. + Fixed bug where alert and confirm boxes opened by the inlinepopups plugin would produce an exception if domain relaxing was used. + Fixed bug where Safari was adding style attributes to all elements when you paste them into the editor. + Fixed bug where the spellchecker menus was visually incorrect since the space for the non existing icon was still there. + Fixed bug where remove_linebreaks option didn't remove line breaks inside the text contents of a element. + Fixed bug where Safari 3.1 was introducing _mc_tmp into paragraphs due to the new querySelectorAll and a TinyMCE specific workaround. + Fixed bug where getParam method in the Editor class was returning incorrect objects and would mess up the font drop down. Patch contributed by speednet. + Fixed bug where the table dialog would produce an exception in IE when you edited tables since it tried to place focus in a disabled field. + Fixed bug where class attribute on some span elements was removed on cleanup. + Fixed bug where resizing the editor in IE could produce an exception if the editor width/height got to be a negative value. + Fixed bug where wmv files wouldn't play since the src param was used instead of the url param. + Fixed bug where br elements would be added here and there in Gecko. Geckos internal _moz_dirty br elements where serialized as well. + Fixed bug where editing named anchors would produce two anchors instead of one updated one. + Fixed bug where arrow and function keys didn't work when an noneditable element was focused within the editor. + Fixed bug where the dispatcher could produce an exception if the listener list was altered inside an event callback. + Fixed bug where it was impossible to totally empty the editor contents on Safari due to an mistreatment of nbsp as whitespace. Patch contributed by Andrew Ozz. + Fixed bug where TinyMCE would not convert textareas with the same name attribute value. It will now generate an unique id for those textareas. + Fixed bug where backspace/delete key was deleting td elements inside tables while running on Gecko. + Fixed bug where Firefox 3.0b4 and Opera 9.26 where scrolling to the top of document when pressing return/enter. + Fixed bug where the template plugin wasn't just inserting the mceTmpl tagged element. + Fixed bug where the alert method of the default WindowManager implementation didn't translate input language strings like the inlinepopups dialog does. + Fixed bugs with the backspace behavior in Gecko. The caret was placed on incorrect locations in the DOM sometimes. + Fixed so advimage dialog and table dialogs has support for editable select boxes for the class value. + Fixed so the media, pagebreak and spellchecker doesn't load it's default content.css file if the content_css option is set to false. + Fixed so the paste_use_dialog option works again it's enabled by default but can be disabled on IE. Patch contributed by Speednet. + Fixed so that the fullscreen editor is focused when switching fullscreen editing on. + Fixed so it's possible to edit images and links inside tables using the context menu. + Fixed so table dialogs and the advanced image dialog doesn't loose selection in IE if the dialogs where navigated/submitted with the keyboard. + Fixed so the theme_advanced_blockformats options can have named items for example title 1=h1;title 2=h2. + Fixed so it's possible to add a custom editor_css for the simple theme. + Fixed quirks with directionality rtl, patch contributed by Andrew Ozz. + Fixed so the inlinepopups default start zIndex is 300000. + Fixed typo in media plugin Shockware is now replaced with Shockwave. + Fixed psuedo memory leak in IE with the replaceChild method inside the DOMUtils.replace method. + Fixed so memory is released when an editor instance is removed from page. + Optimized the color split button menus so that they use less event handlers. + Removed the util/mclayer.js file since it's no longer used by any of the TinyMCE dialogs and is considered deprecated. +Version 3.0.5 (2008-03-12) + Added new black skin variant to the o2k7 skin contributed by Stefan Moonen. + Added new explode method to the tinymce core class. This does a split but removed whitespace it also defaults to a , delimiter. + Added new detection logic for IE 8 standards mode into the DOMUtils class strMode can now be checked to see if that mode is on/off. + Added new noscale option value for the scale select box for Flash in the media plugin. + Fixed bug where the menu for the ColorSplitButton wasn't removed when the editor was removed. + Fixed bug where font colors couldn't be edited correctly since the style of the element didn't get updated correctly. + Fixed bug where class of elements would get lost when TinyMCE was fixing incorrect HTML markup. + Fixed bug where table editing would produce double height values. + Fixed bug where width style value wouldn't be removed if you switched width unit from cm/em to pixels or percent. + Fixed bug where the search/replace input box wasn't auto focused like the other dialogs. + Fixed bug where the old mceAddControl command would use the fullscreen settings next time it created an instance. + Fixed bug where multiple lines where added to the target cell if you merged multiple empty cells. + Fixed bug where drop down menus would be incorrectly positioned inside scrollable divs. + Fixed bug where the separators of the silver skin variant didn't display correctly in IE 6. + Fixed bug where createStyleSheet seems to load scripts at opposite order in some IE versions. + Fixed bug where directionality could produce odd results for the UI and the dialogs. + Fixed bug where the DOM serializer wouldn't serialize custom namespaced attributes in IE 6 using the *[*] valid elements rule. + Fixed bug where table caption would be inserted after the thead element if you swapped a tr to be inside the thead. + Fixed bug where the youtube detection logic for the media plugin was to generic. + Fixed so the deprecated and undocumented theme_advanced_path_location set to none won't hide the whole statusbar. + Fixed so most input lists can have whitespace in them they are now split using the new tinymce.explode method. + Fixed so the popup_css and popup_css_add URLs are relative to where the current document is located. + Fixed various bugs and quirks with the store/restore selection logic. + Fixed so the editor starts in IE 8 standards mode but still that browser is very very buggy. + Fixed so dialog_type set to modal will block the background and other inline windows and only give access to the front most window. +Version 3.0.4.1 (2008-03-08) + Fixed critical bug where it was impossible to edit images when inlinepopups where used due to lost selection in IE. +Version 3.0.4 (2008-03-07) + Added new option constrain_menus, this enables you to force view port constraints on all menus. Contributed by Shane Tomlinson. + Fixed bug where table background wasn't visible inside the editor due to a default CSS rule overriding the style attribute. + Fixed bug where links would get a null class added if no styles was used in IE. + Fixed bug where spellchecker was auto focusing the editor in IE. + Fixed bug where document.domain would produce invalid argument if the editor was loaded in IE6 over a network UNC path. + Fixed bug where table height attribute was used, this is deprecated in XHTML so it now adds it as an style. + Fixed bug where textareas with style values would produce error in IE. + Fixed so the first element in each dialog is focused by default to enhance keyboard usage. + Fixed so you can add a mceFocus class to elements to make it auto focused. + Fixed so you can close dialogs using the esc key. + Fixed so you can press return/enter to submit the action of each dialog. + Fixed so tabbing inside an inline popups wont focus the resize anchor elements. + Fixed so you can press ok in inline alert messages using the return/enter key. + Fixed so textareas can be set to non px or % sizes for example em, cm, pt etc. + Fixed so non pixel values can be used in width/height properties for tables. + Fixed so the custom context menu can be disabled by holding down ctrl key while clicking. + Fixed so the layout for the o2k7 skin looks better if you don't have separators before and after list boxes. + Fixed so the sub classes get a copy of the super class constructor function to ease up type checking. + Fixed so font sizes for the format block previews are normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden). + Fixed so font sizes for h1-h6 in the default content.css is normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden). +Version 3.0.3 (2008-03-03) + Fixed bug where an error about document.domain would be thrown if TinyMCE was loaded using a different port. + Fixed bug where mode exact would convert textareas without id or name if the elements option was omitted. + Fixed bug where the caret could be placed at an incorrect location when backspace was used in Gecko. + Fixed bug where local file:// URLs where converted into absolute domain URLs. + Fixed bug where an error was produced if a editor was removed inside an editor command. + Fixed bug where force_p_newlines didn't effect the paste plugin correctly. + Fixed bug where the paste plugin was producing an exception on IE if you pasted contents with middots. + Fixed bug where delete key could produce exceptions in Gecko sometimes due to the fix for the table cell bug. + Fixed bug where the layer plugin would produce an visual add class called mceVisualAid this one is now renamed to mceItemVisualAid to mark it internal. + Fixed bug where TinyMCE wouldn't initialize properly if ActiveX controls was disabled in IE. + Fixed bug where tables and other elements that had visual aids on them would produce an extra space after any custom class names. + Fixed bug where search with an empty string would produce some odd "invalid pointer" error in IE. + Fixed bug where elements like menus where placed at incorrect positions in Opera 9.26. + Fixed bug where IE was loosing focus of the editor when you clicked some dropmenu and if it was placed in a frame or iframe. + Fixed bug where focus of images could be lost in IE if you focused the accessibility confirm dialog in the advimage plugin. + Fixed bug where nestled font elements would produce odd output like missing font elements. + Fixed bug where text colors and styles got removed if invalid_elements included the font element. + Fixed bug where text-decoration set to underline or line-through would remove other styles from span elements. + Fixed bug where editor contents like \n\n would be incorrectly handled and processed as real line feeds. + Fixed bug where incorrectly encoded urls with ampersands in them would be decoded incorrectly. + Optimized the DOMUtils decode method to be a lot faster if the string doesn't have any entities to decode. +Version 3.0.2.1 (2008-02-26) + Fixed alert/confirm dialogs so they display correctly. +Version 3.0.2 (2008-02-26) + Added new body_id option that enables you to specify the id of the body inside the editor iframe based on ideas by David Bildstrm (ChronoZ). + Added new body_class option that enables you to set the class for the body of the editor iframe based on ideas by David Bildstrm (ChronoZ). + Added new CSS class to the default content.css files mceForceColors that forces white background and black text can be used with the body_class option. + Added new type parameter to the Editor.getParam function to reduce redundant logic for parsing hash tables. + Added new isDone method to the ScriptLoaded class, this enables you to check if a script has been loaded or not. + Added new resizeTo and resizeBy methods for the advanced theme. Can be called using tinyMCE.activeEditor.theme.resizeTo(w, h); + Added new skin_variant option this can be used to extend existing skins with slight modifications like color. + Added new variant of the o2k7 skin called "silver" based on a contribution made by Stefan Moonen. + Fixed bug where the template plugin might produce errors if the template_mdate_classes wasn't configured. + Fixed bug where the media plugin didn't convert the URLs for movies once they where inserted. + Fixed bug where the style field for the advlink dialog didn't work correctly if you edited an existing link. + Fixed bug where alignment of toolbars would fail in editor was uses in a quirks mode on IE, fix contributed by Peter Wood & Art Lawry. + Fixed bug where initialization of multiple editors at the same time using the mceAddControl method would produce errors. + Fixed bug where initialization of editors using mceAddControl command or new tinymce.Editor calls would fail during page load. + Fixed bug where the check for domain relaxing could fail if the document.domain property was changed by another script. + Fixed bug where textareas couldn't be named description or any other name that matches the meta elements in IE and Opera. + Fixed bug where the element path would fail sometimes in IE due to "unknown runtime error" on innerHTML. + Fixed bug where Safari would crash if you was hiding the editor before serializing the contents. + Fixed bug where the editor wasn't scaled propertly in fullscreen mode using the old fullscreen_new_window option. + Fixed bug where render method didn't load language packs in IE and Opera if you rendered an editor during page load. + Fixed bug where resizing the browser window in fullscreen didn't resize the editor. + Fixed bug where the blockquote command didn't move the caret inside the new empty blockquote if you used it on an empty document. + Fixed bug where auto in a style width/height for the textarea would produce an editor with the size value of 100. Fix contributed by Shane Tomlinson. + Fixed bug where restoration of selection at the beginning of an element could fail in Gecko. + Fixed bug where caret restoration after a cleanup could place the it at an incorrect location. + Fixed bug where delete key inside td elements would delete the cell in Gecko. + Fixed so the blockquote button toggles individual lines. This behavior is a bit more like the old indentation behavior in the 2.x branch. + Fixed so the dialog language packs only gets loaded the first time you open a dialog. + Fixed so all classes in the whole UI is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins. + Fixed so all classes in the inlinepopups logic is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins. + Fixed so that the window in fullscreen mode can be resized when fullscreen_new_window option is enabled. + Fixed so blockquote elements are formatted in the source output with an linefeed before and after it. + Optimized the editor initialization by reducing the number of calls to getBookmark/moveToBookmark. +Version 3.0.1 (2008-02-21) + Added spellchecker plugin into the main package, but without any backend can be specified with the spellchecker_rpc_url option. + Added src attribute for script elements to the default valid_elements option value. + Added extra parameter to the class_filter callback it can now also filter out classes based on the whole CSS rule. + Added support for domain relaxing, TinyMCE can now be loaded from an remote domain as long as they are on the same root domain. + Added support for custom elements the new custom_elements option enables you to add non HTML elements to the editor. + Added support for the W3C Selectors API that was added to latest nightly build of WebKit. + Fixed bug where some object param element wasn't stored correctly using the media plugin. + Fixed bug where Opera was scrolling to top of page is drop menus on list boxes where displayed. + Fixed bug where IE6 was crashing if a format block was used on a container with anchor elements. + Fixed bug where spans with font sizes wasn't handled correctly when editor was loading contents. + Fixed bug where mode exact couldn't convert editors with name only. Id is no longer required but recommended. + Fixed bug where the mceInsertRawHTML command produced an extra undo level. + Fixed bug where the specific_textareas mode didn't work correctly this is the same thing as textareas now. + Fixed bug where the values of input elements in the HTML page of dialogs pages where changed in IE. + Fixed bug where fullscreen and fullpage plugins didn't work well together. + Fixed bug where embed elements wasn't handled properly in the media plugin. + Fixed bug where style information on span elements gets munged when fonts are converted to spans. + Fixed bug where some entities in element attributes where encoded incorrectly in the latest WebKit build. + Fixed bug where initialization would fail in IE if there where two input elements with the name submit in the form. + Fixed bug where fullscreen mode didn't work correctly in IE when the fullscreen_new_window option was used. + Fixed bug where invalid contents like an ul inside a p element would produce odd results in IE. + Fixed bug where Opera 9.2x was placing the drop menus at incorrect locations if the editor was placed in a table. + Fixed bug where Opera was producing odd results if enter/return was pressed while having forced_root_blocks disabled. + Fixed bug where layer plugin was stealing focus in IE on initialization. + Fixed bug where body attributes wasn't set properly in the fullpage plugin, fix contributed by Hiroaki Kawai. + Fixed bug where insert image and insert link dialogs where producing an extra level in the undo history. + Fixed bug where Gecko would produce an error if empty elements like
                  where inserted using mceInsertContent. + Fixed bug where center alignment of images produced odd results inside table cells. + Fixed bug where center alignment of images couldn't be toggled correctly. + Fixed bug where alignment of images inside tables would produce double float style items in IE if the fix_table_elements option was enabled. + Fixed bug where a variable called 'v' was polluting the global namespace. Objects tinymce and tinyMCE are the only ones allowed to be global. + Fixed bug where insert table from context menu couldn't insert new tables inside existing tables. + Fixed bug where Safari wouldn't produce br elements on enter when the force_br_newlines option was enabled. + Fixed bug where switching cell type in table cell dialog would produce odd attributes in IE. + Fixed bug where Gecko was outputting internal attributes if valid_elements where set to "*[*]". + Fixed bug where the style plugin would produce non hex colors inside the dialog when running on Gecko. + Fixed bug where an empty src value for insert image would remove the currently selected image if it wasn't and image element. + Fixed bug where hidden input elements would break the logic for the tab_focus option. + Fixed bug where save button wasn't working correctly in fullscreen mode. + Fixed bug where the editor was forced to be placed in a form element if the save_onsavecallback option was used. + Fixed bug where upper case param attributes wasn't parsed correctly in the media plugin. + Fixed bug where render method of tinymce.Editor class would produce an exception if the strict_loading_mode option was omitted. + Fixed bug where nodeChanged event could be fired while the editor was loading and there for produce an exception in FF. + Fixed bug where no undo levels where added if the user created new table rows using the tab key on Gecko. + Fixed bug where tables would be broken if you selected a different block format for contents withing an table cell. + Fixed bug where the render method of the tinymce.Editor class didn't setup the tinymce.EditorManager.settings object correctly. + Fixed bug where the advanced image dialog would go to the first tab if the alternative image was changed using the file browser link. + Fixed bug where the forced_root_block option would produce BR elements inside empty blocks if the block wasn't a paragraph. + Fixed bug where the forced_root_block doesn't work correctly on IE if the specified element was something else than paragraphs. + Fixed bug where selection of images would get lost if user selected something from the context menu in IE. + Fixed bug where the context menu plugin would pollute the global namespace with two variables p1 and p2. + Fixed compatibility issue with Mootools, it is destroying document.getElementById on unload in IE. (Mantra: You don't own the internal objects). + Fixed bugs where dialogs/tabs and other UI elements where rendered incorrectly in Firefox 3. + Fixed so the auto CSS class importer is compatible with 2.x. + Fixed so the editor UI and inlinedialogs works correctly with the YUI CSS reset package. + Fixed so header and footer elements are forced to lower case when the fullpage plugin is used. + Fixed so load prefixes "-" for plugins and themes isn't required if the plugin/theme was loaded by the ThemeManager/PluginManager. + Fixed so the JSONRequest uses application/json content type to make Ruby on rails happy. + Fixed so the CSS rule is more exact for the body in the default content.css files. Body is now defined as "body.mceContentBody" instead of just "body". + Fixed so the tiny_mce_dev.js uses XHR instead of document.write to load scripts to resolve an issue with Opera 9.50. + Fixed so language pack loading can be disabled by setting the language option to false. Can be useful for systems with their own language pack management. +Version 3.0 (2008-01-30) + Added map and area elements to the default valid_elements list and also some indentation rules. + Fixed bug where empty paragraphs wasn't padded when loading contents. + Fixed bug where the RowLayout manager didn't work at all. + Fixed bug where style attribute data would get messed up in advimage dialog. + Fixed bug where the table dialogs class select wasn't updated correctly. + Fixed bug where elements would get extra whitespace around on insert when body was present in valid_elements. + Fixed bug where coords attribute of the area element wasn't handled properly in IE. + Fixed bug where Safari didn't produce BR elements on shift+return. + Fixed bug where force blocks would cast odd invalid attribute exception in IE. + Fixed bug where media plugin would produce extra whitespace before and after objects. + Fixed bug where cleanup_callback could break the contents of the editor. But use the new event system instead of this option. + Fixed bug where the tab_focus option didn't work between editor instanced. You can now tab between editors. + Fixed bug where the load function of the ScriptLoader class didn't load single files without the load que as it was supposed to. + Fixed bug where the execcommand_callback parameter order was incorrect. Recommendation use the new addCommand method. + Fixed bug where range.select calls sometimes failed on some IE versions. + Fixed bug where Safari was scrolling to top of document when enter/returned was pressed. + Fixed bug where fullscreen_new_window option didn't work correctly. + Fixed bug where the nonbreaking plugin inserted an space instead of an non breaking space the first time. + Fixed bug where the visualization of non breaking spaces where visual in element path. + Fixed so the focus is restored to the editor after inserting an custom character. + Fixed so the isNotDirty state is set to false if a new undo level is added. + Fixed so pointless style information for borders gets removed in IE. + Fixed so the resize button has a se-resize cursor css value. +Version 3.0rc2 (2008-01-18) + Added new fix_nesting option to fix bug #1867292, this is disabled by default. + Added new indentation option enables you to specify how much each indent/outdent call will add/remove. + Added easier support for enabling/disabling icon columns on drop menues. + Added new menu button control class. This control is very similar to the splitbutton but without any onclick action. + Added support for previous tab focus (shift+tab). The tab_focus setting now takes two items next and previous element. + Fixed bug where iframes inside the editor got removed in Firefox on initial load. + Fixed bug where the CSS for abbr elements wasn't applied correctly in IE. + Fixed bug where mceAddControl on element inside a hidden container produced errors. + Fixed bug where closed anchors like produced strange results. + Fixed bug where caret would jump to the top of the editor if enter was pressed a the end of a list. + Fixed bug where remove editor failed if the editor wasn't properly initialized. + Fixed bug where render call on for a non existing element produced exception. + Fixed bug where parent window was hidden when the color picker was used in a non inlinepopups setup. + Fixed bug where onchange event wasn't fired correctly on IE when color picker was used in dialogs. + Fixed bug where save plugin could not save contents if the converted element wasn't an textarea. + Fixed bug where events might be fired even after an editor instance was removed such as blur events. + Fixed bug where an exception about undefined undo levels could be throwed sometimes. + Fixed bug where the plugin_preview_pageurl option didn't work. + Fixed bug where adding/removing an editor instance very fast could produce problems. + Fixed bug where the link button was highlighted when an anchor element was selected. + Fixed bug where the selected contents where removed if a new anchor element was added. + Fixed bug where splitbuttons where rendered one pixel down in the default theme. + Fixed bug where some buttons where placed at incorrect positions in the o2k7 theme. + Fixed bug that made it impossible to visually disable a custom button that used an image instead of CSS sprites. + Fixed bug where it wasn't possible to press delete/backspace if the editor was added+removed and re-added due to a FF bug. + Fixed bug where an entities option with only 38,amp,60,lt,62,gt would fail in IE. + Fixed bug where innerHTML sometimes generated unknown runtime error on IE. + Fixed bug where content_css files wasn't loaded in the template preview iframe. + Fixed bug where scroll position was incorrect when toggling fullscreen mode. + Fixed bug where restoration of overflow didn't work correctly when disabling fullscreen mode in Opera. + Fixed bug where drop menus where places at incorrect locations if the editor was placed in a scrollable container element. + Fixed bug where hideMenu didn't hide sub menus correctly. It will now hide all menus recursively. + Fixed so theme_advanced_path_location can be used in init options for compatibility reasons. + Fixed so the drop menu colors matches the rest of o2k7 theme. + Fixed so the preview example.html file is updated to the new 3.x API. + Fixed so the margins are the same by default inside the editable area between IE and other browsers. + Fixed so editor contents gets stored before it the onSubmit event is fired. +Version 3.0rc1 (2008-01-08) + Added new classes for toolbar rows in advanced theme mceToolbarRow1..n enabled you to change appearance of individual rows. + Added auto detection for the strict_loading_mode option when running in application/xhtml+xml mode on Gecko. + Optimized the HTML serializer by bundling some post process methods together. + Fixed so that the toolbars have unique IDs, enables you to alter the toolbars using the ControlManager and the DOM. + Fixed bug where delta values for dialog sizes in language packs didn't work correctly due to missing string to number casting. + Fixed bug where paragraph generation logic didn't handle hr or table elements correctly if they where the only element. + Fixed bug where some elements got extra linebreaks added after or before it in HTML output. + Fixed bug where it was hard to modify existing style data on table rows and table cells. + Fixed bug where the dom.getRect method didn't handle non pixel values correctly. + Fixed bug where strikethrough and underline couldn't be toggled on existing span elements. + Fixed bug where the postprocessor searched for nsbp instead of nbsp entities. + Fixed bug where it was impossible to edit links that had child elements within them. + Fixed bug where it was possible to click on the parent item of a submenu. + Fixed bug where mouseover/mouseout images couldn't be removed in advimage dialog. + Fixed bug where drop menus didn't work when running in application/xhtml+xml mode. + Fixed bug where Opera added doctype to output in application/xhtml+xml mode. + Fixed bug where some DOM methods didn't work correctly in the application/xhtml+xml mode. + Fixed bug where the inlinepopups didn't work correctly in the application/xhtml+xml mode. + Fixed bug where the ColorSplitButton didn't display correctly in the application/xhtml+xml mode. + Fixed bug where the UI layout was incorrect on Gecko browsers when running in application/xhtml+xml mode. + Fixed bug where the word paste plugin produced exception while running in application/xhtml+xml mode. + Fixed bug where there wasn't any hidden input element generated for divs while running in application/xhtml+xml mode. + Fixed bug where indentation of script/style/pre elements where incorrect. + Fixed bug where script element contents was removed in IE. + Fixed bug where script element contents got entity encoded. + Fixed bug where you couldn't edit existing element styles using the styles plugin. + Fixed bug where styles wasn't updated properly sometimes due to an performance enhancement. + Fixed bug where font sizes couldn't be changed using the style plugin. + Fixed bug where an error was produced in Gecko browsers when switching back from fullscreen mode. + Fixed bug where Opera was producing br elements after elements like h3. + Fixed bug where TinyMCE couldn't be loaded on a page using - characters in it's URL. + Fixed bug where the editor container element was forced to have a specific name. + Fixed bug with force_br_newlines option on Firefox, even though it should never be used (Read FAQ). + Fixed bug where onclick event had an return true; prefix added when creating an popup. + Fixed bug where the theme_advanced_statusbar_location option couldn't handle the value "none". + Fixed issue with URLs with multiple at characters for example an Zope URI. + Fixed so simple and advanced themes doesn't collide. + Fixed so a elements gets removed when the href field is left empty, the href attribute is required in a link after all. + Fixed so img elements gets removed when the src field is left empty, the src attribute is required for all images after all. + Removed the indent and encode methods from the tinymce.dom.Serializer class due to performance enhancement and reduction of the API size. +Version 3.0b3 (2007-12-14) + Added new getElement method to Editor class, returns the element that was replaced with the editor instance. + Added new unavailable prefix for disabled controls for accessibility reasons. + Fixed bug where regexp patterns couldn't be used for the editor_selector/editor_deselector options. + Fixed bug where the DOM wasn't properly initialized before the onInit event was executed in popups. + Fixed bug where font sizes where reduced by font size actions on previous spans in Safari. + Fixed bug where HR elements got places at the wrong location in IE. + Fixed bug where align/justify didn't work correctly on multiple paragraphs. + Fixed bug with missing translation for cell scope settings. + Fixed bug where selection/caret position was lost on some table actions. + Fixed bug where editor instances couldn't be added to hidden div elements. + Fixed bug where list elements in Safari would get an odd ID attribute. + Fixed bug where IE would return when the editor was completely empty. + Fixed bug where accessibility title attribute for access keys wasn't setup properly. + Fixed bug where forecolorpicker and backcolorpicker control names wasn't working. + Fixed bug where inserting template content didn't work in Safari due to selection exception. + Fixed bug where absolute URLs to remote hosts couldn't be used for background images. + Fixed bug where mysterious span elements where produced in Safari when injecting HTML contents. + Fixed bug where the media plugin didn't work correctly on the latest Opera 9.24. + Fixed bug where indentation of HTML output wasn't applied to all block elements. + Fixed bug where Safari was production DOM exception if you pressed enter in an empty editor. + Fixed bug where media plugin didn't parse script tags correctly patch contributed by Mathieu Campagna. + Fixed bug where the drop menus of list boxes like blockformat could produce scrolling of the page. + Fixed bug where the drop menus where placed at an incorrect location if TinyMCE was placed in a scrollable div. + Fixed bug where submit buttons couldn't be named submit, it's not recommended to name submit buttons submit anyway. + Fixed bug where the stylelistbox produced an exception if there was only one class in the list box. + Fixed bug where the stylelistbox wasn't updated correctly when the current class was removed. + Fixed bug where the formatblock command sometimes removed the body element. + Fixed bug where fullscreen switching in IE sometimes produced an exception when the spellchecker plugin was enabled. + Fixed issue where FF produced an empty paragraph when the editor was completely empty. + Fixed issue with size of image dialog in the advanced theme. + Fixed issues with the bbcode plugin it now also handles spans and the [font] rule. + Fixed so the style compression feature is a bit smarter to resolve issues with Opera. + Reintroduced the remove_linebreaks option, this is enabled by default. +Version 3.0b2 (2007-11-29) + Added type and compact attributes to the default valid_elements list for the ul and ol elements. + Added missing accessibility support to native list boxes in both the toolbar and dialogs. + Added missing access key for the element path for accessibility reasons. + Fixed support for loading themes from external URLs. + Fixed bug where setOuterHTML didn't work correctly when multiple elements where passed to it. + Fixed bug with visualchars plugin was moving elements around in the DOM. + Fixed bug with DIV elements that got converted into editors on IE. + Fixed bug with paste plugin using the old event API. + Fixed bug where the spellchecker was removing the word when it was ignored. + Fixed bug where fullscreen wasn't working properly. + Fixed bug where the base href element and attribute was ignored. + Fixed bug where redo function didn't work in IE. + Fixed bug where content_css didn't work as previous 2.x branch. + Fixed bug where preview dialog was throwing errors if the content_css wasn't defined. + Fixed bug where the theme_advanced_path option didn't work like the 2.x branch. + Fixed bug where the theme_advanced_statusbar_location was called theme_advanced_status_location. + Fixed bug where the strict_loading_mode option didn't work if you created editors dynamically without using the EditorManager. + Fixed bug where some language values wasn't translated such as insert and update in dialogs. + Fixed bug where some image attributes wasn't stored correctly when inserting an image. + Fixed bug where fullscreen mode didn't restore scrollbars when disabled. + Fixed bug where there was no visual representation for tab focus in toolbars on IE. + Fixed bug where HR elements wasn't treated as block elements so forced_root_block would fail on these. + Fixed bug where autosave presented warning message even when the form was submitted normally. + Fixed typo of openBrower it's now openBrowser in form_utils.js. + Fixed various HTML problems like missing TD elements and duplicated doctypes. + Fixed default values for theme_advanced_resize_horizontal, theme_advanced_resizing_use_cookie to be 2.x compatible. + Moved spellchecker JS files into the development package. + Removed support for theme_advanced_path_location since the theme_advanced_statusbar_location is the correct option name. +Version 3.0b1 (2007-11-21) + Added new tab_focus option, that enables you to specify a element id or that the next element to be focused on tab key down. + Added new addQueryValueHandler method to the tinymce.Editor class. + Added new class_filter option, this enables you to specify a function that can filter out CSS classes for the styles list box. + Added support form [url=url]title[/url] to the bbcode plugin. + Renamed the addCommandQueryState method in the tinymce.Editor class to addQueryStateHandler. + Renamed loadQue to loadQueue, to correct spelling. + Removed the createDOM method from the window manager and replace it with a createInstance method. + Removed the add to beginning of class attribute parameter of the DOMUtils.addClass method. + Fixed bug with the forced_root_block option, didn't work correctly with multiple inline elements. + Fixed bug where image dialogs replaced the current image element with a new one even when it was updated. + Fixed bug where the submit trigger wasn't executed when divs where converted into editor instances. + Fixed bug where div elements that got converted into editors didn't get a hidden input element generated for them. + Fixed bug where the the media_use_script option for the media plugin wasn't working correctly. + Fixed bug where the font size and font family listboxes wasn't updated correctly on Safari. + Fixed bug where the height of the fieldset in default image dialog for the advanced theme was to small. + Fixed bug where the font sizes behaved incorrectly after a cleanup on Safari. + Fixed bug where formatblock didn't work correctly in Safari on some elements. + Fixed bug where template plugin didn't insert content correctly unless some options where specified. + Fixed bug where charmap on Safari produced scrollbars. + Fixed bug where there was white artifacts in some dialogs due to missing background color. + Fixed bug where port was added to all external URLs if the editor was loaded from a custom port. + Fixed bug where the context menus got duplicated on Safari 3.0.4 on Mac OS X. + Fixed bug where dialogs like paste from word was huge on Firefox. + Fixed bug with media plugin not working with windows media objects. + Fixed bug where a forever loop was created if multiple instances where submitted using form.submit. + Fixed bug with editing a table produce error in IE when inlinepopups where used. + Fixed bug where the style plugin generated ugly looking style information in IE. + Fixed bug where the inline dialogs that got opened while in fullscreen mode wasn't visible. + Fixed bug where it was difficult to place the caret inside the word paste dialog. + Fixed bug where Opera produced strange border in the word paste dialog. + Fixed bug where viewport constraints could move a inlinepopup to a negative x, y position if the viewport was to small. + Fixed bug where template plugin was producing an error due to a deprecated API call. + Fixed bug where drag drop of images failed in Gecko if a document_base_url was specified. + Fixed bug where Firefox 3 failed to apply block formats like H1-H6 it still breaks on DIVs this has been reported to bugzilla. + Fixed bug where IE was producing a warning dialog about non secure items when running TinyMCE over HTTPS. + Fixed bug where the onbeforeunload event was triggered when menus or dialogs where opened. + Fixed bug where the fullscreen mode of the HTML view source box threw an error. + Fixed bug where the mceFocus command didn't work correctly. + Fixed bug where the selection could get lost in IE using inlinepopups. + Fixed so the body of the editor area has the mceContentBody class just like the 2.x branch. + Fixed so the media icon gets active when a media element is selected. +Version 3.0a3 (2007-11-13) + Added new experimental jQuery and Prototype framework adapters to the development package. + Added new translation.html file for the development package. Helps with the internationalization of TinyMCE. + Added new setup callback option, use this callback to add events to TinyMCE. This method is recommended over the old callbacks. + Added new API documetation to all classes, functions, events, properties to the Wiki with examples etc. + Added new init method to all plugins and themes, since it's shorter to write and it mimics interface capable languages better. + Fixed various CSS issues in the default skin such as alignment of split buttons and separators. + Fixed issues with mod_security. It didn't like that a content type of text/javascript was forced in a XHR. + Fixed all events so that they now pass the sender object as it's first argument. + Fixed some DOM methods so they now can take an array as input. + Fixed so addButton and the methods of the ControlManager uses less arguments and it now uses a settings object instead. + Fixed various issues with the tinymce.util.URI class. + Fixed bug in IE and Safari and the on demand gzip loading feature. + Fixed bug with moving inline windows sometimes failed in IE6. + Fixed bug where save_callback function wasn't executed at all. + Fixed bug where inlinepopups produces scrollbars if windows where moved to the corners of the browser. + Fixed bug where view HTML source failed when inserting a embedded media object. + Fixed bug where the listbox menus didn't display correctly on IE6. + Fixed bug where undo level wasn't added when editor was blurred. + Fixed bug where spellchecker wasn't disabled when fullscreen mode was enabled. + Fixed bug where Firefox could crash some times when the user switched to fullscreen mode. + Fixed bug where tinymce.ui.DropMenu didn't remove all item data when an item was removed from the menu. + Fixed bug where anchor list in advlink dialog wasn't populated correctly in Safari. + Fixed bug where it wasn't possible to edit tables in IE when inlinepopups was enabled. + Fixed bug where it wasn't possible to change the table width of an existing table. + Fixed bug where xhtmlxtras like abbr didn't work correctly on IE. + Fixed bug where IE6 had some graphics rendering issues with the inlinepopups. + Fixed bug where inlinepopup windows where moved incorrectly when they were boundary checked for min width. + Fixed bug where textareas without id or name couldn't be converted into editor instances. + Fixed bug where TinyMCE was stealing element focus on IE. + Fixed bug where the getParam method didn't handle false values correctly. + Fixed bug where inlinepopups was clipped by other TinyMCE instances or relative elements in IE. + Fixed bug where the contextmenu was clipped by other TinyMCE instances or relative elements in IE. + Fixed bug where listbox menus was clipped by other TinyMCE instances or relative elements in IE. + Fixed bug where listboxes wasn't updated correctly when the a value wasn't found by select. + Fixed various CSS issues that produced odd rendering bugs in IE. + Fixed issues with tinymce.ui.DropMenu class, it required some optional settings to be specified. + Fixed so multiple blockquotes can be removed with a easier method than before. + Optimized some of the core API to boost performance. + Removed some functions from the core API that wasn't needed. +Version 3.0a2 (2007-11-02) + Fixed critical bug where IE generaded an error on a hasAttribute call in the serialization engine. + Fixed critical bug where some dialogs didn't open in the non dev package. + Fixed bug when using the theme_advanced_styles option. Error was thrown in some dialogs. + Fixed bug where the close buttons produced an error when native windows where used. + Fixed bug in default skin so that split buttons gets activated correctly. + Fixed so plugins can be loaded from external urls outsite the plugins directory. +Version 3.0a1 (2007-11-01) + Rewrote the core and most of the plugins and themes from scratch. + Added new and improved serialization engine, faster and more powerful. + Added new internal event system, things like editor.onClick.add(func). + Added new inlinepopups plugin, the dialogs are now skinnable and uses clearlooks2 as default. + Added new contextmenu plugin, context menus can now have submenus and plugins can add items on the fly. + Added new skin support for the simple and advanced themes you can alter the whole UI using CSS. + Added new o2k7 skin for the simple and advanced themes. + Added new custom list boxes for font size/format/style etc with preview support. + Added new UI management, enabled plugins to create controls like splitbuttons or menus easier. + Added new JSON parser/serializer and JSON-RPC class to the core API. + Added new cookie utility class to the core API. + Added new Unit testing class to the core API only available in dev mode. + Added new firebug lite integration when loading the dev version of TinyMCE. + Added new Safari plugin, fixes lots compatibility of issues with Safari 3.x. + Added new URI/URL parsing it now handles the hole RFC and even some exceptions. + Added new pagebreak plugin, enables you to insert pagebreak comments like + Added new on demand loading of plugins and themes. Enables you to load and init TinyMCE at any time. + Added new throbber/progress visualization a plugin can show/hide this when it's needed. + Added new blockquote button. Enables you to wrap paragraphs in blockquotes. + Added new compat2x plugin. Will provide a TinyMCE 2.x API for older plugins. + Added new theme_advanced_resizing_min_width, theme_advanced_resizing_min_height options. + Added new theme_advanced_resizing_max_height, theme_advanced_resizing_max_height options. + Added new use_native_selects option. Enables you to toggle native listboxes on and off. + Added new docs_url option enables you to specify where the TinyMCE user documentation is located. + Added new frame and rules options for the table dialog. + Added new global rule for valid_elements/extended_valid_elements enables you to specify global attributes for all elements. + Added new deny attribute rule characher so it's possible to deny global attribute rules on specific elements. + Added new unit tests in the dev package of TinyMCE. Runs tests on the core API, commands and settings of the editor. + Readded the inline_styles option and enabled it by default so deprecated attributes are no longer used. + Removed all button images and replaced them with CSS sprite images. Reduces the number of requests needed. + Removed lots of language files and merged them into the base language files. Reduces the number of requests needed. + Removed lots of unnecessary files and merged many of them together to reduce requests and improve loading speed. + Reduced the over all script size by 33% and the number of files/requests by 75% so it loads a lot faster. + Fixed so convert_fonts_to_spans are enabled by default. So no more font tags. + Fixed so underline and strikethrough uses spans instread of deprecated U and STRIKE elements. + Fixed so indent/outdent adds/removed margin-left instead of blockquotes. + Fixed so alignment of paragraphs results in a text-align style value instead of the deprecated align attribute. + Fixed so alignment of images uses float or vertical-align style values instead of the deprecated align attribute. + Fixed so all classes from @import stylesheets gets imported into the editor. + Fixed so the directionality can toggle the dir attribute on and off. + Fixed so the fullscreen_settings can be used for all types of fullscreen modes. + Fixed so the advanced HR dialog gets displayed when inserting a HR not only on edit. + Fixed bug where word wrap didn't work in the source editor on Safari. + Fixed so non HTML elements can be used within the editor such as + Fixed various memory leaks in IE and reduced the unload cleanups needed. + Fixed so the preformatted option adds an invisible container pre tag inside the editor. + Renamed the _template plugin to example and updated it to use the new 3.x API. diff --git a/static/grappelli_orig/tinymce/examples/accessibility.html b/static/grappelli_orig/tinymce/examples/accessibility.html new file mode 100644 index 00000000..69059403 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/accessibility.html @@ -0,0 +1,101 @@ + + + +Full featured example + + + + + + + + + +
                  +
                  +

                  Full featured example, with Accessibility settings enabled

                  + +

                  + This page has got the TinyMCE set up to work with configurations related to accessiblity enabled. + In particular +

                    +
                  • the content_css is set to false, to ensure that all default browser styles are used,
                  • +
                  • the browser_preferred_colors dialog option is used to ensure that default css is used for dialogs,
                  • +
                  • and the detect_highcontrast option has been set to ensure that highcontrast mode in Windows browsers + is detected and the toolbars are displayed in a high contrast mode.
                  • +
                  +

                  + + +
                  + +
                  + +
                  + + +
                  +
                  + + + + diff --git a/static/grappelli_orig/tinymce/examples/css/content.css b/static/grappelli_orig/tinymce/examples/css/content.css new file mode 100644 index 00000000..a76c38a2 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/css/content.css @@ -0,0 +1,105 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} + +/* Basic formats */ + +.bold { + font-weight: bold; +} + +.italic { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +/* Global align classes */ + +.left { + text-align: inherit; +} + +.center { + text-align: center; +} + +.right { + text-align: right; +} + +.full { + text-align: justify +} + +/* Image and table specific aligns */ + +img.left, table.left { + float: left; + text-align: inherit; +} + +img.center, table.center { + margin-left: auto; + margin-right: auto; + text-align: inherit; +} + +img.center { + display: block; +} + +img.right, table.right { + float: right; + text-align: inherit; +} diff --git a/static/grappelli_orig/tinymce/examples/css/word.css b/static/grappelli_orig/tinymce/examples/css/word.css new file mode 100644 index 00000000..049a39fb --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/css/word.css @@ -0,0 +1,53 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +p {margin:0; padding:0;} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} diff --git a/static/grappelli_orig/tinymce/examples/custom_formats.html b/static/grappelli_orig/tinymce/examples/custom_formats.html new file mode 100644 index 00000000..ba9d1eb0 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/custom_formats.html @@ -0,0 +1,111 @@ + + + +Custom formats example + + + + + + + + + +
                  +
                  +

                  Custom formats example

                  + +

                  + This example shows you how to override the default formats for bold, italic, underline, strikethough and alignment to use classes instead of inline styles. + There are more examples on how to use TinyMCE in the Wiki. +

                  + + +
                  + +
                  + + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
                  + + +
                  +
                  + + + diff --git a/static/grappelli_orig/tinymce/examples/full.html b/static/grappelli_orig/tinymce/examples/full.html new file mode 100644 index 00000000..84b76ca7 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/full.html @@ -0,0 +1,101 @@ + + + +Full featured example + + + + + + + + + +
                  +
                  +

                  Full featured example

                  + +

                  + This page shows all available buttons and plugins that are included in the TinyMCE core package. + There are more examples on how to use TinyMCE in the Wiki. +

                  + + +
                  + +
                  + + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
                  + + +
                  +
                  + + + + diff --git a/static/grappelli_orig/tinymce/examples/index.html b/static/grappelli_orig/tinymce/examples/index.html new file mode 100644 index 00000000..6ebfbea5 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/index.html @@ -0,0 +1,10 @@ + + + + TinyMCE examples + + + + + + diff --git a/static/grappelli_orig/tinymce/examples/lists/image_list.js b/static/grappelli_orig/tinymce/examples/lists/image_list.js new file mode 100644 index 00000000..7ba049a2 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/lists/image_list.js @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url" +// option is defined in TinyMCE init. + +var tinyMCEImageList = new Array( + // Name, URL + ["Logo 1", "media/logo.jpg"], + ["Logo 2 Over", "media/logo_over.jpg"] +); diff --git a/static/grappelli_orig/tinymce/examples/lists/link_list.js b/static/grappelli_orig/tinymce/examples/lists/link_list.js new file mode 100644 index 00000000..0d464331 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/lists/link_list.js @@ -0,0 +1,10 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url" +// option is defined in TinyMCE init. + +var tinyMCELinkList = new Array( + // Name, URL + ["Moxiecode", "http://www.moxiecode.com"], + ["Freshmeat", "http://www.freshmeat.com"], + ["Sourceforge", "http://www.sourceforge.com"] +); diff --git a/static/grappelli_orig/tinymce/examples/lists/media_list.js b/static/grappelli_orig/tinymce/examples/lists/media_list.js new file mode 100644 index 00000000..2e049587 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/lists/media_list.js @@ -0,0 +1,14 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCEMediaList = [ + // Name, URL + ["Some Flash", "media/sample.swf"], + ["Some Quicktime", "media/sample.mov"], + ["Some AVI", "media/sample.avi"], + ["Some RealMedia", "media/sample.rm"], + ["Some Shockwave", "media/sample.dcr"], + ["Some Video", "media/sample.mp4"], + ["Some FLV", "media/sample.flv"] +]; \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/examples/lists/template_list.js b/static/grappelli_orig/tinymce/examples/lists/template_list.js new file mode 100644 index 00000000..e06d3578 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/lists/template_list.js @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCETemplateList = [ + // Name, URL, Description + ["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."], + ["Layout", "templates/layout1.htm", "HTML Layout."] +]; \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/examples/media/logo.jpg b/static/grappelli_orig/tinymce/examples/media/logo.jpg new file mode 100644 index 00000000..ad535d67 Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/logo.jpg differ diff --git a/static/grappelli_orig/tinymce/examples/media/logo_over.jpg b/static/grappelli_orig/tinymce/examples/media/logo_over.jpg new file mode 100644 index 00000000..79fcd884 Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/logo_over.jpg differ diff --git a/static/grappelli_orig/tinymce/examples/media/sample.avi b/static/grappelli_orig/tinymce/examples/media/sample.avi new file mode 100644 index 00000000..238bb688 Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/sample.avi differ diff --git a/static/grappelli_orig/tinymce/examples/media/sample.dcr b/static/grappelli_orig/tinymce/examples/media/sample.dcr new file mode 100644 index 00000000..353b3ce6 Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/sample.dcr differ diff --git a/static/grappelli_orig/tinymce/examples/media/sample.flv b/static/grappelli_orig/tinymce/examples/media/sample.flv new file mode 100644 index 00000000..799d137e Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/sample.flv differ diff --git a/static/grappelli_orig/tinymce/examples/media/sample.mov b/static/grappelli_orig/tinymce/examples/media/sample.mov new file mode 100644 index 00000000..9c0a0932 Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/sample.mov differ diff --git a/static/grappelli_orig/tinymce/examples/media/sample.ram b/static/grappelli_orig/tinymce/examples/media/sample.ram new file mode 100644 index 00000000..e2ce04cf --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/media/sample.ram @@ -0,0 +1 @@ +http://streaming.uga.edu/samples/ayp_lan.rm \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/examples/media/sample.rm b/static/grappelli_orig/tinymce/examples/media/sample.rm new file mode 100644 index 00000000..8947706e Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/sample.rm differ diff --git a/static/grappelli_orig/tinymce/examples/media/sample.swf b/static/grappelli_orig/tinymce/examples/media/sample.swf new file mode 100644 index 00000000..9f5fc4ac Binary files /dev/null and b/static/grappelli_orig/tinymce/examples/media/sample.swf differ diff --git a/static/grappelli_orig/tinymce/examples/menu.html b/static/grappelli_orig/tinymce/examples/menu.html new file mode 100644 index 00000000..e48650ab --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/menu.html @@ -0,0 +1,18 @@ + + + +Menu + + + +

                  Examples

                  +Full featured +Simple theme +Skin support +Word processor +Custom formats +Accessibility Options + + diff --git a/static/grappelli_orig/tinymce/examples/simple.html b/static/grappelli_orig/tinymce/examples/simple.html new file mode 100644 index 00000000..70720caa --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/simple.html @@ -0,0 +1,47 @@ + + + +Simple theme example + + + + + + + + + +
                  +

                  Simple theme example

                  + +

                  + This page shows you the simple theme and it's core functionality you can extend it by changing the code use the advanced theme if you need to configure/add more buttons etc. + There are more examples on how to use TinyMCE in the Wiki. +

                  + + + + +
                  + + +
                  + + + diff --git a/static/grappelli_orig/tinymce/examples/skins.html b/static/grappelli_orig/tinymce/examples/skins.html new file mode 100644 index 00000000..c1508588 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/skins.html @@ -0,0 +1,216 @@ + + + +Skin support example + + + + + + + + + +
                  +

                  Skin support example

                  + +

                  + This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins//ui.css + There are more examples on how to use TinyMCE in the Wiki. +

                  + + + + +
                  + + + +
                  + + + +
                  + + + +
                  + + +
                  + + + diff --git a/static/grappelli_orig/tinymce/examples/templates/layout1.htm b/static/grappelli_orig/tinymce/examples/templates/layout1.htm new file mode 100644 index 00000000..a38df3e6 --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/templates/layout1.htm @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +
                  Column 1Column 2
                  Username: {$username}Staffid: {$staffid}
                  diff --git a/static/grappelli_orig/tinymce/examples/templates/snippet1.htm b/static/grappelli_orig/tinymce/examples/templates/snippet1.htm new file mode 100644 index 00000000..b2520bea --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/templates/snippet1.htm @@ -0,0 +1 @@ +This is just some code. diff --git a/static/grappelli_orig/tinymce/examples/word.html b/static/grappelli_orig/tinymce/examples/word.html new file mode 100644 index 00000000..d827b6fe --- /dev/null +++ b/static/grappelli_orig/tinymce/examples/word.html @@ -0,0 +1,72 @@ + + + +Word processor example + + + + + + + + + +
                  +

                  Word processor example

                  + +

                  + This page shows you how to configure TinyMCE to work more like common word processors. + There are more examples on how to use TinyMCE in the Wiki. +

                  + + + + +
                  + + +
                  + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/langs/de.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/langs/de.js new file mode 100644 index 00000000..14944062 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n({de:{common:{"more_colors":"Weitere Farben","invalid_data":"Fehler: Sie haben ung\u00fcltige Werte eingegeben (rot markiert).","popup_blocked":"Leider hat Ihr Popup-Blocker ein Fenster unterbunden, das f\u00fcr den Betrieb dieses Programms n\u00f6tig ist. Bitte deaktivieren Sie den Popup-Blocker f\u00fcr diese Seite.","clipboard_no_support":"Wird derzeit in Ihrem Browser nicht unterst\u00fctzt. Bitte benutzen Sie stattdessen die Tastenk\u00fcrzel.","clipboard_msg":"Kopieren, Ausschneiden und Einf\u00fcgen sind im Mozilla Firefox nicht m\u00f6glich.\nM\u00f6chten Sie mehr \u00fcber dieses Problem erfahren?","not_set":"- unbestimmt -","class_name":"CSS-Klasse",browse:"Durchsuchen",close:"Schlie\u00dfen",cancel:"Abbrechen",update:"Aktualisieren",insert:"Einf\u00fcgen",apply:"\u00dcbernehmen","edit_confirm":"M\u00f6chten Sie diesen Text jetzt bearbeiten?","invalid_data_number":"{#field} muss eine Zahl sein","invalid_data_min":"{#field} muss eine Zahl gr\u00f6\u00dfer als {#min} sein","invalid_data_size":"{#field} muss eine Zahl oder ein Prozentwert sein",value:"(Wert)"},contextmenu:{full:"Blocksatz",right:"Rechtsb\u00fcndig",center:"Zentriert",left:"Linksb\u00fcndig",align:"Ausrichtung"},insertdatetime:{"day_short":"So,Mo,Di,Mi,Do,Fr,Sa,So","day_long":"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag","months_short":"Jan,Feb,M\u00e4r,Apr,Mai,Juni,Juli,Aug,Sept,Okt,Nov,Dez","months_long":"Januar,Februar,M\u00e4rz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember","inserttime_desc":"Zeit einf\u00fcgen","insertdate_desc":"Datum einf\u00fcgen","time_fmt":"%H:%M:%S","date_fmt":"%d.%m.%Y"},print:{"print_desc":"Drucken"},preview:{"preview_desc":"Vorschau"},directionality:{"rtl_desc":"Schrift von rechts nach links","ltr_desc":"Schrift von links nach rechts"},layer:{content:"Neue Ebene...","absolute_desc":"Absolute Positionierung","backward_desc":"Nach hinten legen","forward_desc":"Nach vorne holen","insertlayer_desc":"Neue Ebene einf\u00fcgen"},save:{"save_desc":"Speichern","cancel_desc":"Alle \u00c4nderungen verwerfen"},nonbreaking:{"nonbreaking_desc":"Gesch\u00fctztes Leerzeichen einf\u00fcgen"},iespell:{download:"ieSpell konnte nicht gefunden werden. Wollen Sie es installieren?","iespell_desc":"Rechtschreibpr\u00fcfung"},advhr:{"advhr_desc":"Trennlinie","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Smilies","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"Suchen/Ersetzen","search_desc":"Suchen","delta_width":"","delta_height":""},advimage:{"image_desc":"Bild einf\u00fcgen/ver\u00e4ndern","delta_width":"","delta_height":""},advlink:{"link_desc":"Link einf\u00fcgen/ver\u00e4ndern","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Attribute einf\u00fcgen/bearbeiten","ins_desc":"Eingef\u00fcgter Text","del_desc":"Entfernter Text","acronym_desc":"Akronym","abbr_desc":"Abk\u00fcrzung","cite_desc":"Quellenangabe","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"CSS-Styles bearbeiten","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Einf\u00fcgemodus ist nun \"Nur Text\". Erneut klicken stellt den Normalmodus wieder her.","plaintext_mode_sticky":"Einf\u00fcgemodus ist nun \"Nur Text\". Erneut klicken (oder das Einf\u00fcgen aus der Zwischenablage) stellt den Normalmodus wieder her.","selectall_desc":"Alles ausw\u00e4hlen","paste_word_desc":"Mit Formatierungen (aus Word) einf\u00fcgen","paste_text_desc":"Als einfachen Text einf\u00fcgen"},"paste_dlg":{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."},table:{"cellprops_delta_width":"150",cell:"Zelle",col:"Spalte",row:"Zeile",del:"Tabelle l\u00f6schen","copy_row_desc":"Zeile kopieren","cut_row_desc":"Zeile ausschneiden","paste_row_after_desc":"Zeile unterhalb aus der Zwischenablage einf\u00fcgen","paste_row_before_desc":"Zeile oberhalb aus der Zwischenablage einf\u00fcgen","props_desc":"Eigenschaften der Tabelle","cell_desc":"Eigenschaften der Zelle","row_desc":"Eigenschaften der Zeile","merge_cells_desc":"Zellen verbinden","split_cells_desc":"Verbundene Zellen trennen","delete_col_desc":"Spalte l\u00f6schen","col_after_desc":"Spalte rechts einf\u00fcgen","col_before_desc":"Spalte links einf\u00fcgen","delete_row_desc":"Zeile l\u00f6schen","row_after_desc":"Zeile unterhalb einf\u00fcgen","row_before_desc":"Zeile oberhalb einf\u00fcgen",desc:"Tabelle erstellen/bearbeiten","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Wenn Sie den Inhalt wiederherstellen, gehen die aktuellen Daten im Editor verloren.\n\nSind sie sicher, dass Sie den Inhalt wiederherstellen m\u00f6chten?","restore_content":"Automatisch gespeicherten Inhalt wiederherstellen.","unload_msg":"Ihre \u00c4nderungen werden verloren gehen, wenn Sie die Seite verlassen."},fullscreen:{desc:"Vollbildschirm"},media:{edit:"Multimediaeinbettung bearbeiten",desc:"Multimedia einbetten/bearbeiten","delta_height":"","delta_width":""},fullpage:{desc:"Dokument-Eigenschaften","delta_width":"","delta_height":""},template:{desc:"Inhalt aus Vorlage einf\u00fcgen"},visualchars:{desc:"Sichtbarkeit der Steuerzeichen an/aus"},spellchecker:{desc:"Rechtschreibpr\u00fcfung an/aus",menu:"Einstellungen der Rechtschreibpr\u00fcfung","ignore_word":"Wort ignorieren","ignore_words":"Alle ignorieren",langs:"Sprachen",wait:"Bitte warten...",sug:"Vorschl\u00e4ge","no_sug":"Keine Vorschl\u00e4ge","no_mpell":"Keine Rechtschreibfehler gefunden.","learn_word":"Zum W\u00f6rterbuch hinzuf\u00fcgen"},pagebreak:{desc:"Seitenumbruch einf\u00fcgen"},advlist:{types:"Typen",def:"Standard","lower_alpha":"a. b. c.","lower_greek":"1. 2. 3.","lower_roman":"i. ii. iii.","upper_alpha":"A. B. C.","upper_roman":"I. II. III.",circle:"Kreis",disc:"Punkt",square:"Quadrat"},colors:{"333300":"Dunkeloliv","993300":"Orange","000000":"Schwarz","003300":"Dunkelgr\u00fcn","003366":"Dunkles himmelblau","000080":"Marineblau","333399":"Indigoblau","333333":"Sehr dunkelgrau","800000":"Kastanienbraun",FF6600:"Orange","808000":"Oliv","008000":"Gr\u00fcn","008080":"Blaugr\u00fcn","0000FF":"Blau","666699":"Graublau","808080":"Grau",FF0000:"Rot",FF9900:"Bernsteinfarben","99CC00":"Gelbgr\u00fcn","339966":"Meergr\u00fcn","33CCCC":"T\u00fcrkis","3366FF":"K\u00f6nigsblau","800080":"Violett","999999":"Mittelgrau",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Gelb","00FF00":"Hellgr\u00fcn","00FFFF":"Aquamarinblau","00CCFF":"Himmelblau","993366":"Braun",C0C0C0:"Silber",FF99CC:"Rosa",FFCC99:"Pfirsichfarben",FFFF99:"Hellgelb",CCFFCC:"Blassgr\u00fcn",CCFFFF:"Blasst\u00fcrkis","99CCFF":"Helles himmelblau",CC99FF:"Pflaumenblau",FFFFFF:"Wei\u00df"},aria:{"rich_text_area":"Rich Text Bereich"},wordcount:{words:"W\u00f6rter: "}}}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/langs/en.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/langs/en.js new file mode 100644 index 00000000..16d7a93e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode_sticky":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"}}}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/license.txt b/static/grappelli_orig/tinymce/jscripts/tiny_mce/license.txt new file mode 100644 index 00000000..60d6d4c8 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/license.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css new file mode 100644 index 00000000..0e228349 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css @@ -0,0 +1,5 @@ +input.radio {border:1px none #000; background:transparent; vertical-align:middle;} +.panel_wrapper div.current {height:80px;} +#width {width:50px; vertical-align:middle;} +#width2 {width:50px; vertical-align:middle;} +#size {width:100px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js new file mode 100644 index 00000000..4d3b062d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js new file mode 100644 index 00000000..0c652d33 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js @@ -0,0 +1,57 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedHRPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvancedHr', function() { + ed.windowManager.open({ + file : url + '/rule.htm', + width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), + height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('advhr', { + title : 'advhr.advhr_desc', + cmd : 'mceAdvancedHr' + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('advhr', n.nodeName == 'HR'); + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'HR') + ed.selection.select(e); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced HR', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js new file mode 100644 index 00000000..b6cbd66c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js @@ -0,0 +1,43 @@ +var AdvHRDialog = { + init : function(ed) { + var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; + + w = dom.getAttrib(n, 'width'); + f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); + f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; + f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); + selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); + }, + + update : function() { + var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; + + h = ' + + + {#advhr.advhr_desc} + + + + + + + +
                  + + +
                  +
                  + + + + + + + + + + + + + +
                  + + + +
                  +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css new file mode 100644 index 00000000..4224b84c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css @@ -0,0 +1,13 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +/*input {width: 280px;}*/ +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js new file mode 100644 index 00000000..c7fc494d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:600+parseInt(a.getLang("advimage.delta_width",0)),height:242+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js new file mode 100644 index 00000000..1ab568a0 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 242 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm new file mode 100644 index 00000000..41ba2b11 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm @@ -0,0 +1,198 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + {#advimage_dlg.preview} + +
                  +
                  +
                  +
                  + {#advimage_dlg.tab_appearance} + +
                  +
                  +
                  + x + px +

                  + + +

                  +
                  +
                  + + + +
                  +
                  +
                  +
                  + + +
                  +
                  +
                  +
                  + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + +
                  + + + + +
                   
                  + + + + +
                   
                  +
                  +
                  + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + +
                  + +
                  + + + + + +
                   
                  +
                  +
                  +
                  +
                  +
                  +
                    +
                  • +
                  • +
                  +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif new file mode 100644 index 00000000..53bf6890 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js new file mode 100644 index 00000000..546b69c0 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js @@ -0,0 +1,462 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = isIE ? '0' : '0 none none'; + else { + if (b.length == 3 && b[isIE ? 2 : 1]) + bStyle = b[isIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js new file mode 100644 index 00000000..fc0f6d1e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advimage_dlg',{"image_list":"Bilderliste","align_right":"Rechts","align_left":"Links","align_textbottom":"Unten im Text","align_texttop":"Oben im Text","align_bottom":"Unten","align_middle":"Mittig","align_top":"Oben","align_baseline":"Zeile",align:"Ausrichtung",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",dimensions:"Ausma\u00dfe",border:"Rahmen",list:"Bilderliste",alt:"Beschreibung",src:"Adresse","dialog_title":"Bild einf\u00fcgen/ver\u00e4ndern","missing_alt":"Wollen Sie wirklich keine Beschreibung eingeben? Bestimmte Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnen so nicht darauf zugreifen, ebenso solche, die einen Textbrowser benutzen oder die Anzeige von Bildern deaktiviert haben.","example_img":"Vorschau auf das Aussehen",misc:"Verschiedenes",mouseout:"bei keinem Mauskontakt",mouseover:"bei Mauskontakt","alt_image":"Alternatives Bild","swap_image":"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Rechts nach links",ltr:"Links nach rechts",classes:"Klassen",style:"Format","long_desc":"Ausf\u00fchrliche Beschreibung",langcode:"Sprachcode",langdir:"Schriftrichtung","constrain_proportions":"Seitenverh\u00e4ltnis beibehalten",preview:"Vorschau",title:"Titel",general:"Allgemein","tab_advanced":"Erweitert","tab_appearance":"Aussehen","tab_general":"Allgemein",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js new file mode 100644 index 00000000..5f122e2c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css new file mode 100644 index 00000000..0a6251a6 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/css/advimage.css @@ -0,0 +1,13 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +input {width: 280px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js new file mode 100644 index 00000000..d613a613 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js new file mode 100644 index 00000000..d2678cbc --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm new file mode 100644 index 00000000..ed16b3d4 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/image.htm @@ -0,0 +1,235 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#advimage_dlg.general} + + + + + + + + + + + + + + + + + + + +
                  + +
                  + {#advimage_dlg.preview} + +
                  +
                  + +
                  +
                  + {#advimage_dlg.tab_appearance} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + {#advimage_dlg.example_img} + Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam + nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum + edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam + erat volutpat. +
                  +
                  + + x + + px +
                    + + + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + + + +
                  + + + + +
                   
                  + + + + +
                   
                  +
                  + +
                  + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + +
                  + +
                  + + + + +
                   
                  +
                  +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif new file mode 100644 index 00000000..53bf6890 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/img/sample.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js new file mode 100644 index 00000000..546b69c0 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/js/image.js @@ -0,0 +1,462 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = isIE ? '0' : '0 none none'; + else { + if (b.length == 3 && b[isIE ? 2 : 1]) + bStyle = b[isIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js new file mode 100644 index 00000000..fc0f6d1e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advimage_dlg',{"image_list":"Bilderliste","align_right":"Rechts","align_left":"Links","align_textbottom":"Unten im Text","align_texttop":"Oben im Text","align_bottom":"Unten","align_middle":"Mittig","align_top":"Oben","align_baseline":"Zeile",align:"Ausrichtung",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",dimensions:"Ausma\u00dfe",border:"Rahmen",list:"Bilderliste",alt:"Beschreibung",src:"Adresse","dialog_title":"Bild einf\u00fcgen/ver\u00e4ndern","missing_alt":"Wollen Sie wirklich keine Beschreibung eingeben? Bestimmte Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnen so nicht darauf zugreifen, ebenso solche, die einen Textbrowser benutzen oder die Anzeige von Bildern deaktiviert haben.","example_img":"Vorschau auf das Aussehen",misc:"Verschiedenes",mouseout:"bei keinem Mauskontakt",mouseover:"bei Mauskontakt","alt_image":"Alternatives Bild","swap_image":"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Rechts nach links",ltr:"Links nach rechts",classes:"Klassen",style:"Format","long_desc":"Ausf\u00fchrliche Beschreibung",langcode:"Sprachcode",langdir:"Schriftrichtung","constrain_proportions":"Seitenverh\u00e4ltnis beibehalten",preview:"Vorschau",title:"Titel",general:"Allgemein","tab_advanced":"Erweitert","tab_appearance":"Aussehen","tab_general":"Allgemein",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js new file mode 100644 index 00000000..5f122e2c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advimage_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css new file mode 100644 index 00000000..14364316 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css @@ -0,0 +1,8 @@ +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js new file mode 100644 index 00000000..f8e19b99 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:600+parseInt(a.getLang("advlink.delta_width",0)),height:278+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js new file mode 100644 index 00000000..d68c8aac --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 285 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js new file mode 100644 index 00000000..9ca955c9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js @@ -0,0 +1,539 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', inst.dom.getAttrib(elm, 'target')); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i' + name + ''; + } + + if (html == "") + return ""; + + html = ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js new file mode 100644 index 00000000..bb0d3e35 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advlink_dlg',{"target_name":"Name der Zielseite",classes:"Klassen",style:"Format",id:"ID","popup_position":"Position (X/Y)",langdir:"Schriftrichtung","popup_size":"Gr\u00f6\u00dfe","popup_dependent":"Vom Elternfenster abh\u00e4ngig
                  (nur Mozilla/Firefox) ","popup_resizable":"Vergr\u00f6\u00dfern des Fenster zulassen","popup_location":"Adressleiste anzeigen","popup_menubar":"Browsermen\u00fc anzeigen","popup_toolbar":"Werkzeugleisten anzeigen","popup_statusbar":"Statusleiste anzeigen","popup_scrollbars":"Scrollbalken anzeigen","popup_return":"Link trotz Popup folgen","popup_name":"Name des Fensters","popup_url":"Popup-Adresse",popup:"JavaScript-Popup","target_blank":"In neuem Fenster \u00f6ffnen","target_top":"Im obersten Frame \u00f6ffnen (sprengt das Frameset)","target_parent":"Im \u00fcbergeordneten Fenster/Frame \u00f6ffnen","target_same":"Im selben Fenster/Frame \u00f6ffnen","anchor_names":"Anker","popup_opts":"Optionen","advanced_props":"Erweiterte Eigenschaften","event_props":"Ereignisse","popup_props":"Popup-Eigenschaften","general_props":"Allemeine Eigenschaften","advanced_tab":"Erweitert","events_tab":"Ereignisse","popup_tab":"Popup","general_tab":"Allgemein",list:"Linkliste","is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?",titlefield:"Titel",target:"Fenster",url:"Adresse",title:"Link einf\u00fcgen/bearbeiten","link_list":"Linkliste",rtl:"Rechts nach links",ltr:"Links nach rechts",accesskey:"Tastenk\u00fcrzel",tabindex:"Tabindex",rev:"Beziehung des Linkziels zur Seite",rel:"Beziehung der Seite zum Linkziel",mime:"MIME-Type der Zielseite",encoding:"Zeichenkodierung der Zielseite",langcode:"Sprachcode","target_langcode":"Sprache der Zielseite",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js new file mode 100644 index 00000000..3169a565 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm new file mode 100644 index 00000000..2ad0bd36 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm @@ -0,0 +1,309 @@ + + + + {#advlink_dlg.title} + + + + + + + + +
                  + + +
                  +
                  +
                  + {#advlink_dlg.general_props} +
                  +
                  +
                  + +
                   
                  +
                  +
                  +
                  +
                  +
                   
                  +
                  +
                  +
                  +
                   
                  +
                  +
                  +
                  +
                   
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  + + + +
                  +
                  + {#advlink_dlg.advanced_props} +
                  +
                  +
                  +
                  + + + + + + + + + + + + +
                  +
                  + + +
                  +
                  + {#advlink_dlg.event_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +
                  +
                  +
                  +
                  +
                    +
                  • +
                  • +
                  +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css new file mode 100644 index 00000000..14364316 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/css/advlink.css @@ -0,0 +1,8 @@ +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js new file mode 100644 index 00000000..983fe5a9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js new file mode 100644 index 00000000..14e46a76 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js new file mode 100644 index 00000000..9ca955c9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/js/advlink.js @@ -0,0 +1,539 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', inst.dom.getAttrib(elm, 'target')); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i' + name + ''; + } + + if (html == "") + return ""; + + html = ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js new file mode 100644 index 00000000..bb0d3e35 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advlink_dlg',{"target_name":"Name der Zielseite",classes:"Klassen",style:"Format",id:"ID","popup_position":"Position (X/Y)",langdir:"Schriftrichtung","popup_size":"Gr\u00f6\u00dfe","popup_dependent":"Vom Elternfenster abh\u00e4ngig
                  (nur Mozilla/Firefox) ","popup_resizable":"Vergr\u00f6\u00dfern des Fenster zulassen","popup_location":"Adressleiste anzeigen","popup_menubar":"Browsermen\u00fc anzeigen","popup_toolbar":"Werkzeugleisten anzeigen","popup_statusbar":"Statusleiste anzeigen","popup_scrollbars":"Scrollbalken anzeigen","popup_return":"Link trotz Popup folgen","popup_name":"Name des Fensters","popup_url":"Popup-Adresse",popup:"JavaScript-Popup","target_blank":"In neuem Fenster \u00f6ffnen","target_top":"Im obersten Frame \u00f6ffnen (sprengt das Frameset)","target_parent":"Im \u00fcbergeordneten Fenster/Frame \u00f6ffnen","target_same":"Im selben Fenster/Frame \u00f6ffnen","anchor_names":"Anker","popup_opts":"Optionen","advanced_props":"Erweiterte Eigenschaften","event_props":"Ereignisse","popup_props":"Popup-Eigenschaften","general_props":"Allemeine Eigenschaften","advanced_tab":"Erweitert","events_tab":"Ereignisse","popup_tab":"Popup","general_tab":"Allgemein",list:"Linkliste","is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?",titlefield:"Titel",target:"Fenster",url:"Adresse",title:"Link einf\u00fcgen/bearbeiten","link_list":"Linkliste",rtl:"Rechts nach links",ltr:"Links nach rechts",accesskey:"Tastenk\u00fcrzel",tabindex:"Tabindex",rev:"Beziehung des Linkziels zur Seite",rel:"Beziehung der Seite zum Linkziel",mime:"MIME-Type der Zielseite",encoding:"Zeichenkodierung der Zielseite",langcode:"Sprachcode","target_langcode":"Sprache der Zielseite",width:"Breite",height:"H\u00f6he"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js new file mode 100644 index 00000000..3169a565 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm new file mode 100644 index 00000000..8ab7c2a9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlink_orig/link.htm @@ -0,0 +1,338 @@ + + + + {#advlink_dlg.title} + + + + + + + + + +
                  + + + + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js new file mode 100644 index 00000000..57ecce6e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js new file mode 100644 index 00000000..a8f046b4 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js @@ -0,0 +1,176 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.AdvListPlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + function buildFormats(str) { + var formats = []; + + each(str.split(/,/), function(type) { + formats.push({ + title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), + styles : { + listStyleType : type == 'default' ? '' : type + } + }); + }); + + return formats; + }; + + // Setup number formats from config or default + t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); + t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); + + if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) + t.isIE7 = true; + }, + + createControl: function(name, cm) { + var t = this, btn, format, editor = t.editor; + + if (name == 'numlist' || name == 'bullist') { + // Default to first item if it's a default item + if (t[name][0].title == 'advlist.def') + format = t[name][0]; + + function hasFormat(node, format) { + var state = true; + + each(format.styles, function(value, name) { + // Format doesn't match + if (editor.dom.getStyle(node, name) != value) { + state = false; + return false; + } + }); + + return state; + }; + + function applyListFormat() { + var list, dom = editor.dom, sel = editor.selection; + + // Check for existing list element + list = dom.getParent(sel.getNode(), 'ol,ul'); + + // Switch/add list type if needed + if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) + editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); + + // Append styles to new list element + if (format) { + list = dom.getParent(sel.getNode(), 'ol,ul'); + if (list) { + dom.setStyles(list, format.styles); + list.removeAttribute('data-mce-style'); + } + } + + editor.focus(); + }; + + btn = cm.createSplitButton(name, { + title : 'advanced.' + name + '_desc', + 'class' : 'mce_' + name, + onclick : function() { + applyListFormat(); + } + }); + + btn.onRenderMenu.add(function(btn, menu) { + menu.onHideMenu.add(function() { + if (t.bookmark) { + editor.selection.moveToBookmark(t.bookmark); + t.bookmark = 0; + } + }); + + menu.onShowMenu.add(function() { + var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; + + if (list || format) { + fmtList = t[name]; + + // Unselect existing items + each(menu.items, function(item) { + var state = true; + + item.setSelected(0); + + if (list && !item.isDisabled()) { + each(fmtList, function(fmt) { + if (fmt.id == item.id) { + if (!hasFormat(list, fmt)) { + state = false; + return false; + } + } + }); + + if (state) + item.setSelected(1); + } + }); + + // Select the current format + if (!list) + menu.items[format.id].setSelected(1); + } + + editor.focus(); + + // IE looses it's selection so store it away and restore it later + if (tinymce.isIE) { + t.bookmark = editor.selection.getBookmark(1); + } + }); + + menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1); + + each(t[name], function(item) { + // IE<8 doesn't support lower-greek, skip it + if (t.isIE7 && item.styles.listStyleType == 'lower-greek') + return; + + item.id = editor.dom.uniqueId(); + + menu.add({id : item.id, title : item.title, onclick : function() { + format = item; + applyListFormat(); + }}); + }); + }); + + return btn; + } + }, + + getInfo : function() { + return { + longname : 'Advanced lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js new file mode 100644 index 00000000..d54e37a8 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;if(tinyMCE.isIE){return}a.onKeyDown.add(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng().cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js new file mode 100644 index 00000000..4db4acf6 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js @@ -0,0 +1,174 @@ +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AutolinkPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + + init : function(ed, url) { + var t = this; + + // Internet Explorer has built-in automatic linking + if (tinyMCE.isIE) + return; + + // Add a key down handler + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode == 13) + return t.handleEnter(ed); + }); + + ed.onKeyPress.add(function(ed, e) { + if (e.which == 41) + return t.handleEclipse(ed); + }); + + // Add a key up handler + ed.onKeyUp.add(function(ed, e) { + if (e.keyCode == 32) + return t.handleSpacebar(ed); + }); + }, + + handleEclipse : function(ed) { + this.parseCurrentLine(ed, -1, '(', true); + }, + + handleSpacebar : function(ed) { + this.parseCurrentLine(ed, 0, '', true); + }, + + handleEnter : function(ed) { + this.parseCurrentLine(ed, -1, '', false); + }, + + parseCurrentLine : function(ed, end_offset, delimiter, goback) { + var r, end, start, endContainer, bookmark, text, matches, prev, len; + + // We need at least five characters to form a URL, + // hence, at minimum, five characters from the beginning of the line. + r = ed.selection.getRng().cloneRange(); + if (r.startOffset < 5) { + // During testing, the caret is placed inbetween two text nodes. + // The previous text node contains the URL. + prev = r.endContainer.previousSibling; + if (prev == null) { + if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null) + return; + + prev = r.endContainer.firstChild.nextSibling; + } + len = prev.length; + r.setStart(prev, len); + r.setEnd(prev, len); + + if (r.endOffset < 5) + return; + + end = r.endOffset; + endContainer = prev; + } else { + endContainer = r.endContainer; + + // Get a text node + if (endContainer.nodeType != 3 && endContainer.firstChild) { + while (endContainer.nodeType != 3 && endContainer.firstChild) + endContainer = endContainer.firstChild; + + r.setStart(endContainer, 0); + r.setEnd(endContainer, endContainer.nodeValue.length); + } + + if (r.endOffset == 1) + end = 2; + else + end = r.endOffset - 1 - end_offset; + } + + start = end; + + do + { + // Move the selection one character backwards. + r.setStart(endContainer, end - 2); + r.setEnd(endContainer, end - 1); + end -= 1; + + // Loop until one of the following is found: a blank space,  , delimeter, (end-2) >= 0 + } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter); + + if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + end += 1; + } else if (r.startOffset == 0) { + r.setStart(endContainer, 0); + r.setEnd(endContainer, start); + } + else { + r.setStart(endContainer, end); + r.setEnd(endContainer, start); + } + + text = r.toString(); + matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i); + + if (matches) { + if (matches[1] == 'www.') { + matches[1] = 'http://www.'; + } else if (/@$/.test(matches[1])) { + matches[1] = 'mailto:' + matches[1]; + } + + bookmark = ed.selection.getBookmark(); + + ed.selection.setRng(r); + tinyMCE.execCommand('createlink',false, matches[1] + matches[2]); + ed.selection.moveToBookmark(bookmark); + + // TODO: Determine if this is still needed. + if (tinyMCE.isWebKit) { + // move the caret to its original position + ed.selection.collapse(false); + var max = Math.min(endContainer.length, start + 1); + r.setStart(endContainer, max); + r.setEnd(endContainer, max); + ed.selection.setRng(r); + } + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Autolink', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js new file mode 100644 index 00000000..46d9dc3d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js new file mode 100644 index 00000000..7673bcff --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js @@ -0,0 +1,119 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + /** + * Auto Resize + * + * This plugin automatically resizes the content area to fit its content height. + * It will retain a minimum height, which is the height of the content area when + * it's initialized. + */ + tinymce.create('tinymce.plugins.AutoResizePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + var t = this, oldSize = 0; + + if (ed.getParam('fullscreen_is_enabled')) + return; + + /** + * This method gets executed each time the editor needs to resize. + */ + function resize() { + var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; + + // Get height differently depending on the browser used + myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight); + + // Don't make it smaller than the minimum height + if (myHeight > t.autoresize_min_height) + resizeHeight = myHeight; + + // If a maximum height has been defined don't exceed this height + if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { + resizeHeight = t.autoresize_max_height; + body.style.overflowY = "auto"; + de.style.overflowY = "auto"; // Old IE + } else { + body.style.overflowY = "hidden"; + de.style.overflowY = "hidden"; // Old IE + body.scrollTop = 0; + } + + // Resize content element + if (resizeHeight !== oldSize) { + deltaSize = resizeHeight - oldSize; + DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); + oldSize = resizeHeight; + + // WebKit doesn't decrease the size of the body element until the iframe gets resized + // So we need to continue to resize the iframe down until the size gets fixed + if (tinymce.isWebKit && deltaSize < 0) + resize(); + } + }; + + t.editor = ed; + + // Define minimum height + t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight)); + + // Define maximum height + t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0)); + + // Add padding at the bottom for better UX + ed.onInit.add(function(ed){ + ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); + }); + + // Add appropriate listeners for resizing content area + ed.onChange.add(resize); + ed.onSetContent.add(resize); + ed.onPaste.add(resize); + ed.onKeyUp.add(resize); + ed.onPostRender.add(resize); + + if (ed.getParam('autoresize_on_init', true)) { + ed.onLoad.add(resize); + ed.onLoadContent.add(resize); + } + + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceAutoResize', resize); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto Resize', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js new file mode 100644 index 00000000..f7d05760 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js @@ -0,0 +1 @@ +(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()]*>|]*>/gi, "").length > 0) { + // Show confirm dialog if the editor isn't empty + ed.windowManager.confirm( + PLUGIN_NAME + ".warning_message", + function(ok) { + if (ok) + self.restoreDraft(); + } + ); + } else + self.restoreDraft(); + } + }); + + // Enable/disable restoredraft button depending on if there is a draft stored or not + ed.onNodeChange.add(function() { + var controlManager = ed.controlManager; + + if (controlManager.get(RESTORE_DRAFT)) + controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft()); + }); + + ed.onInit.add(function() { + // Check if the user added the restore button, then setup auto storage logic + if (ed.controlManager.get(RESTORE_DRAFT)) { + // Setup storage engine + self.setupStorage(ed); + + // Auto save contents each interval time + setInterval(function() { + self.storeDraft(); + ed.nodeChanged(); + }, settings.autosave_interval); + } + }); + + /** + * This event gets fired when a draft is stored to local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onStoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft is restored from local storage. + * + * @event onStoreDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRestoreDraft = new Dispatcher(self); + + /** + * This event gets fired when a draft removed/expired. + * + * @event onRemoveDraft + * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. + * @param {Object} draft Draft object containing the HTML contents of the editor. + */ + self.onRemoveDraft = new Dispatcher(self); + + // Add ask before unload dialog only add one unload handler + if (!unloadHandlerAdded) { + window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler; + unloadHandlerAdded = TRUE; + } + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + /** + * Returns an expiration date UTC string. + * + * @method getExpDate + * @return {String} Expiration date UTC string. + */ + getExpDate : function() { + return new Date( + new Date().getTime() + this.editor.settings.autosave_retention + ).toUTCString(); + }, + + /** + * This method will setup the storage engine. If the browser has support for it. + * + * @method setupStorage + */ + setupStorage : function(ed) { + var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; + + self.key = PLUGIN_NAME + ed.id; + + // Loop though each storage engine type until we find one that works + tinymce.each([ + function() { + // Try HTML5 Local Storage + if (localStorage) { + localStorage.setItem(testKey, testVal); + + if (localStorage.getItem(testKey) === testVal) { + localStorage.removeItem(testKey); + + return localStorage; + } + } + }, + + function() { + // Try HTML5 Session Storage + if (sessionStorage) { + sessionStorage.setItem(testKey, testVal); + + if (sessionStorage.getItem(testKey) === testVal) { + sessionStorage.removeItem(testKey); + + return sessionStorage; + } + } + }, + + function() { + // Try IE userData + if (tinymce.isIE) { + ed.getElement().style.behavior = "url('#default#userData')"; + + // Fake localStorage on old IE + return { + autoExpires : TRUE, + + setItem : function(key, value) { + var userDataElement = ed.getElement(); + + userDataElement.setAttribute(key, value); + userDataElement.expires = self.getExpDate(); + + try { + userDataElement.save("TinyMCE"); + } catch (e) { + // Ignore, saving might fail if "Userdata Persistence" is disabled in IE + } + }, + + getItem : function(key) { + var userDataElement = ed.getElement(); + + try { + userDataElement.load("TinyMCE"); + return userDataElement.getAttribute(key); + } catch (e) { + // Ignore, loading might fail if "Userdata Persistence" is disabled in IE + return null; + } + }, + + removeItem : function(key) { + ed.getElement().removeAttribute(key); + } + }; + } + }, + ], function(setup) { + // Try executing each function to find a suitable storage engine + try { + self.storage = setup(); + + if (self.storage) + return false; + } catch (e) { + // Ignore + } + }); + }, + + /** + * This method will store the current contents in the the storage engine. + * + * @method storeDraft + */ + storeDraft : function() { + var self = this, storage = self.storage, editor = self.editor, expires, content; + + // Is the contents dirty + if (storage) { + // If there is no existing key and the contents hasn't been changed since + // it's original value then there is no point in saving a draft + if (!storage.getItem(self.key) && !editor.isDirty()) + return; + + // Store contents if the contents if longer than the minlength of characters + content = editor.getContent({draft: true}); + if (content.length > editor.settings.autosave_minlength) { + expires = self.getExpDate(); + + // Store expiration date if needed IE userData has auto expire built in + if (!self.storage.autoExpires) + self.storage.setItem(self.key + "_expires", expires); + + self.storage.setItem(self.key, content); + self.onStoreDraft.dispatch(self, { + expires : expires, + content : content + }); + } + } + }, + + /** + * This method will restore the contents from the storage engine back to the editor. + * + * @method restoreDraft + */ + restoreDraft : function() { + var self = this, storage = self.storage, content; + + if (storage) { + content = storage.getItem(self.key); + + if (content) { + self.editor.setContent(content); + self.onRestoreDraft.dispatch(self, { + content : content + }); + } + } + }, + + /** + * This method will return true/false if there is a local storage draft available. + * + * @method hasDraft + * @return {boolean} true/false state if there is a local draft. + */ + hasDraft : function() { + var self = this, storage = self.storage, expDate, exists; + + if (storage) { + // Does the item exist at all + exists = !!storage.getItem(self.key); + if (exists) { + // Storage needs autoexpire + if (!self.storage.autoExpires) { + expDate = new Date(storage.getItem(self.key + "_expires")); + + // Contents hasn't expired + if (new Date().getTime() < expDate.getTime()) + return TRUE; + + // Remove it if it has + self.removeDraft(); + } else + return TRUE; + } + } + + return false; + }, + + /** + * Removes the currently stored draft. + * + * @method removeDraft + */ + removeDraft : function() { + var self = this, storage = self.storage, key = self.key, content; + + if (storage) { + // Get current contents and remove the existing draft + content = storage.getItem(key); + storage.removeItem(key); + storage.removeItem(key + "_expires"); + + // Dispatch remove event if we had any contents + if (content) { + self.onRemoveDraft.dispatch(self, { + content : content + }); + } + } + }, + + "static" : { + // Internal unload handler will be called before the page is unloaded + _beforeUnloadHandler : function(e) { + var msg; + + tinymce.each(tinyMCE.editors, function(ed) { + // Store a draft for each editor instance + if (ed.plugins.autosave) + ed.plugins.autosave.storeDraft(); + + // Never ask in fullscreen mode + if (ed.getParam("fullscreen_is_enabled")) + return; + + // Setup a return message if the editor is dirty + if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload")) + msg = ed.getLang("autosave.unload_msg"); + }); + + return msg; + } + } + }); + + tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave); +})(tinymce); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js new file mode 100644 index 00000000..fce6bd3e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n('en.autosave',{ +restore_content: "Restore auto-saved content", +warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" +}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js new file mode 100644 index 00000000..8f8821fd --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
                  /gi,"\n");b(//gi,"\n");b(/
                  /gi,"\n");b(/

                  /gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
                  ");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js new file mode 100644 index 00000000..4e7eb337 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -0,0 +1,120 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.BBCodePlugin', { + init : function(ed, url) { + var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t['_' + dialect + '_bbcode2html'](o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t['_' + dialect + '_bbcode2html'](o.content); + + if (o.get) + o.content = t['_' + dialect + '_html2bbcode'](o.content); + }); + }, + + getInfo : function() { + return { + longname : 'BBCode Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + // HTML -> BBCode in PunBB dialect + _punbb_html2bbcode : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: to [b] + rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); + rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); + rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); + rep(/(.*?)<\/font>/gi,"$1"); + rep(//gi,"[img]$1[/img]"); + rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); + rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); + rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); + rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); + rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); + rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); + rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); + rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); + rep(/<\/(strong|b)>/gi,"[/b]"); + rep(/<(strong|b)>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)>/gi,"[i]"); + rep(/<\/u>/gi,"[/u]"); + rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); + rep(//gi,"[u]"); + rep(/]*>/gi,"[quote]"); + rep(/<\/blockquote>/gi,"[/quote]"); + rep(/
                  /gi,"\n"); + rep(//gi,"\n"); + rep(/
                  /gi,"\n"); + rep(/

                  /gi,""); + rep(/<\/p>/gi,"\n"); + rep(/ |\u00a0/gi," "); + rep(/"/gi,"\""); + rep(/</gi,"<"); + rep(/>/gi,">"); + rep(/&/gi,"&"); + + return s; + }, + + // BBCode -> HTML from PunBB dialect + _punbb_bbcode2html : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + s = s.replace(re, str); + }; + + // example: [b] to + rep(/\n/gi,"
                  "); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img\](.*?)\[\/img\]/gi,""); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); + + return s; + } + }); + + // Register plugin + tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100644 index 00000000..4f99010e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g);h._menu=null}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 00000000..004d011d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,161 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + /** + * This plugin a context menu to TinyMCE editor instances. + * + * @class tinymce.plugins.ContextMenu + */ + tinymce.create('tinymce.plugins.ContextMenu', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @method init + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed) { + var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey; + + t.editor = ed; + + contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; + + /** + * This event gets fired when the context menu is shown. + * + * @event onContextMenu + * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. + * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. + */ + t.onContextMenu = new tinymce.util.Dispatcher(this); + + showMenu = ed.onContextMenu.add(function(ed, e) { + // Block TinyMCE menu on ctrlKey and work around Safari issue + if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) + return; + + Event.cancel(e); + + // Select the image if it's clicked. WebKit would other wise expand the selection + if (e.target.nodeName == 'IMG') + ed.selection.select(e.target); + + t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); + Event.add(ed.getDoc(), 'click', function(e) { + hide(ed, e); + }); + + ed.nodeChanged(); + }); + + ed.onRemove.add(function() { + if (t._menu) + t._menu.removeAll(); + }); + + function hide(ed, e) { + realCtrlKey = 0; + + // Since the contextmenu event moves + // the selection we need to store it away + if (e && e.button == 2) { + realCtrlKey = e.ctrlKey; + return; + } + + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hide); + t._menu = null; + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + ed.onKeyDown.add(function(ed, e) { + if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { + Event.cancel(e); + showMenu(ed, e); + } + }); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Contextmenu', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p = DOM.getPos(ed.getContentAreaContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1, + keyboard_focus: true + }); + + t._menu = m; + + m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); + m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); + m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + } + + m.addSeparator(); + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + + m.addSeparator(); + am = m.addMenu({title : 'contextmenu.align'}); + am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); + am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); + am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); + am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + } + }); + + // Register plugin + tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js new file mode 100644 index 00000000..bce8e739 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js new file mode 100644 index 00000000..4444959b --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js @@ -0,0 +1,82 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Directionality', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + ed.addCommand('mceDirectionLTR', function() { + var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); + + if (e) { + if (ed.dom.getAttrib(e, "dir") != "ltr") + ed.dom.setAttrib(e, "dir", "ltr"); + else + ed.dom.setAttrib(e, "dir", ""); + } + + ed.nodeChanged(); + }); + + ed.addCommand('mceDirectionRTL', function() { + var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); + + if (e) { + if (ed.dom.getAttrib(e, "dir") != "rtl") + ed.dom.setAttrib(e, "dir", "rtl"); + else + ed.dom.setAttrib(e, "dir", ""); + } + + ed.nodeChanged(); + }); + + ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); + ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); + + ed.onNodeChange.add(t._nodeChange, t); + }, + + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var dom = ed.dom, dir; + + n = dom.getParent(n, dom.isBlock); + if (!n) { + cm.setDisabled('ltr', 1); + cm.setDisabled('rtl', 1); + return; + } + + dir = dom.getAttrib(n, 'dir'); + cm.setActive('ltr', dir == "ltr"); + cm.setDisabled('ltr', 0); + cm.setActive('rtl', dir == "rtl"); + cm.setDisabled('rtl', 0); + } + }); + + // Register plugin + tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js new file mode 100644 index 00000000..dbdd8ffb --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js @@ -0,0 +1 @@ +(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js new file mode 100644 index 00000000..71d54169 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js @@ -0,0 +1,43 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + tinymce.create('tinymce.plugins.EmotionsPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceEmotion', function() { + ed.windowManager.open({ + file : url + '/emotions.htm', + width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), + height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); + }, + + getInfo : function() { + return { + longname : 'Emotions', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); +})(tinymce); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm new file mode 100644 index 00000000..10135565 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm @@ -0,0 +1,42 @@ + + + + {#emotions_dlg.title} + + + + + +

                  +
                  {#emotions_dlg.title}:

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  {#emotions_dlg.usage}
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif new file mode 100644 index 00000000..ba90cc36 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif new file mode 100644 index 00000000..74d897a4 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif new file mode 100644 index 00000000..963a96b8 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif new file mode 100644 index 00000000..c7cf1011 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif new file mode 100644 index 00000000..716f55e1 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif new file mode 100644 index 00000000..334d49e0 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif new file mode 100644 index 00000000..4efd549e Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif new file mode 100644 index 00000000..82c5b182 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif new file mode 100644 index 00000000..ca2451e1 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif new file mode 100644 index 00000000..fe66220c Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif new file mode 100644 index 00000000..fd27edfa Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif new file mode 100644 index 00000000..0cc9bb71 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif new file mode 100644 index 00000000..2075dc16 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif new file mode 100644 index 00000000..bef7e257 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif new file mode 100644 index 00000000..0631c761 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif new file mode 100644 index 00000000..648e6e87 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js new file mode 100644 index 00000000..b360f20b --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js @@ -0,0 +1,43 @@ +tinyMCEPopup.requireLangPack(); + +var EmotionsDialog = { + addKeyboardNavigation: function(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table"); + + settings ={ + root: "emoticon_table", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); + }, + init : function(ed) { + tinyMCEPopup.resizeToInnerSize(); + this.addKeyboardNavigation(); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { + src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, + alt : ed.getLang(title), + title : ed.getLang(title), + border : 0 + })); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js new file mode 100644 index 00000000..9ef427cb --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.emotions_dlg',{cry:"Weinend",cool:"Cool",desc:"Smilies",title:"Smiley einf\u00fcgen",yell:"Br\u00fcllend",wink:"Zwinkernd",undecided:"Unentschlossen","tongue_out":"Zunge raus",surprised:"\u00dcberrascht",smile:"L\u00e4chelnd",sealed:"Verschlossen","money_mouth":"Geld",laughing:"Lachend",kiss:"K\u00fcssend",innocent:"Unschuldig",frown:"Stirnrunzelnd","foot_in_mouth":"Reingefallen",embarassed:"Verlegen",usage:"Navigation mit linken und rechten Pfeilen."}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js new file mode 100644 index 00000000..f5aafc39 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed",usage:"Use left and right arrows to navigate."}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm new file mode 100644 index 00000000..50b2b344 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm @@ -0,0 +1,22 @@ + + + + {#example_dlg.title} + + + + + +
                  +

                  Here is a example dialog.

                  +

                  Selected text:

                  +

                  Custom arg:

                  + +
                  + + +
                  +
                  + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js new file mode 100644 index 00000000..ec1f81ea --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js new file mode 100644 index 00000000..9a0e7da1 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js @@ -0,0 +1,84 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('example'); + + tinymce.create('tinymce.plugins.ExamplePlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceExample', function() { + ed.windowManager.open({ + file : url + '/dialog.htm', + width : 320 + parseInt(ed.getLang('example.delta_width', 0)), + height : 120 + parseInt(ed.getLang('example.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('example', { + title : 'example.desc', + cmd : 'mceExample', + image : url + '/img/example.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('example', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif new file mode 100644 index 00000000..1ab5da44 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js new file mode 100644 index 00000000..fa834113 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js @@ -0,0 +1,19 @@ +tinyMCEPopup.requireLangPack(); + +var ExampleDialog = { + init : function() { + var f = document.forms[0]; + + // Get the selected contents as text and place it in the input + f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); + f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); + }, + + insert : function() { + // Insert the contents from the input into the document + tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js new file mode 100644 index 00000000..e0784f80 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js new file mode 100644 index 00000000..ebcf948d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js new file mode 100644 index 00000000..0a4551d3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js new file mode 100644 index 00000000..e1c55e41 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + + tinymce.create('tinymce.plugins.ExampleDependencyPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + }, + + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Example Dependency plugin', + author : 'Some author', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency', + version : "1.0" + }; + } + }); + + /** + * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order. + * plugins in this list will be initialised when this plugin is initialized. (before the init method is called). + * plugins in a depends list should typically be specified using the short name). If neccesary this can be done + * with an object which has the url to the plugin and the shortname. + */ + tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css new file mode 100644 index 00000000..2675cec1 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css @@ -0,0 +1,143 @@ +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +#doctypes { + width: 200px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + +.panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js new file mode 100644 index 00000000..dcf76024 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js @@ -0,0 +1 @@ +(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype=""}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='\n'}f+=c.getParam("fullpage_default_doctype",'');f+="\n\n\n";if(e=c.getParam("fullpage_default_title")){f+=""+e+"\n"}if(e=c.getParam("fullpage_default_encoding")){f+='\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="\n\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js new file mode 100644 index 00000000..23de7c5a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -0,0 +1,405 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Node = tinymce.html.Node; + + tinymce.create('tinymce.plugins.FullPagePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullPageProperties', function() { + ed.windowManager.open({ + file : url + '/fullpage.htm', + width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), + height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + data : t._htmlToData() + }); + }); + + // Register buttons + ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); + + ed.onBeforeSetContent.add(t._setContent, t); + ed.onGetContent.add(t._getContent, t); + }, + + getInfo : function() { + return { + longname : 'Fullpage', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + _htmlToData : function() { + var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; + + function getAttr(elm, name) { + var value = elm.attr(name); + + return value || ''; + }; + + // Default some values + data.fontface = editor.getParam("fullpage_default_fontface", ""); + data.fontsize = editor.getParam("fullpage_default_fontsize", ""); + + // Parse XML PI + elm = headerFragment.firstChild; + if (elm.type == 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) + data.docencoding = matches[1]; + } + + // Parse doctype + elm = headerFragment.getAll('#doctype')[0]; + if (elm) + data.doctype = '"; + + // Parse title element + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.metatitle = elm.firstChild.value; + } + + // Parse meta elements + each(headerFragment.getAll('meta'), function(meta) { + var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; + + if (name) + data['meta' + name.toLowerCase()] = meta.attr('content'); + else if (httpEquiv == "Content-Type") { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + + if (matches) + data.docencoding = matches[1]; + } + }); + + // Parse html attribs + elm = headerFragment.getAll('html')[0]; + if (elm) + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + + // Parse stylesheet + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') + data.stylesheet = elm.attr('href'); + + // Parse body parts + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); + } + + return data; + }, + + _dataToHtml : function(data) { + var headerFragment, headElement, html, elm, value, dom = this.editor.dom; + + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + }; + + function addHeadNode(node) { + if (headElement.firstChild) + headElement.insert(node, headElement.firstChild); + else + headElement.append(node); + }; + + headerFragment = this._parseHeader(); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new Node('head', 1); + + if (elm.firstChild) + elm.insert(headElement, elm.firstChild, true); + else + elm.append(headElement); + } + + // Add/update/remove XML-PI + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + + if (data.docencoding) + value += ' encoding="' + data.docencoding + '"'; + + if (elm.type != 7) { + elm = new Node('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + + elm.value = value; + } else if (elm && elm.type == 7) + elm.remove(); + + // Add/update/remove doctype + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new Node('#doctype', 10); + + if (data.xml_pi) + headerFragment.insert(elm, headerFragment.firstChild); + else + addHeadNode(elm); + } + + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) + elm.remove(); + + // Add/update/remove title + elm = headerFragment.getAll('title')[0]; + if (data.metatitle) { + if (!elm) { + elm = new Node('title', 1); + elm.append(new Node('#text', 3)).value = data.metatitle; + addHeadNode(elm); + } + } + + // Add meta encoding + if (data.docencoding) { + elm = null; + each(headerFragment.getAll('meta'), function(meta) { + if (meta.attr('http-equiv') == 'Content-Type') + elm = meta; + }); + + if (!elm) { + elm = new Node('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + + elm.attr('content', 'text/html; charset=' + data.docencoding); + } + + // Add/update/remove meta + each('keywords,description,author,copyright,robots'.split(','), function(name) { + var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; + + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + + if (meta.attr('name') == name) { + if (value) + meta.attr('content', value); + else + meta.remove(); + + return; + } + } + + if (value) { + elm = new Node('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + + addHeadNode(elm); + } + }); + + // Add/update/delete link + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') { + if (data.stylesheet) + elm.attr('href', data.stylesheet); + else + elm.remove(); + } else if (data.stylesheet) { + elm = new Node('link', 1); + elm.attr({ + rel : 'stylesheet', + text : 'text/css', + href : data.stylesheet + }); + elm.shortEnded = true; + + addHeadNode(elm); + } + + // Update body attributes + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + + // Update iframe body as well + dom.setAttribs(this.editor.getBody(), { + style : data.style, + dir : data.dir, + vLink : data.visited_color, + link : data.link_color, + aLink : data.active_color + }); + } + + // Set html attributes + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + + // Serialize header fragment and crop away body part + html = new tinymce.html.Serializer({ + validate: false, + indent: true, + apply_source_formatting : true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + + this.head = html.substring(0, html.indexOf('')); + }, + + _parseHeader : function() { + // Parse the contents with a DOM parser + return new tinymce.html.DomParser({ + validate: false, + root_name: '#document' + }).parse(this.head); + }, + + _setContent : function(ed, o) { + var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; + + function low(s) { + return s.replace(/<\/?[A-Z]+/g, function(a) { + return a.toLowerCase(); + }) + }; + + // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate + if (o.format == 'raw' && self.head) + return; + + if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) + return; + + // Parse out head, body and footer + content = content.replace(/<(\/?)BODY/gi, '<$1body'); + startPos = content.indexOf('', startPos); + self.head = low(content.substring(0, startPos + 1)); + + endPos = content.indexOf('\n'; + + header += editor.getParam('fullpage_default_doctype', ''); + header += '\n\n\n'; + + if (value = editor.getParam('fullpage_default_title')) + header += '' + value + '\n'; + + if (value = editor.getParam('fullpage_default_encoding')) + header += '\n'; + + if (value = editor.getParam('fullpage_default_font_family')) + styles += 'font-family: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_font_size')) + styles += 'font-size: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_text_color')) + styles += 'color: ' + value + ';'; + + header += '\n\n'; + + return header; + }, + + _getContent : function(ed, o) { + var self = this; + + if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) + o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); + } + }); + + // Register plugin + tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm new file mode 100644 index 00000000..14ab8652 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm @@ -0,0 +1,259 @@ + + + + {#fullpage_dlg.title} + + + + + + + +
                  + + +
                  +
                  +
                  + {#fullpage_dlg.meta_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
                   
                   
                   
                   
                   
                    + +
                  +
                  + +
                  + {#fullpage_dlg.langprops} + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                    + +
                   
                  + +
                   
                  +
                  +
                  + +
                  +
                  + {#fullpage_dlg.appearance_textprops} + + + + + + + + + + + + + + + + +
                  + +
                  + +
                  + + + + + +
                   
                  +
                  +
                  + +
                  + {#fullpage_dlg.appearance_bgprops} + + + + + + + + + + +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                  +
                  + +
                  + {#fullpage_dlg.appearance_marginprops} + + + + + + + + + + + + + + +
                  +
                  + +
                  + {#fullpage_dlg.appearance_linkprops} + + + + + + + + + + + + + + + + + +
                  + + + + + +
                  +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                    
                  +
                  + +
                  + {#fullpage_dlg.appearance_style} + + + + + + + + + + +
                  + + + + +
                   
                  +
                  +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js new file mode 100644 index 00000000..3f672ad3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js @@ -0,0 +1,232 @@ +/** + * fullpage.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinyMCEPopup.requireLangPack(); + + var defaultDocTypes = + 'XHTML 1.0 Transitional=,' + + 'XHTML 1.0 Frameset=,' + + 'XHTML 1.0 Strict=,' + + 'XHTML 1.1=,' + + 'HTML 4.01 Transitional=,' + + 'HTML 4.01 Strict=,' + + 'HTML 4.01 Frameset='; + + var defaultEncodings = + 'Western european (iso-8859-1)=iso-8859-1,' + + 'Central European (iso-8859-2)=iso-8859-2,' + + 'Unicode (UTF-8)=utf-8,' + + 'Chinese traditional (Big5)=big5,' + + 'Cyrillic (iso-8859-5)=iso-8859-5,' + + 'Japanese (iso-2022-jp)=iso-2022-jp,' + + 'Greek (iso-8859-7)=iso-8859-7,' + + 'Korean (iso-2022-kr)=iso-2022-kr,' + + 'ASCII (us-ascii)=us-ascii'; + + var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; + var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; + + function setVal(id, value) { + var elm = document.getElementById(id); + + if (elm) { + value = value || ''; + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") + elm.checked = !!value; + else + elm.value = value; + } + }; + + function getVal(id) { + var elm = document.getElementById(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + }; + + window.FullPageDialog = { + changedStyle : function() { + var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); + + setVal('fontface', styles['font-face']); + setVal('fontsize', styles['font-size']); + setVal('textcolor', styles['color']); + + if (val = styles['background-image']) + setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); + else + setVal('bgimage', ''); + + setVal('bgcolor', styles['background-color']); + + // Reset margin form elements + setVal('topmargin', ''); + setVal('rightmargin', ''); + setVal('bottommargin', ''); + setVal('leftmargin', ''); + + // Expand margin + if (val = styles['margin']) { + val = val.split(' '); + styles['margin-top'] = val[0] || ''; + styles['margin-right'] = val[1] || val[0] || ''; + styles['margin-bottom'] = val[2] || val[0] || ''; + styles['margin-left'] = val[3] || val[0] || ''; + } + + if (val = styles['margin-top']) + setVal('topmargin', val.replace(/px/, '')); + + if (val = styles['margin-right']) + setVal('rightmargin', val.replace(/px/, '')); + + if (val = styles['margin-bottom']) + setVal('bottommargin', val.replace(/px/, '')); + + if (val = styles['margin-left']) + setVal('leftmargin', val.replace(/px/, '')); + + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('textcolor_pick', 'textcolor'); + }, + + changedStyleProp : function() { + var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); + + styles['font-face'] = getVal('fontface'); + styles['font-size'] = getVal('fontsize'); + styles['color'] = getVal('textcolor'); + styles['background-color'] = getVal('bgcolor'); + + if (val = getVal('bgimage')) + styles['background-image'] = "url('" + val + "')"; + else + styles['background-image'] = ''; + + delete styles['margin']; + + if (val = getVal('topmargin')) + styles['margin-top'] = val + "px"; + else + styles['margin-top'] = ''; + + if (val = getVal('rightmargin')) + styles['margin-right'] = val + "px"; + else + styles['margin-right'] = ''; + + if (val = getVal('bottommargin')) + styles['margin-bottom'] = val + "px"; + else + styles['margin-bottom'] = ''; + + if (val = getVal('leftmargin')) + styles['margin-left'] = val + "px"; + else + styles['margin-left'] = ''; + + // Serialize, parse and reserialize this will compress redundant styles + setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); + this.changedStyle(); + }, + + update : function() { + var data = {}; + + tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { + data[node.id] = getVal(node.id); + }); + + tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); + tinyMCEPopup.close(); + } + }; + + function init() { + var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; + + // Setup doctype select box + list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'doctype', item[0], item[1]); + } + + // Setup fonts select box + list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'fontface', item[0], item[1]); + } + + // Setup fontsize select box + list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); + for (i = 0; i < list.length; i++) + addSelectValue(form, 'fontsize', list[i], list[i]); + + // Setup encodings select box + list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); + for (i = 0; i < list.length; i++) { + item = list[i].split('='); + + if (item.length > 1) + addSelectValue(form, 'docencoding', item[0], item[1]); + } + + // Setup color pickers + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); + document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); + document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); + document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); + document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); + document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); + + // Resize some elements + if (isVisible('stylesheetbrowser')) + document.getElementById('stylesheet').style.width = '220px'; + + if (isVisible('link_href_browser')) + document.getElementById('element_link_href').style.width = '230px'; + + if (isVisible('bgimage_browser')) + document.getElementById('bgimage').style.width = '210px'; + + // Update form + tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { + setVal(key, value); + }); + + FullPageDialog.changedStyle(); + + // Update colors + updateColor('textcolor_pick', 'textcolor'); + updateColor('bgcolor_pick', 'bgcolor'); + updateColor('visited_color_pick', 'visited_color'); + updateColor('active_color_pick', 'active_color'); + updateColor('link_color_pick', 'link_color'); + }; + + tinyMCEPopup.onInit.add(init); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js new file mode 100644 index 00000000..ecdff9ed --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.fullpage_dlg',{title:"Dokument-Eigenschaften","meta_tab":"Allgemein","appearance_tab":"Aussehen","advanced_tab":"Erweitert","meta_props":"Meta-Information",langprops:"Sprache und Codierung","meta_title":"Titel","meta_keywords":"Keywords","meta_description":"Beschreibung","meta_robots":"Robots",doctypes:"DocType",langcode:"Sprachcode",langdir:"Sprachrichtung",ltr:"Links nach Rechts",rtl:"Rechts nach Links","xml_pi":"XML Deklaration",encoding:"Zeichencodierung","appearance_bgprops":"Hintergrund-Eigenschaften","appearance_marginprops":"Abst\u00e4nde des Body","appearance_linkprops":"Linkfarben","appearance_textprops":"Text-Eigenschaften",bgcolor:"Hintergrundfarbe",bgimage:"Hintergrundbild","left_margin":"Linker Abstand","right_margin":"Rechter Abstand","top_margin":"Oberer Abstand","bottom_margin":"Unterer Abstand","text_color":"Textfarbe","font_size":"Schriftgr\u00f6\u00dfe","font_face":"Schriftart","link_color":"Linkfarbe","hover_color":"Hover-Farbe","visited_color":"Visited-Farbe","active_color":"Active-Farbe",textcolor:"Farbe",fontsize:"Schriftgr\u00f6\u00dfe",fontface:"Schriftart","meta_index_follow":"Indizieren und den Links folgen","meta_index_nofollow":"Indizieren, aber den Links nicht folgen","meta_noindex_follow":"Nicht indizieren, aber den Links folgen","meta_noindex_nofollow":"Nicht indizieren und auch nicht den Links folgen","appearance_style":"CSS-Stylesheet und Stileigenschaften",stylesheet:"CSS-Stylesheet",style:"CSS-Stil",author:"Autor",copyright:"Copyright",add:"Neues Element hinzuf\u00fcgen",remove:"Ausgew\u00e4hltes Element entfernen",moveup:"Ausgew\u00e4hltes Element nach oben bewegen",movedown:"Ausgew\u00e4hltes Element nach unten bewegen","head_elements":"\u00dcberschriftenelemente",info:"Information","add_title":"Titel-Element","add_meta":"Meta-Element","add_script":"Script-Element","add_style":"Style-Element","add_link":"Link-Element","add_base":"Base-Element","add_comment":"HTML-Kommentar","title_element":"Titel-Element","script_element":"Script-Element","style_element":"Style-Element","base_element":"Base-Element","link_element":"Link-Element","meta_element":"Meta_Element","comment_element":"Kommentar",src:"Src",language:"Sprache",href:"Href",target:"Ziel",type:"Typ",charset:"Zeichensatz",defer:"Defer",media:"Media",properties:"Eigenschaften",name:"Name",value:"Wert",content:"Inhalt",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"Allgemein","advanced_props":"Erweitert"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js new file mode 100644 index 00000000..516edc74 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.fullpage_dlg',{title:"Document Properties","meta_tab":"General","appearance_tab":"Appearance","advanced_tab":"Advanced","meta_props":"Meta Information",langprops:"Language and Encoding","meta_title":"Title","meta_keywords":"Keywords","meta_description":"Description","meta_robots":"Robots",doctypes:"Doctype",langcode:"Language Code",langdir:"Language Direction",ltr:"Left to Right",rtl:"Right to Left","xml_pi":"XML Declaration",encoding:"Character Encoding","appearance_bgprops":"Background Properties","appearance_marginprops":"Body Margins","appearance_linkprops":"Link Colors","appearance_textprops":"Text Properties",bgcolor:"Background Color",bgimage:"Background Image","left_margin":"Left Margin","right_margin":"Right Margin","top_margin":"Top Margin","bottom_margin":"Bottom Margin","text_color":"Text Color","font_size":"Font Size","font_face":"Font Face","link_color":"Link Color","hover_color":"Hover Color","visited_color":"Visited Color","active_color":"Active Color",textcolor:"Color",fontsize:"Font Size",fontface:"Font Family","meta_index_follow":"Index and Follow the Links","meta_index_nofollow":"Index and Don\'t Follow the Links","meta_noindex_follow":"Do Not Index but Follow the Links","meta_noindex_nofollow":"Do Not Index and Don\'t Follow the Links","appearance_style":"Stylesheet and Style Properties",stylesheet:"Stylesheet",style:"Style",author:"Author",copyright:"Copyright",add:"Add New Element",remove:"Remove Selected Element",moveup:"Move Selected Element Up",movedown:"Move Selected Element Down","head_elements":"Head Elements",info:"Information","add_title":"Title Element","add_meta":"Meta Element","add_script":"Script Element","add_style":"Style Element","add_link":"Link Element","add_base":"Base Element","add_comment":"Comment Node","title_element":"Title Element","script_element":"Script Element","style_element":"Style Element","base_element":"Base Element","link_element":"Link Element","meta_element":"Meta Element","comment_element":"Comment",src:"Source",language:"Language",href:"HREF",target:"Target",type:"Type",charset:"Charset",defer:"Defer",media:"Media",properties:"Properties",name:"Name",value:"Value",content:"Content",rel:"Rel",rev:"Rev",hreflang:"HREF Lang","general_props":"General","advanced_props":"Advanced"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js new file mode 100644 index 00000000..a6456f89 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js new file mode 100644 index 00000000..afa4f9b4 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js @@ -0,0 +1,159 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.FullScreenPlugin', { + init : function(ed, url) { + var t = this, s = {}, vp, posCss; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullScreen', function() { + var win, de = DOM.doc.documentElement; + + if (ed.getParam('fullscreen_is_enabled')) { + if (ed.getParam('fullscreen_new_window')) + closeFullscreen(); // Call to close in new window + else { + DOM.win.setTimeout(function() { + tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); + tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent()); + tinyMCE.remove(ed); + DOM.remove('mce_fullscreen_container'); + de.style.overflow = ed.getParam('fullscreen_html_overflow'); + DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); + DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); + tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings + }, 10); + } + + return; + } + + if (ed.getParam('fullscreen_new_window')) { + win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); + try { + win.resizeTo(screen.availWidth, screen.availHeight); + } catch (e) { + // Ignore + } + } else { + tinyMCE.oldSettings = tinyMCE.settings; // Store old settings + s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; + s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); + vp = DOM.getViewPort(); + s.fullscreen_scrollx = vp.x; + s.fullscreen_scrolly = vp.y; + + // Fixes an Opera bug where the scrollbars doesn't reappear + if (tinymce.isOpera && s.fullscreen_overflow == 'visible') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where horizontal scrollbars would appear + if (tinymce.isIE && s.fullscreen_overflow == 'scroll') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where the scrollbars doesn't reappear + if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) + s.fullscreen_html_overflow = 'auto'; + + if (s.fullscreen_overflow == '0px') + s.fullscreen_overflow = ''; + + DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); + de.style.overflow = 'hidden'; //Fix for IE6/7 + vp = DOM.getViewPort(); + DOM.win.scrollTo(0, 0); + + if (tinymce.isIE) + vp.h -= 1; + + // Use fixed position if it exists + if (tinymce.isIE6) + posCss = 'absolute;top:' + vp.y; + else + posCss = 'fixed;top:0'; + + n = DOM.add(DOM.doc.body, 'div', { + id : 'mce_fullscreen_container', + style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); + DOM.add(n, 'div', {id : 'mce_fullscreen'}); + + tinymce.each(ed.settings, function(v, n) { + s[n] = v; + }); + + s.id = 'mce_fullscreen'; + s.width = n.clientWidth; + s.height = n.clientHeight - 15; + s.fullscreen_is_enabled = true; + s.fullscreen_editor_id = ed.id; + s.theme_advanced_resizing = false; + s.save_onsavecallback = function() { + ed.setContent(tinyMCE.get(s.id).getContent()); + ed.execCommand('mceSave'); + }; + + tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { + s[k] = v; + }); + + if (s.theme_advanced_toolbar_location === 'external') + s.theme_advanced_toolbar_location = 'top'; + + t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); + t.fullscreenEditor.onInit.add(function() { + t.fullscreenEditor.setContent(ed.getContent()); + t.fullscreenEditor.focus(); + }); + + t.fullscreenEditor.render(); + + t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); + t.fullscreenElement.update(); + //document.body.overflow = 'hidden'; + + t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { + var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; + + // Get outer/inner size to get a delta size that can be used to calc the new iframe size + outerSize = fed.dom.getSize(fed.getContainer().firstChild); + innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); + + fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); + }); + } + }); + + // Register buttons + ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); + }); + }, + + getInfo : function() { + return { + longname : 'Fullscreen', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm new file mode 100644 index 00000000..ffe528e4 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm @@ -0,0 +1,110 @@ + + + + + + + + + +
                  + +
                  + + + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js new file mode 100644 index 00000000..623123ce --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("grappelli");var a=tinymce.DOM;tinymce.create("tinymce.plugins.Grappelli",{init:function(b,c){var d=this;tb=b.getParam("grappelli_adv_toolbar","toolbar2");documentstructure_css=c+"../../../themes/advanced/skins/grappelli/content_documentstructure_"+b.settings.language+".css";cookie_date=new Date();var e=cookie_date.getFullYear();cookie_date.setYear(e+1);cookie_grappelli_show_documentstructure=tinymce.util.Cookie.get("grappelli_show_documentstructure");if(cookie_grappelli_show_documentstructure!=null){b.settings.grappelli_show_documentstructure=cookie_grappelli_show_documentstructure}else{tinymce.util.Cookie.set("grappelli_show_documentstructure",b.settings.grappelli_show_documentstructure,cookie_date,"/")}b.onInit.add(function(){if("mce_fullscreen"==b.id){b.dom.addClass(b.dom.select("body"),"fullscreen")}if(b.settings.grappelli_adv_hidden){d._hide_adv_menu(b)}else{d._show_adv_menu(b)}if(b.settings.grappelli_show_documentstructure=="on"){d._show_documentstructure(b)}else{d._hide_documentstructure(b)}});b.addCommand("Grappelli_Adv",function(){if(a.isHidden(b.controlManager.get(tb).id)){d._show_adv_menu(b)}else{d._hide_adv_menu(b)}});b.addCommand("Grappelli_DocumentStructure",function(){i=b.controlManager;if(b.settings.grappelli_show_documentstructure=="on"){d._hide_documentstructure(b)}else{d._show_documentstructure(b)}});b.addButton("grappelli_adv",{title:"grappelli.grappelli_adv_desc",cmd:"Grappelli_Adv"});b.addButton("grappelli_documentstructure",{title:"grappelli.grappelli_documentstructure_desc",cmd:"Grappelli_DocumentStructure"});b.onBeforeExecCommand.add(function(f,h,g,j){if("mceFullScreen"!=h){return}if("mce_fullscreen"==f.id){base_ed=tinyMCE.get(f.settings.fullscreen_editor_id);if(!f.settings.grappelli_adv_hidden){d._show_adv_menu(base_ed)}else{d._hide_adv_menu(base_ed)}if(f.settings.grappelli_show_documentstructure=="on"){d._show_documentstructure(base_ed)}else{d._hide_documentstructure(base_ed)}}});b.addShortcut("alt+shift+z",b.getLang("grappelli_adv_desc"),"Grappelli_Adv")},_resizeIframe:function(e,d,c){var f=e.getContentAreaContainer().firstChild;a.setStyle(f,"height",f.clientHeight+c);e.theme.deltaHeight+=c},_show_documentstructure:function(b){head=b.getBody().previousSibling;var c=head.childNodes;for(var d=0;d= 0; i--) { + // c_cn = cn[i]; + // if (c_cn.nodeType == 3 || (!ed.dom.isBlock(c_cn) && c_cn.nodeType != 8)) { + // if (c_cn.nodeType != 3 || /[^\s]/g.test(c_cn.nodeValue)) { + // bl = ed.dom.create('p'); + // bl.appendChild(c_cn.cloneNode(1)); + // new_cn = c_cn.parentNode.replaceChild(bl, c_cn); + // // move caret + // r = ed.getDoc().createRange(); + // r.setStart(bl, bl.nodeValue ? bl.nodeValue.length : 0); + // r.setEnd(bl, bl.nodeValue ? bl.nodeValue.length : 0); + // ed.selection.setRng(r); + // } + // } + // } + // } + // }); + + }, + + // INTERNAL: RESIZE + _resizeIframe: function(ed, tb, b) { + var iframe = ed.getContentAreaContainer().firstChild; + DOM.setStyle(iframe, "height", iframe.clientHeight + b); + ed.theme.deltaHeight += b + }, + + // INTERNAL: SHOW/HIDE DOCUMENT STRUCTURE + _show_documentstructure: function(ed) { + head = ed.getBody().previousSibling; + var headChilds = head.childNodes; + + for (var i = 0; i < headChilds.length; i++) { + if (headChilds[i].nodeName == "LINK" + && headChilds[i].getAttribute('href') == documentstructure_css) { + // documentstructure_css is already set so... + return; + } + } + var vs_link = document.createElement("link"); + vs_link.rel="stylesheet"; + vs_link.mce_href = documentstructure_css; + vs_link.href = documentstructure_css; + head.appendChild(vs_link); + ed.settings.grappelli_show_documentstructure = 'on'; + tinymce.util.Cookie.set('grappelli_show_documentstructure', 'on', cookie_date, '/'); + ed.controlManager.setActive('grappelli_documentstructure', true); + }, + _hide_documentstructure: function(ed) { + head = ed.getBody().previousSibling; + vs_link = null; + + var headChilds = head.childNodes; + + for (var i = 0; i < headChilds.length; i++) { + if (headChilds[i].nodeName == "LINK" + && headChilds[i].getAttribute('href') == documentstructure_css) { + // found the node with documentstructure_css + vs_link = headChilds[i]; + break; + } + } + + if (vs_link !== null) { + // if we found the node with documentstructure_css, delete it + head.removeChild(vs_link); + ed.settings.grappelli_show_documentstructure = 'off'; + tinymce.util.Cookie.set('grappelli_show_documentstructure', 'off', cookie_date, '/'); + ed.controlManager.setActive('grappelli_documentstructure', false); + } + }, + + // INTERNAL: SHOW/HIDE ADVANCED MENU + _show_adv_menu: function(ed) { + ed.controlManager.setActive("grappelli_adv", 1); + DOM.show(ed.controlManager.get(tb).id); + this._resizeIframe(ed, tb, -28); + ed.settings.grappelli_adv_hidden = 0; + }, + _hide_adv_menu: function(ed) { + ed.controlManager.setActive("grappelli_adv", 0); + DOM.hide(ed.controlManager.get(tb).id); + this._resizeIframe(ed, tb, 28); + ed.settings.grappelli_adv_hidden = 1; + }, + + // GET INFO + getInfo: function() { + return { + longname: "Grappelli Plugin", + author: "vonautomatisch (patrick kranzlmueller)", + authorurl: "http://vonautomatisch.at", + infourl: "http://code.google.com/p/django-grappelli/", + version: "1.1" + } + } + + }); + + tinymce.PluginManager.add("grappelli", tinymce.plugins.Grappelli) + +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png new file mode 100644 index 00000000..466d68a3 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/img/show_advanced.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png new file mode 100644 index 00000000..3a6e6a9f Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/img/visualchars.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js new file mode 100644 index 00000000..b72068c8 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/de.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("de.grappelli",{ +grappelli_adv_desc:"Erweitertes Menü anzeigen/verbergen", +grappelli_documentstructure_desc:"Dokumentenstruktur anzeigen/verbergen", +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js new file mode 100644 index 00000000..c2647680 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/en.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("en.grappelli",{ +grappelli_adv_desc:"Show/Hide Advanced Menu", +grappelli_documentstructure_desc:"Show/Hide Document Structure", +}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js new file mode 100644 index 00000000..bbcccac7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/fr.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("fr.grappelli",{ +grappelli_adv_desc:"Basculer le menu avancé", +grappelli_documentstructure_desc:"Basculé la structure de document", +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js new file mode 100644 index 00000000..a34b0282 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/pl.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("pl.grappelli",{ +grappelli_adv_desc:"Pokaż/Ukryj zaawansowane menu", +grappelli_documentstructure_desc:"Pokaż/Ukryj strukturę dokumentu" +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js new file mode 100644 index 00000000..6ecdf067 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli/langs/ru.js @@ -0,0 +1,4 @@ +tinyMCE.addI18n("ru.grappelli",{ +grappelli_adv_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0435\u0020\u041c\u0435\u043d\u044e", +grappelli_documentstructure_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u0020\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430", +}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js new file mode 100644 index 00000000..17077ad5 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.PluginManager.requireLangPack("grappelli_contextmenu");var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e);d.addCommand("mcePBefore",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
                  ");pe.parentNode.insertBefore(new_p,pe)}});d.addCommand("mcePAfter",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
                  ");d.dom.insertAfter(new_p,pe)}});d.addCommand("mcePBeforeRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
                  ");pe.parentNode.insertBefore(new_p,pe)}});d.addCommand("mcePAfterRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){new_p=d.dom.create("p",{},"
                  ");d.dom.insertAfter(new_p,pe)}});d.addCommand("mceDelete",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){d.dom.remove(pe)}});d.addCommand("mceDeleteRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){d.dom.remove(pe)}});d.addCommand("mceMoveUp",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return g}},d.dom.getRoot());if(pe){pre_prev=f._getPreviousSibling(pe);if(pre_prev){pre_prev.parentNode.insertBefore(pe,pre_prev)}}});d.addCommand("mceMoveUpRoot",function(){ce=d.selection.getNode();pe=d.dom.getParent(ce,function(g){nn=g.nodeName;nn_p=g.parentNode.nodeName;if((nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE")&&nn_p=="BODY"){return g}},d.dom.getRoot());if(pe){pre_prev=f._getPreviousSibling(pe);if(pre_prev){pre_prev.parentNode.insertBefore(pe,pre_prev)}}})},getInfo:function(){return{longname:"Grappelli (Contextmenu)",author:"Patrick Kranzlmueller",authorurl:"http://vonautomatisch.at",infourl:"http://code.google.com/p/django-grappelli/",version:"0.1"}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;pe=h.dom.getParent(d,function(m){nn=m.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"){return m}},h.dom.getRoot());re=h.dom.getParent(d,function(m){nn=m.nodeName;nn_p=m.parentNode.nodeName;if(nn=="P"||nn=="H1"||nn=="H2"||nn=="H3"||nn=="H4"||nn=="H5"||nn=="H6"||nn=="UL"||nn=="OL"||nn=="BLOCKQUOTE"&&nn_p=="BODY"){return m}},h.dom.getRoot());title_prefix=pe.nodeName;title_prefix_root=re.nodeName;title_b_before="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpbefore_desc";title_b_after="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpafter_desc";title_b_before_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpbeforeroot_desc";title_b_after_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_insertpafterroot_desc";title_b_delete="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_delete_desc";title_b_delete_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_deleteroot_desc";title_b_moveup="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_moveup_desc";title_b_moveup_root="grappelli_contextmenu."+title_prefix+"_grappelli_contextmenu_moveuproot_desc";f.add({title:title_b_before,icon:"",cmd:"mcePBefore"});f.add({title:title_b_after,icon:"",cmd:"mcePAfter"});if(pe.parentNode.nodeName!="BODY"){f.addSeparator();f.add({title:title_b_before_root,icon:"",cmd:"mcePBeforeRoot"});f.add({title:title_b_after_root,icon:"",cmd:"mcePAfterRoot"})}f.addSeparator();f.add({title:title_b_delete,icon:"",cmd:"mceDelete"});if(pe.parentNode.nodeName!="BODY"){f.add({title:title_b_delete_root,icon:"",cmd:"mceDeleteRoot"})}f.addSeparator();f.add({title:title_b_moveup,icon:"",cmd:"mceMoveUp"});if(pe.parentNode.nodeName!="BODY"){f.add({title:title_b_moveup_root,icon:"",cmd:"mceMoveUpRoot"})}l.onContextMenu.dispatch(l,f,d,e);return f},_getPreviousSibling:function(e){var d=e.previousSibling;while(d&&(d.nodeType==document.TEXT_NODE||d.nodeType==document.CDATA_NODE)&&d.nodeValue.match(/^\s*$/)){d=d.previousSibling}return d}});tinymce.PluginManager.add("grappelli_contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js new file mode 100644 index 00000000..87b81d60 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/editor_plugin_src.js @@ -0,0 +1,250 @@ +(function() { + + tinymce.PluginManager.requireLangPack('grappelli_contextmenu'); + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.ContextMenu', { + init : function(ed) { + var t = this; + + t.editor = ed; + t.onContextMenu = new tinymce.util.Dispatcher(this); + + ed.onContextMenu.add(function(ed, e) { + if (!e.ctrlKey) { + t._getMenu(ed).showMenu(e.clientX, e.clientY); + Event.add(ed.getDoc(), 'click', hide); + Event.cancel(e); + } + }); + + function hide() { + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hide); + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + + // Register commands + // INSERT ELEMENTS + ed.addCommand('mcePBefore', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
                  '); + pe.parentNode.insertBefore(new_p, pe); + } + }); + ed.addCommand('mcePAfter', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
                  '); + ed.dom.insertAfter(new_p, pe); + } + }); + + // INSERT ROOT ELEMENTS + ed.addCommand('mcePBeforeRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
                  '); + pe.parentNode.insertBefore(new_p, pe); + } + }); + ed.addCommand('mcePAfterRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + new_p = ed.dom.create('p', {}, '
                  '); + ed.dom.insertAfter(new_p, pe); + } + }); + + // DELETE + ed.addCommand('mceDelete', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + ed.dom.remove(pe); + } + }); + + ed.addCommand('mceDeleteRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + ed.dom.remove(pe); + } + }); + + // MOVE + ed.addCommand('mceMoveUp', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + pre_prev = t._getPreviousSibling(pe); + if (pre_prev) { + pre_prev.parentNode.insertBefore(pe, pre_prev); + } + } + }); + ed.addCommand('mceMoveUpRoot', function() { + ce = ed.selection.getNode(); + pe = ed.dom.getParent(ce, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if ((nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + if (pe) { + pre_prev = t._getPreviousSibling(pe); + if (pre_prev) { + pre_prev.parentNode.insertBefore(pe, pre_prev); + } + } + }); + + }, + + getInfo : function() { + return { + longname : 'Grappelli (Contextmenu)', + author : 'Patrick Kranzlmueller', + authorurl : 'http://vonautomatisch.at', + infourl : 'http://code.google.com/p/django-grappelli/', + version : '0.1' + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1 + }); + + t._menu = m; + + // parent element + pe = ed.dom.getParent(el, function(n) { + nn = n.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE') { + return n; + } + }, ed.dom.getRoot()); + // root element + re = ed.dom.getParent(el, function(n) { + nn = n.nodeName; + nn_p = n.parentNode.nodeName; + if (nn == 'P' || nn == 'H1' || nn == 'H2' || nn == 'H3' || nn == 'H4' || nn == 'H5' || nn == 'H6' || nn == 'UL' || nn == 'OL' || nn == 'BLOCKQUOTE' && nn_p == 'BODY') { + return n; + } + }, ed.dom.getRoot()); + + title_prefix = pe.nodeName; + title_prefix_root = re.nodeName; + + title_b_before = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpbefore_desc'; + title_b_after = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpafter_desc'; + title_b_before_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpbeforeroot_desc'; + title_b_after_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_insertpafterroot_desc'; + title_b_delete = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_delete_desc'; + title_b_delete_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_deleteroot_desc'; + title_b_moveup = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_moveup_desc'; + title_b_moveup_root = 'grappelli_contextmenu.' + title_prefix + '_grappelli_contextmenu_moveuproot_desc'; + + m.add({title : title_b_before, icon : '', cmd : 'mcePBefore'}); + m.add({title : title_b_after, icon : '', cmd : 'mcePAfter'}); + + if (pe.parentNode.nodeName != "BODY") { + m.addSeparator(); + m.add({title : title_b_before_root, icon : '', cmd : 'mcePBeforeRoot'}); + m.add({title : title_b_after_root, icon : '', cmd : 'mcePAfterRoot'}); + } + + m.addSeparator(); + m.add({title : title_b_delete, icon : '', cmd : 'mceDelete'}); + if (pe.parentNode.nodeName != "BODY") { + m.add({title : title_b_delete_root, icon : '', cmd : 'mceDeleteRoot'}); + } + + m.addSeparator(); + m.add({title : title_b_moveup, icon : '', cmd : 'mceMoveUp'}); + if (pe.parentNode.nodeName != "BODY") { + m.add({title : title_b_moveup_root, icon : '', cmd : 'mceMoveUpRoot'}); + } + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + + }, + + _getPreviousSibling: function(obj) { + var prevNode = obj.previousSibling; + while(prevNode && (prevNode.nodeType == document.TEXT_NODE || prevNode.nodeType == document.CDATA_NODE) && prevNode.nodeValue.match(/^\s*$/)) { + prevNode = prevNode.previousSibling; + } + return prevNode; + } + + }); + + // Register plugin + tinymce.PluginManager.add('grappelli_contextmenu', tinymce.plugins.ContextMenu); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js new file mode 100644 index 00000000..b4b6080f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/de.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("de.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Absatz VOR aktuellem ELEMENT einfügen", +grappelli_contextmenu_insertpafter_desc:"Absatz NACH aktuellen ELEMENT einfügen", +grappelli_contextmenu_insertpbeforeroot_desc:"Absatz VOR aktuellem HAUPTELEMENT einfügen", +grappelli_contextmenu_insertpafterroot_desc:"Absatz NACH aktuellen HAUPTELEMENT einfügen", +grappelli_contextmenu_delete_desc:"Aktuelles ELEMENT löschen", +grappelli_contextmenu_deleteroot_desc:"Aktuelles HAUPTELEMENT löschen", +grappelli_contextmenu_moveup_desc:"Aktuelles ELEMENT NACH OBEN verschieben", +grappelli_contextmenu_moveuproot_desc:"Aktuelles HAUPTELEMENT NACH OBEN verschieben", + +P_grappelli_contextmenu_insertpbefore_desc:"Absatz VOR Absatz einfügen", +P_grappelli_contextmenu_insertpafter_desc:"Absatz NACH Absatz einfügen", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Absatz VOR Template einfügen", +P_grappelli_contextmenu_insertpafterroot_desc:"Absatz NACH Template einfügen", +P_grappelli_contextmenu_delete_desc:"Absatz löschen", +P_grappelli_contextmenu_deleteroot_desc:"Template löschen", +P_grappelli_contextmenu_moveup_desc:"Absatz NACH OBEN verschieben", +P_grappelli_contextmenu_moveuproot_desc:"Template NACH OBEN verschieben", + +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js new file mode 100644 index 00000000..29de91b7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/en.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("en.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Insert Paragraph BEFORE current element", +grappelli_contextmenu_insertpafter_desc:"Insert Paragraph AFTER current element", +grappelli_contextmenu_insertpbeforeroot_desc:"Insert Paragraph BEFORE current ROOT-LEVEL element", +grappelli_contextmenu_insertpafterroot_desc:"Insert Paragraph AFTER current ROOT-LEVEL element", +grappelli_contextmenu_delete_desc:"Delete current element", +grappelli_contextmenu_deleteroot_desc:"Delete current ROOT-LEVEL element", +grappelli_contextmenu_moveup_desc:"MOVE UP current ELEMENT", +grappelli_contextmenu_moveuproot_desc:"MOVE UP current ROOT-LEVEL element", + +P_grappelli_contextmenu_insertpbefore_desc:"Insert Paragraph BEFORE current element", +P_grappelli_contextmenu_insertpafter_desc:"Insert Paragraph AFTER current element", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Insert Paragraph BEFORE current ROOT-LEVEL element", +P_grappelli_contextmenu_insertpafterroot_desc:"Insert Paragraph AFTER current ROOT-LEVEL element", +P_grappelli_contextmenu_delete_desc:"Delete current element", +P_grappelli_contextmenu_deleteroot_desc:"Delete current ROOT-LEVEL element", +P_grappelli_contextmenu_moveup_desc:"MOVE UP current ELEMENT", +P_grappelli_contextmenu_moveuproot_desc:"MOVE UP current ROOT-LEVEL element", + +}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js new file mode 100644 index 00000000..168e4b85 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/fr.js @@ -0,0 +1,10 @@ +tinyMCE.addI18n("fr.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Insérer Paragraph AVANT la sélection", +grappelli_contextmenu_insertpafter_desc:"Insérer Paragraph APRÈS la sélection", +grappelli_contextmenu_insertpbeforeroot_desc:"Insérer Paragraph AVANT la racine de la sélection", +grappelli_contextmenu_insertpafterroot_desc:"Insérer Paragraph APRÈS la racine de la sélection", +grappelli_contextmenu_delete_desc:"Supprimer la sélection", +grappelli_contextmenu_deleteroot_desc:"Supprimer la racine de la sélection", +grappelli_contextmenu_moveup_desc:"Monter la sélection", +grappelli_contextmenu_moveuproot_desc:"Monter la racine de la sélection", +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js new file mode 100644 index 00000000..0d90c7cf --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/pl.js @@ -0,0 +1,19 @@ +tinyMCE.addI18n("pl.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"Wstaw paragraf PRZED aktualnym elementem", +grappelli_contextmenu_insertpafter_desc:"Wstaw paragraf PO aktualnym elemencie", +grappelli_contextmenu_insertpbeforeroot_desc:"Wstaw paragraf PRZED aktualnym BAZOWYM elementem", +grappelli_contextmenu_insertpafterroot_desc:"Wstaw paragraf PO aktualnym BAZOWYM elemencie", +grappelli_contextmenu_delete_desc:"Usuń aktualny element", +grappelli_contextmenu_deleteroot_desc:"Usuń aktualny BAZOWY element", +grappelli_contextmenu_moveup_desc:"PRZENIEŚ aktualny ELEMENT WYŻEJ", +grappelli_contextmenu_moveuproot_desc:"PRZENIEŚ aktualny BAZOWY element WYŻEJ", + +P_grappelli_contextmenu_insertpbefore_desc:"Wstaw paragraf PRZED aktualnym elementem", +P_grappelli_contextmenu_insertpafter_desc:"Wstaw paragraf PO aktualnym elemencie", +P_grappelli_contextmenu_insertpbeforeroot_desc:"Wstaw paragraf PRZED aktualnym BAZOWYM elementem", +P_grappelli_contextmenu_insertpafterroot_desc:"Wstaw paragraf PO aktualnym BAZOWYM elemencie", +P_grappelli_contextmenu_delete_desc:"Usuń aktualny element", +P_grappelli_contextmenu_deleteroot_desc:"Usuń aktualny BAZOWY element", +P_grappelli_contextmenu_moveup_desc:"PRZENIEŚ aktualny ELEMENT WYŻEJ", +P_grappelli_contextmenu_moveuproot_desc:"PRZENIEŚ aktualny BAZOWY element WYŻEJ" +}); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js new file mode 100644 index 00000000..c069407d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/grappelli_contextmenu/langs/ru.js @@ -0,0 +1,20 @@ +tinyMCE.addI18n("ru.grappelli_contextmenu",{ +grappelli_contextmenu_insertpbefore_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +grappelli_contextmenu_insertpafter_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +grappelli_contextmenu_insertpbeforeroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u042b\u041c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +grappelli_contextmenu_insertpafterroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0413\u041e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +grappelli_contextmenu_delete_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +grappelli_contextmenu_deleteroot_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +grappelli_contextmenu_moveup_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u042d\u041b\u0415\u041c\u0415\u041d\u0422", +grappelli_contextmenu_moveuproot_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", + +P_grappelli_contextmenu_insertpbefore_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +P_grappelli_contextmenu_insertpafter_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +P_grappelli_contextmenu_insertpbeforeroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u0415\u0420\u0415\u0414\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u042b\u041c\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c", +P_grappelli_contextmenu_insertpafterroot_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0020\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0020\u041f\u041e\u0421\u041b\u0415\u0020\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0413\u041e\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430", +P_grappelli_contextmenu_delete_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +P_grappelli_contextmenu_deleteroot_desc:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", +P_grappelli_contextmenu_moveup_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u042d\u041b\u0415\u041c\u0415\u041d\u0422", +P_grappelli_contextmenu_moveuproot_desc:"\u0421\u0414\u0412\u0418\u041d\u0423\u0422\u042c\u0020\u0412\u0412\u0415\u0420\u0425\u0020\u0442\u0435\u043a\u0443\u0449\u0438\u0439\u0020\u041a\u041e\u0420\u041d\u0415\u0412\u041e\u0419\u0020\u044d\u043b\u0435\u043c\u0435\u043d\u0442", + +}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js new file mode 100644 index 00000000..e9cba106 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js new file mode 100644 index 00000000..1b2bb984 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.IESpell', { + init : function(ed, url) { + var t = this, sp; + + if (!tinymce.isIE) + return; + + t.editor = ed; + + // Register commands + ed.addCommand('mceIESpell', function() { + try { + sp = new ActiveXObject("ieSpell.ieSpellExtension"); + sp.CheckDocumentNode(ed.getDoc().documentElement); + } catch (e) { + if (e.number == -2146827859) { + ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { + if (s) + window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); + }); + } else + ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); + } + }); + + // Register buttons + ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); + }, + + getInfo : function() { + return { + longname : 'IESpell (IE Only)', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js new file mode 100644 index 00000000..8bb96f9c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","
                  "));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceClose"){z.close(null,i);return a.cancel(t)}else{if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js new file mode 100644 index 00000000..67123ca3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js @@ -0,0 +1,699 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; + + tinymce.create('tinymce.plugins.InlinePopups', { + init : function(ed, url) { + // Replace window manager + ed.onBeforeRenderUI.add(function() { + ed.windowManager = new tinymce.InlineWindowManager(ed); + DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); + }); + }, + + getInfo : function() { + return { + longname : 'InlinePopups', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { + InlineWindowManager : function(ed) { + var t = this; + + t.parent(ed); + t.zIndex = 300000; + t.count = 0; + t.windows = {}; + }, + + open : function(f, p) { + var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; + + f = f || {}; + p = p || {}; + + // Run native windows + if (!f.inline) + return t.parent(f, p); + + parentWindow = t._frontWindow(); + if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { + parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; + } + + // Only store selection if the type is a normal window + if (!f.type) + t.bookmark = ed.selection.getBookmark(1); + + id = DOM.uniqueId(); + vp = DOM.getViewPort(); + f.width = parseInt(f.width || 320); + f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); + f.min_width = parseInt(f.min_width || 150); + f.min_height = parseInt(f.min_height || 100); + f.max_width = parseInt(f.max_width || 2000); + f.max_height = parseInt(f.max_height || 2000); + f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); + f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); + f.movable = f.resizable = true; + p.mce_width = f.width; + p.mce_height = f.height; + p.mce_inline = true; + p.mce_window_id = id; + p.mce_auto_focus = f.auto_focus; + + // Transpose +// po = DOM.getPos(ed.getContainer()); +// f.left -= po.x; +// f.top -= po.y; + + t.features = f; + t.params = p; + t.onOpen.dispatch(t, f, p); + + if (f.type) { + opt += ' mceModal'; + + if (f.type) + opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); + + f.resizable = false; + } + + if (f.statusbar) + opt += ' mceStatusbar'; + + if (f.resizable) + opt += ' mceResizable'; + + if (f.minimizable) + opt += ' mceMinimizable'; + + if (f.maximizable) + opt += ' mceMaximizable'; + + if (f.movable) + opt += ' mceMovable'; + + // Create DOM objects + t._addAll(DOM.doc.body, + ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, + ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, + ['div', {id : id + '_top', 'class' : 'mceTop'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_title'}, f.title || ''] + ], + + ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, + ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], + ['span', {id : id + '_content'}], + ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] + ], + + ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_status'}, 'Content'] + ], + + ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], + ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] + ] + ] + ); + + DOM.setStyles(id, {top : -10000, left : -10000}); + + // Fix gecko rendering bug, where the editors iframe messed with window contents + if (tinymce.isGecko) + DOM.setStyle(id, 'overflow', 'auto'); + + // Measure borders + if (!f.type) { + dw += DOM.get(id + '_left').clientWidth; + dw += DOM.get(id + '_right').clientWidth; + dh += DOM.get(id + '_top').clientHeight; + dh += DOM.get(id + '_bottom').clientHeight; + } + + // Resize window + DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); + + u = f.url || f.file; + if (u) { + if (tinymce.relaxedDomain) + u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; + + u = tinymce._addVer(u); + } + + if (!f.type) { + DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); + DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); + DOM.setAttrib(id + '_ifr', 'src', u); + } else { + DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); + + if (f.type == 'confirm') + DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); + + DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); + DOM.setHTML(id + '_content', f.content.replace('\n', '
                  ')); + + Event.add(id, 'keyup', function(evt) { + var VK_ESCAPE = 27; + if (evt.keyCode === VK_ESCAPE) { + f.button_func(false); + return Event.cancel(evt); + } + }); + + Event.add(id, 'keydown', function(evt) { + var cancelButton, VK_TAB = 9; + if (evt.keyCode === VK_TAB) { + cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; + if (cancelButton && cancelButton !== evt.target) { + cancelButton.focus(); + } else { + DOM.get(id + '_ok').focus(); + } + return Event.cancel(evt); + } + }); + } + + // Register events + mdf = Event.add(id, 'mousedown', function(e) { + var n = e.target, w, vp; + + w = t.windows[id]; + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + if (n.className == 'mceClose') { + t.close(null, id); + return Event.cancel(e); + } else if (n.className == 'mceMax') { + w.oldPos = w.element.getXY(); + w.oldSize = w.element.getSize(); + + vp = DOM.getViewPort(); + + // Reduce viewport size to avoid scrollbars + vp.w -= 2; + vp.h -= 2; + + w.element.moveTo(vp.x, vp.y); + w.element.resizeTo(vp.w, vp.h); + DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); + DOM.addClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMed') { + // Reset to old size + w.element.moveTo(w.oldPos.x, w.oldPos.y); + w.element.resizeTo(w.oldSize.w, w.oldSize.h); + w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); + + DOM.removeClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMove') + return t._startDrag(id, e, n.className); + else if (DOM.hasClass(n, 'mceResize')) + return t._startDrag(id, e, n.className.substring(13)); + } + }); + + clf = Event.add(id, 'click', function(e) { + var n = e.target; + + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + switch (n.className) { + case 'mceClose': + t.close(null, id); + return Event.cancel(e); + + case 'mceButton mceOk': + case 'mceButton mceCancel': + f.button_func(n.className == 'mceButton mceOk'); + return Event.cancel(e); + } + } + }); + + // Make sure the tab order loops within the dialog. + Event.add([id + '_left', id + '_right'], 'focus', function(evt) { + var iframe = DOM.get(id + '_ifr'); + if (iframe) { + var body = iframe.contentWindow.document.body; + var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); + if (evt.target.id === (id + '_left')) { + focusable[focusable.length - 1].focus(); + } else { + focusable[0].focus(); + } + } else { + DOM.get(id + '_ok').focus(); + } + }); + + // Add window + w = t.windows[id] = { + id : id, + mousedown_func : mdf, + click_func : clf, + element : new Element(id, {blocker : 1, container : ed.getContainer()}), + iframeElement : new Element(id + '_ifr'), + features : f, + deltaWidth : dw, + deltaHeight : dh + }; + + w.iframeElement.on('focus', function() { + t.focus(id); + }); + + // Setup blocker + if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { + DOM.add(DOM.doc.body, 'div', { + id : 'mceModalBlocker', + 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', + style : {zIndex : t.zIndex - 1} + }); + + DOM.show('mceModalBlocker'); // Reduces flicker in IE + DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); + } else + DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); + + if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) + DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); + + DOM.setAttrib(id, 'aria-hidden', 'false'); + t.focus(id); + t._fixIELayout(id, 1); + + // Focus ok button + if (DOM.get(id + '_ok')) + DOM.get(id + '_ok').focus(); + t.count++; + + return w; + }, + + focus : function(id) { + var t = this, w; + + if (w = t.windows[id]) { + w.zIndex = this.zIndex++; + w.element.setStyle('zIndex', w.zIndex); + w.element.update(); + + id = id + '_wrapper'; + DOM.removeClass(t.lastId, 'mceFocus'); + DOM.addClass(id, 'mceFocus'); + t.lastId = id; + + if (w.focussedElement) { + w.focussedElement.focus(); + } else if (DOM.get(id + '_ok')) { + DOM.get(w.id + '_ok').focus(); + } else if (DOM.get(w.id + '_ifr')) { + DOM.get(w.id + '_ifr').focus(); + } + } + }, + + _addAll : function(te, ne) { + var i, n, t = this, dom = tinymce.DOM; + + if (is(ne, 'string')) + te.appendChild(dom.doc.createTextNode(ne)); + else if (ne.length) { + te = te.appendChild(dom.create(ne[0], ne[1])); + + for (i=2; i ix) { + fw = w; + ix = w.zIndex; + } + }); + return fw; + }, + + setTitle : function(w, ti) { + var e; + + w = this._findId(w); + + if (e = DOM.get(w + '_title')) + e.innerHTML = DOM.encode(ti); + }, + + alert : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'alert', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + confirm : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'confirm', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + // Internal functions + + _findId : function(w) { + var t = this; + + if (typeof(w) == 'string') + return w; + + each(t.windows, function(wo) { + var ifr = DOM.get(wo.id + '_ifr'); + + if (ifr && w == ifr.contentWindow) { + w = wo.id; + return false; + } + }); + + return w; + }, + + _fixIELayout : function(id, s) { + var w, img; + + if (!tinymce.isIE6) + return; + + // Fixes the bug where hover flickers and does odd things in IE6 + each(['n','s','w','e','nw','ne','sw','se'], function(v) { + var e = DOM.get(id + '_resize_' + v); + + DOM.setStyles(e, { + width : s ? e.clientWidth : '', + height : s ? e.clientHeight : '', + cursor : DOM.getStyle(e, 'cursor', 1) + }); + + DOM.setStyle(id + "_bottom", 'bottom', '-1px'); + + e = 0; + }); + + // Fixes graphics glitch + if (w = this.windows[id]) { + // Fixes rendering bug after resize + w.element.hide(); + w.element.show(); + + // Forced a repaint of the window + //DOM.get(id).style.filter = ''; + + // IE has a bug where images used in CSS won't get loaded + // sometimes when the cache in the browser is disabled + // This fix tries to solve it by loading the images using the image object + each(DOM.select('div,a', id), function(e, i) { + if (e.currentStyle.backgroundImage != 'none') { + img = new Image(); + img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); + } + }); + + DOM.get(id).style.filter = ''; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); +})(); + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif new file mode 100644 index 00000000..21913985 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif new file mode 100644 index 00000000..f957e49a Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif new file mode 100644 index 00000000..6baf64ad Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif new file mode 100644 index 00000000..20acbbf7 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif new file mode 100644 index 00000000..d5de1cc2 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif new file mode 100644 index 00000000..c2a2ad45 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif new file mode 100644 index 00000000..0b4cc368 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css new file mode 100644 index 00000000..a50d4fc5 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -0,0 +1,90 @@ +/* Clearlooks 2 */ + +/* Reset */ +.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} + +/* General */ +.clearlooks2 {position:absolute; direction:ltr} +.clearlooks2 .mceWrapper {position:static} +.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} +.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} +.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} + +/* Top */ +.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} +.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} +.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} +.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} +.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} +.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} +.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} +.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} +.clearlooks2 .mceFocus .mceTop span {color:#FFF} + +/* Middle */ +.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} +.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} +.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} +.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} +.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} + +/* Bottom */ +.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} +.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} +.clearlooks2 .mceBottom div {top:0} +.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} +.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} +.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} +.clearlooks2 .mceBottom span {display:none} +.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} +.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} +.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} +.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} +.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} + +/* Actions */ +.clearlooks2 a {width:29px; height:16px; top:3px;} +.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} +.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} +.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} +.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} +.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} +.clearlooks2 .mceMovable .mceMove {display:block} +.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} +.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} +.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} +.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} +.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} +.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} + +/* Resize */ +.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} +.clearlooks2 .mceResizable .mceResize {display:block} +.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} +.clearlooks2 .mceMinimizable .mceMin {display:block} +.clearlooks2 .mceMaximizable .mceMax {display:block} +.clearlooks2 .mceMaximized .mceMed {display:block} +.clearlooks2 .mceMaximized .mceMax {display:none} +.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} +.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} +.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} +.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} +.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} +.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} +.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} +.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} + +/* Alert/Confirm */ +.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} +.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} +.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} +.clearlooks2 a:hover {font-weight:bold;} +.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} +.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} +.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} +.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} +.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} +.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm new file mode 100644 index 00000000..f9ec6421 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm @@ -0,0 +1,387 @@ + + + +Template for dialogs + + + + +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Blured +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Focused +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Statusbar +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Statusbar, Resizable +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Resizable, Maximizable +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Blurred, Maximizable, Statusbar, Resizable +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Maximized, Maximizable, Minimizable +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Blured +
                  + +
                  +
                  + Content +
                  +
                  + +
                  +
                  +
                  +
                  + Statusbar text. +
                  + + + + + + + + + + + + + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Alert +
                  + +
                  +
                  + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + + + Ok + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  + Confirm +
                  + +
                  +
                  + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + + + Ok + Cancel + +
                  +
                  +
                  + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js new file mode 100644 index 00000000..938ce6b1 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;gh[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js new file mode 100644 index 00000000..daed2806 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js @@ -0,0 +1,262 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + function findParentLayer(node) { + do { + if (node.className && node.className.indexOf('mceItemLayer') != -1) { + return node; + } + } while (node = node.parentNode); + }; + + tinymce.create('tinymce.plugins.Layer', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceInsertLayer', t._insertLayer, t); + + ed.addCommand('mceMoveForward', function() { + t._move(1); + }); + + ed.addCommand('mceMoveBackward', function() { + t._move(-1); + }); + + ed.addCommand('mceMakeAbsolute', function() { + t._toggleAbsolute(); + }); + + // Register buttons + ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); + ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); + ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); + ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); + + ed.onInit.add(function() { + var dom = ed.dom; + + if (tinymce.isIE) + ed.getDoc().execCommand('2D-Position', false, true); + }); + + // Remove serialized styles when selecting a layer since it might be changed by a drag operation + ed.onMouseUp.add(function(ed, e) { + var layer = findParentLayer(e.target); + + if (layer) { + ed.dom.setAttrib(layer, 'data-mce-style', ''); + } + }); + + // Fixes edit focus issues with layers on Gecko + // This will enable designMode while inside a layer and disable it when outside + ed.onMouseDown.add(function(ed, e) { + var node = e.target, doc = ed.getDoc(), parent; + + if (tinymce.isGecko) { + if (findParentLayer(node)) { + if (doc.designMode !== 'on') { + doc.designMode = 'on'; + + // Repaint caret + node = doc.body; + parent = node.parentNode; + parent.removeChild(node); + parent.appendChild(node); + } + } else if (doc.designMode == 'on') { + doc.designMode = 'off'; + } + } + }); + + ed.onNodeChange.add(t._nodeChange, t); + ed.onVisualAid.add(t._visualAid, t); + }, + + getInfo : function() { + return { + longname : 'Layer', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var le, p; + + le = this._getParentLayer(n); + p = ed.dom.getParent(n, 'DIV,P,IMG'); + + if (!p) { + cm.setDisabled('absolute', 1); + cm.setDisabled('moveforward', 1); + cm.setDisabled('movebackward', 1); + } else { + cm.setDisabled('absolute', 0); + cm.setDisabled('moveforward', !le); + cm.setDisabled('movebackward', !le); + cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); + } + }, + + // Private methods + + _visualAid : function(ed, e, s) { + var dom = ed.dom; + + tinymce.each(dom.select('div,p', e), function(e) { + if (/^(absolute|relative|fixed)$/i.test(e.style.position)) { + if (s) + dom.addClass(e, 'mceItemVisualAid'); + else + dom.removeClass(e, 'mceItemVisualAid'); + + dom.addClass(e, 'mceItemLayer'); + } + }); + }, + + _move : function(d) { + var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; + + nl = []; + tinymce.walk(ed.getBody(), function(n) { + if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) + nl.push(n); + }, 'childNodes'); + + // Find z-indexes + for (i=0; i -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else { + if (z[ci] > 0) + nl[ci].style.zIndex = z[ci] - 1; + } + } else { + // Move forward + + // Try find a higher one + for (i=0; i z[ci]) { + fi = i; + break; + } + } + + if (fi > -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else + nl[ci].style.zIndex = z[ci] + 1; + } + + ed.execCommand('mceRepaint'); + }, + + _getParentLayer : function(n) { + return this.editor.dom.getParent(n, function(n) { + return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); + }); + }, + + _insertLayer : function() { + var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody(); + + ed.dom.add(body, 'div', { + style : { + position : 'absolute', + left : p.x, + top : (p.y > 20 ? p.y : 20), + width : 100, + height : 100 + }, + 'class' : 'mceItemVisualAid mceItemLayer' + }, ed.selection.getContent() || ed.getLang('layer.content')); + + // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 + if (tinymce.isIE) + dom.setHTML(body, body.innerHTML); + }, + + _toggleAbsolute : function() { + var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); + + if (!le) + le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); + + if (le) { + if (le.style.position.toLowerCase() == "absolute") { + ed.dom.setStyles(le, { + position : '', + left : '', + top : '', + width : '', + height : '' + }); + + ed.dom.removeClass(le, 'mceItemVisualAid'); + ed.dom.removeClass(le, 'mceItemLayer'); + } else { + if (le.style.left == "") + le.style.left = 20 + 'px'; + + if (le.style.top == "") + le.style.top = 20 + 'px'; + + if (le.style.width == "") + le.style.width = le.width ? (le.width + 'px') : '100px'; + + if (le.style.height == "") + le.style.height = le.height ? (le.height + 'px') : '100px'; + + le.style.position = "absolute"; + + ed.dom.setAttrib(le, 'data-mce-style', ''); + ed.addVisual(ed.getBody()); + } + + ed.execCommand('mceRepaint'); + ed.nodeChanged(); + } + } + }); + + // Register plugin + tinymce.PluginManager.add('layer', tinymce.plugins.Layer); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js new file mode 100644 index 00000000..b3a4ce31 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js @@ -0,0 +1 @@ +(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js new file mode 100644 index 00000000..e627ec76 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js @@ -0,0 +1,139 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + * + * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align + * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash + * + * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are + * not apart of the newer specifications for HTML and XHTML. + */ + +(function(tinymce) { + // Override inline_styles setting to force TinyMCE to produce deprecated contents + tinymce.onAddEditor.addToTop(function(tinymce, editor) { + editor.settings.inline_styles = false; + }); + + // Create the legacy ouput plugin + tinymce.create('tinymce.plugins.LegacyOutput', { + init : function(editor) { + editor.onInit.add(function() { + var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', + fontSizes = tinymce.explode(editor.settings.font_size_style_values), + schema = editor.schema; + + // Override some internal formats to produce legacy elements and attributes + editor.formatter.register({ + // Change alignment formats to use the deprecated align attribute + alignleft : {selector : alignElements, attributes : {align : 'left'}}, + aligncenter : {selector : alignElements, attributes : {align : 'center'}}, + alignright : {selector : alignElements, attributes : {align : 'right'}}, + alignfull : {selector : alignElements, attributes : {align : 'justify'}}, + + // Change the basic formatting elements to use deprecated element types + bold : [ + {inline : 'b', remove : 'all'}, + {inline : 'strong', remove : 'all'}, + {inline : 'span', styles : {fontWeight : 'bold'}} + ], + italic : [ + {inline : 'i', remove : 'all'}, + {inline : 'em', remove : 'all'}, + {inline : 'span', styles : {fontStyle : 'italic'}} + ], + underline : [ + {inline : 'u', remove : 'all'}, + {inline : 'span', styles : {textDecoration : 'underline'}, exact : true} + ], + strikethrough : [ + {inline : 'strike', remove : 'all'}, + {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true} + ], + + // Change font size and font family to use the deprecated font element + fontname : {inline : 'font', attributes : {face : '%value'}}, + fontsize : { + inline : 'font', + attributes : { + size : function(vars) { + return tinymce.inArray(fontSizes, vars.value) + 1; + } + } + }, + + // Setup font elements for colors as well + forecolor : {inline : 'font', styles : {color : '%value'}}, + hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} + }); + + // Check that deprecated elements are allowed if not add them + tinymce.each('b,i,u,strike'.split(','), function(name) { + schema.addValidElements(name + '[*]'); + }); + + // Add font element if it's missing + if (!schema.getElementRule("font")) + schema.addValidElements("font[face|size|color|style]"); + + // Add the missing and depreacted align attribute for the serialization engine + tinymce.each(alignElements.split(','), function(name) { + var rule = schema.getElementRule(name), found; + + if (rule) { + if (!rule.attributes.align) { + rule.attributes.align = {}; + rule.attributesOrder.push('align'); + } + } + }); + + // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes + editor.onNodeChange.add(function(editor, control_manager) { + var control, fontElm, fontName, fontSize; + + // Find font element get it's name and size + fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); + if (fontElm) { + fontName = fontElm.face; + fontSize = fontElm.size; + } + + // Select/unselect the font name in droplist + if (control = control_manager.get('fontselect')) { + control.select(function(value) { + return value == fontName; + }); + } + + // Select/unselect the font size in droplist + if (control = control_manager.get('fontsizeselect')) { + control.select(function(value) { + var index = tinymce.inArray(fontSizes, value.fontSize); + + return index + 1 == fontSize; + }); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'LegacyOutput', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); +})(tinymce); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js new file mode 100644 index 00000000..f07e3725 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js @@ -0,0 +1 @@ +(function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{return v&&u.tagName==="P"&&t.tagName==="P"}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(y){var v="TABBING";var s="EMPTY";var J="ESCAPE";var z="PARAGRAPH";var N="UNKNOWN";var x=N;function E(U){return U.keyCode===tinymce.VK.TAB&&!(U.altKey||U.ctrlKey)&&(y.queryCommandState("InsertUnorderedList")||y.queryCommandState("InsertOrderedList"))}function w(){var U=B();var W=U.parentNode.parentNode;var V=U.parentNode.lastChild===U;return V&&!t(W)&&P(U)}function t(U){if(n(U)){return U.parentNode&&U.parentNode.tagName==="LI"}else{return U.tagName==="LI"}}function F(){return y.selection.isCollapsed()&&P(B())}function B(){var U=y.selection.getStart();return((U.tagName=="BR"||U.tagName=="")&&U.parentNode.tagName=="LI")?U.parentNode:U}function P(U){var V=U.childNodes.length;if(U.tagName==="LI"){return V==0?true:V==1&&(U.firstChild.tagName==""||U.firstChild.tagName=="BR"||H(U))}return false}function H(U){var V=tinymce.grep(U.parentNode.childNodes,function(Y){return Y.tagName=="LI"});var W=U==V[V.length-1];var X=U.firstChild;return tinymce.isIE9&&W&&(X.nodeValue==String.fromCharCode(160)||X.nodeValue==String.fromCharCode(32))}function T(U){return U.keyCode===tinymce.VK.ENTER}function A(U){return T(U)&&!U.shiftKey}function M(U){if(E(U)){return v}else{if(A(U)&&w()){return N}else{if(A(U)&&F()){return s}else{return N}}}}function D(U,V){if(x==v||x==s||tinymce.isGecko&&x==J){r.cancel(V)}}function C(){var U=y.selection.getRng(true);var V=U.startContainer;if(V.nodeType==3){var W=V.nodeValue;if(tinymce.isIE9&&W.length>1&&W.charCodeAt(W.length-1)==32){return(U.endOffset==W.length-1)}else{return(U.endOffset==W.length)}}else{if(V.nodeType==1){return U.endOffset==V.childNodes.length}}return false}function I(){var W=y.selection.getNode();var V="h1,h2,h3,h4,h5,h6,p,div";var U=y.dom.is(W,V)&&W.parentNode.tagName==="LI"&&W.parentNode.lastChild===W;return y.selection.isCollapsed()&&U&&C()}function K(W,Y){if(A(Y)&&I()){var X=W.selection.getNode();var V=W.dom.create("li");var U=W.dom.getParent(X,"li");W.dom.insertAfter(V,U);if(tinymce.isIE6||tinymce.isIE7||tinyMCE.isIE8){W.selection.setCursorLocation(V,1)}else{W.selection.setCursorLocation(V,0)}Y.preventDefault()}}function u(X,Z){var ac;if(!tinymce.isGecko){return}var V=X.selection.getStart();if(Z.keyCode!=tinymce.VK.BACKSPACE||V.tagName!=="IMG"){return}function W(ag){var ah=ag.firstChild;var af=null;do{if(!ah){break}if(ah.tagName==="LI"){af=ah}}while(ah=ah.nextSibling);return af}function ae(ag,af){while(ag.childNodes.length>0){af.appendChild(ag.childNodes[0])}}ac=V.parentNode.previousSibling;if(!ac){return}var aa;if(ac.tagName==="UL"||ac.tagName==="OL"){aa=ac}else{if(ac.previousSibling&&(ac.previousSibling.tagName==="UL"||ac.previousSibling.tagName==="OL")){aa=ac.previousSibling}else{return}}var ad=W(aa);var U=X.dom.createRng();U.setStart(ad,1);U.setEnd(ad,1);X.selection.setRng(U);X.selection.collapse(true);var Y=X.selection.getBookmark();var ab=V.parentNode.cloneNode(true);if(ab.tagName==="P"||ab.tagName==="DIV"){ae(ab,ad)}else{ad.appendChild(ab)}V.parentNode.parentNode.removeChild(V.parentNode);X.selection.moveToBookmark(Y)}function G(U){var V=y.dom.getParent(U,"ol,ul");if(V!=null){var W=V.lastChild;y.selection.setCursorLocation(W,0)}}this.ed=y;y.addCommand("Indent",this.indent,this);y.addCommand("Outdent",this.outdent,this);y.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);y.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);y.onInit.add(function(){y.editorCommands.addCommands({outdent:function(){var V=y.selection,W=y.dom;function U(X){X=W.getParent(X,W.isBlock);return X&&(parseInt(y.dom.getStyle(X,"margin-left")||0,10)+parseInt(y.dom.getStyle(X,"padding-left")||0,10))>0}return U(V.getStart())||U(V.getEnd())||y.queryCommandState("InsertOrderedList")||y.queryCommandState("InsertUnorderedList")}},"state")});y.onKeyUp.add(function(V,W){if(x==v){V.execCommand(W.shiftKey?"Outdent":"Indent",true,null);x=N;return r.cancel(W)}else{if(x==s){var U=B();var Y=V.settings.list_outdent_on_enter===true||W.shiftKey;V.execCommand(Y?"Outdent":"Indent",true,null);if(tinymce.isIE){G(U)}return r.cancel(W)}else{if(x==J){if(tinymce.isIE6||tinymce.isIE7||tinymce.isIE8){var X=V.getDoc().createTextNode("\uFEFF");V.selection.getNode().appendChild(X)}else{if(tinymce.isIE9||tinymce.isGecko){V.execCommand("Outdent");return r.cancel(W)}}}}}});function L(V,U){var W=y.getDoc().createTextNode("\uFEFF");V.insertBefore(W,U);y.selection.setCursorLocation(W,0);y.execCommand("mceRepaint")}function R(V,X){if(T(X)){var U=B();if(U){var W=U.parentNode;var Y=W&&W.parentNode;if(Y&&Y.nodeName=="LI"&&Y.firstChild==W&&U==W.firstChild){L(Y,W)}}}}function S(V,X){if(T(X)){var U=B();if(V.dom.select("ul li",U).length===1){var W=U.firstChild;L(U,W)}}}function Q(V,Z){function W(ad,aa){var ac=[];var ae=new tinymce.dom.TreeWalker(aa,ad);for(var ab=ae.current();ab;ab=ae.next()){if(V.dom.is(ab,"ol,ul,li")){ac.push(ab)}}return ac}if(Z.keyCode==tinymce.VK.BACKSPACE){var U=B();if(U){var Y=V.dom.getParent(U,"ol,ul");if(Y&&Y.firstChild===U){var X=W(Y,U);V.execCommand("Outdent",false,X);V.undoManager.add();return r.cancel(Z)}}}}function O(V,X){var U=B();if(X.keyCode===tinymce.VK.BACKSPACE&&V.dom.is(U,"li")&&U.parentNode.firstChild!==U){if(V.dom.select("ul,ol",U).length===1){var Z=U.previousSibling;V.dom.remove(V.dom.select("br",U));V.dom.remove(U,true);var W=tinymce.grep(Z.childNodes,function(aa){return aa.nodeType===3});if(W.length===1){var Y=W[0];V.selection.setCursorLocation(Y,Y.length)}V.undoManager.add();return r.cancel(X)}}}y.onKeyDown.add(function(U,V){x=M(V)});y.onKeyDown.add(D);y.onKeyDown.add(u);y.onKeyDown.add(K);if(tinymce.isGecko){y.onKeyUp.add(R)}if(tinymce.isIE8){y.onKeyUp.add(S)}if(tinymce.isGecko||tinymce.isWebKit){y.onKeyDown.add(Q)}if(tinymce.isWebKit){y.onKeyDown.add(O)}},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(t){if(t.tagName==="LI"&&(M.tagName==="P"||G.length>1)){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true)}return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(P,L,N){var t,O=P,M;while(!I.isBlock(P.parentNode)&&P.parentNode!==I.getRoot()){P=I.split(P.parentNode,P.previousSibling);P=P.nextSibling;O=P}if(N){t=N.cloneNode(true);P.parentNode.insertBefore(t,P);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");P.parentNode.insertBefore(t,P)}while(O&&O!=L){M=O.nextSibling;t.appendChild(O);O=M}if(t.childNodes.length===0){t.innerHTML='
                  '}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(U){if(U.hasAttribute&&U.hasAttribute("_mce_bogus")){return true}if(P(N,U)){I.addClass(U,"_mce_tagged_br");N=S(U)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w&&!H||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D,elements:this.selectedBlocks()}}else{B={defaultAction:x,elements:this.selectedBlocks()}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true),elements:this.selectedBlocks()})},outdent:function(y,x){var w=this,u=w.ed,z=u.dom,s=[];function A(t){var C,B,D;if(!d(u,t,s)){if(z.getStyle(t,"margin-left")!==""||z.getStyle(t,"padding-left")!==""){return w.adjustPaddingFunction(false)(t)}D=z.getStyle(t,"text-align",true);if(D==="center"||D==="right"){z.setStyle(t,"text-align","left");return}t=c(t,z);C=t.parentNode;B=t.parentNode.parentNode;if(B.tagName==="P"){z.split(B,t.parentNode)}else{z.split(C,t);if(B.tagName==="LI"){z.split(B,t)}else{if(!z.is(B,"ol,ul")){z.rename(t,"p")}}}s.push(t)}}var v=x&&tinymce.is(x,"array")?x:this.selectedBlocks();this.process({LI:A,defaultAction:this.adjustPaddingFunction(false),elements:v});e(s,m)},process:function(y){var F=this,w=F.ed.selection,z=F.ed.dom,E,u;function B(t){var s=tinymce.grep(t.childNodes,function(H){return !(H.nodeName==="BR"||H.nodeName==="SPAN"&&z.getAttrib(H,"data-mce-type")=="bookmark"||H.nodeType==3&&(H.nodeValue==String.fromCharCode(160)||H.nodeValue==""))});return s.length===0}function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1||E.length>1&&B(s)){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){F.splitSafeEach(s.childNodes,x)}function C(s,t){return t>=0&&s.hasChildNodes()&&t0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},selectedBlocks:function(){var s=this.ed;var t=s.selection.getSelectedBlocks();return t.length==0?[s.dom.getRoot()]:t},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}()); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js new file mode 100644 index 00000000..fa10b748 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js @@ -0,0 +1,951 @@ +/** + * editor_plugin_src.js + * + * Copyright 2011, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, Event = tinymce.dom.Event, bookmark; + + // Skips text nodes that only contain whitespace since they aren't semantically important. + function skipWhitespaceNodes(e, next) { + while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) { + e = next(e); + } + return e; + } + + function skipWhitespaceNodesBackwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.previousSibling; + }); + } + + function skipWhitespaceNodesForwards(e) { + return skipWhitespaceNodes(e, function(e) { + return e.nextSibling; + }); + } + + function hasParentInList(ed, e, list) { + return ed.dom.getParent(e, function(p) { + return tinymce.inArray(list, p) !== -1; + }); + } + + function isList(e) { + return e && (e.tagName === 'OL' || e.tagName === 'UL'); + } + + function splitNestedLists(element, dom) { + var tmp, nested, wrapItem; + tmp = skipWhitespaceNodesBackwards(element.lastChild); + while (isList(tmp)) { + nested = tmp; + tmp = skipWhitespaceNodesBackwards(nested.previousSibling); + } + if (nested) { + wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.split(element, nested); + dom.insertAfter(wrapItem, nested); + wrapItem.appendChild(nested); + wrapItem.appendChild(nested); + element = wrapItem.previousSibling; + } + return element; + } + + function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) { + e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs); + return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs); + } + + function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) { + var prev = skipWhitespaceNodesBackwards(e.previousSibling); + if (prev) { + return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) { + var next = skipWhitespaceNodesForwards(e.nextSibling); + if (next) { + return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs); + } else { + return e; + } + } + + function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) { + if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) { + return merge(e1, e2, differentStylesMasterElement); + } else if (e1 && e1.tagName === 'LI' && isList(e2)) { + // Fix invalidly nested lists. + e1.appendChild(e2); + } + return e2; + } + + function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) { + if (!e1 || !e2) { + return false; + } else if (e1.tagName === 'LI' && e2.tagName === 'LI') { + return e2.style.listStyleType === 'none' || containsOnlyAList(e2); + } else if (isList(e1)) { + return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2); + } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P'; + } + + function isListForIndent(e) { + var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild); + return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI)); + } + + function containsOnlyAList(e) { + var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild); + return firstChild && lastChild && firstChild === lastChild && isList(firstChild); + } + + function merge(e1, e2, masterElement) { + var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild); + if (e1.tagName === 'P') { + e1.appendChild(e1.ownerDocument.createElement('br')); + } + while (e2.firstChild) { + e1.appendChild(e2.firstChild); + } + if (masterElement) { + e1.style.listStyleType = masterElement.style.listStyleType; + } + e2.parentNode.removeChild(e2); + attemptMerge(lastOriginal, firstNew, false); + return e1; + } + + function findItemToOperateOn(e, dom) { + var item; + if (!dom.is(e, 'li,ol,ul')) { + item = dom.getParent(e, 'li'); + if (item) { + e = item; + } + } + return e; + } + + tinymce.create('tinymce.plugins.Lists', { + init: function(ed) { + var LIST_TABBING = 'TABBING'; + var LIST_EMPTY_ITEM = 'EMPTY'; + var LIST_ESCAPE = 'ESCAPE'; + var LIST_PARAGRAPH = 'PARAGRAPH'; + var LIST_UNKNOWN = 'UNKNOWN'; + var state = LIST_UNKNOWN; + + function isTabInList(e) { + // Don't indent on Ctrl+Tab or Alt+Tab + return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) && + (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList')); + } + + function isOnLastListItem() { + var li = getLi(); + var grandParent = li.parentNode.parentNode; + var isLastItem = li.parentNode.lastChild === li; + return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li); + } + + function isNestedList(grandParent) { + if (isList(grandParent)) { + return grandParent.parentNode && grandParent.parentNode.tagName === 'LI'; + } else { + return grandParent.tagName === 'LI'; + } + } + + function isInEmptyListItem() { + return ed.selection.isCollapsed() && isEmptyListItem(getLi()); + } + + function getLi() { + var n = ed.selection.getStart(); + // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position + return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n; + } + + function isEmptyListItem(li) { + var numChildren = li.childNodes.length; + if (li.tagName === 'LI') { + return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li)); + } + return false; + } + + function isEmptyIE9Li(li) { + // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these + var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'}); + var isLastLi = li == lis[lis.length - 1]; + var child = li.firstChild; + return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32)); + } + + function isEnter(e) { + return e.keyCode === tinymce.VK.ENTER; + } + + function isEnterWithoutShift(e) { + return isEnter(e) && !e.shiftKey; + } + + function getListKeyState(e) { + if (isTabInList(e)) { + return LIST_TABBING; + } else if (isEnterWithoutShift(e) && isOnLastListItem()) { + // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now + //return LIST_ESCAPE; + return LIST_UNKNOWN; + } else if (isEnterWithoutShift(e) && isInEmptyListItem()) { + return LIST_EMPTY_ITEM; + } else { + return LIST_UNKNOWN; + } + } + + function cancelDefaultEvents(ed, e) { + // list escape is done manually using outdent as it does not create paragraphs correctly in td's + if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) { + Event.cancel(e); + } + } + + function isCursorAtEndOfContainer() { + var range = ed.selection.getRng(true); + var startContainer = range.startContainer; + if (startContainer.nodeType == 3) { + var value = startContainer.nodeValue; + if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) { + // IE9 places a space on the end of the text in some cases so ignore last char + return (range.endOffset == value.length-1); + } else { + return (range.endOffset == value.length); + } + } else if (startContainer.nodeType == 1) { + return range.endOffset == startContainer.childNodes.length; + } + return false; + } + + /* + If we are at the end of a list item surrounded with an element, pressing enter should create a + new list item instead without splitting the element e.g. don't want to create new P or H1 tag + */ + function isEndOfListItem() { + var node = ed.selection.getNode(); + var validElements = 'h1,h2,h3,h4,h5,h6,p,div'; + var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node; + return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer(); + } + + // Creates a new list item after the current selection's list item parent + function createNewLi(ed, e) { + if (isEnterWithoutShift(e) && isEndOfListItem()) { + var node = ed.selection.getNode(); + var li = ed.dom.create("li"); + var parentLi = ed.dom.getParent(node, 'li'); + ed.dom.insertAfter(li, parentLi); + + // Move caret to new list element. + if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) { + // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic + //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point + ed.selection.setCursorLocation(li, 1); + } else { + ed.selection.setCursorLocation(li, 0); + } + e.preventDefault(); + } + } + + function imageJoiningListItem(ed, e) { + var prevSibling; + + if (!tinymce.isGecko) + return; + + var n = ed.selection.getStart(); + if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG') + return; + + function lastLI(node) { + var child = node.firstChild; + var li = null; + do { + if (!child) + break; + + if (child.tagName === 'LI') + li = child; + } while (child = child.nextSibling); + + return li; + } + + function addChildren(parentNode, destination) { + while (parentNode.childNodes.length > 0) + destination.appendChild(parentNode.childNodes[0]); + } + + // Check if there is a previous sibling + prevSibling = n.parentNode.previousSibling; + if (!prevSibling) + return; + + var ul; + if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL') + ul = prevSibling; + else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL')) + ul = prevSibling.previousSibling; + else + return; + + var li = lastLI(ul); + + // move the caret to the end of the list item + var rng = ed.dom.createRng(); + rng.setStart(li, 1); + rng.setEnd(li, 1); + ed.selection.setRng(rng); + ed.selection.collapse(true); + + // save a bookmark at the end of the list item + var bookmark = ed.selection.getBookmark(); + + // copy the image an its text to the list item + var clone = n.parentNode.cloneNode(true); + if (clone.tagName === 'P' || clone.tagName === 'DIV') + addChildren(clone, li); + else + li.appendChild(clone); + + // remove the old copy of the image + n.parentNode.parentNode.removeChild(n.parentNode); + + // move the caret where we saved the bookmark + ed.selection.moveToBookmark(bookmark); + } + + // fix the cursor position to ensure it is correct in IE + function setCursorPositionToOriginalLi(li) { + var list = ed.dom.getParent(li, 'ol,ul'); + if (list != null) { + var lastLi = list.lastChild; + // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic + //lastLi.appendChild(ed.getDoc().createElement('')); + ed.selection.setCursorLocation(lastLi, 0); + } + } + + this.ed = ed; + ed.addCommand('Indent', this.indent, this); + ed.addCommand('Outdent', this.outdent, this); + ed.addCommand('InsertUnorderedList', function() { + this.applyList('UL', 'OL'); + }, this); + ed.addCommand('InsertOrderedList', function() { + this.applyList('OL', 'UL'); + }, this); + + ed.onInit.add(function() { + ed.editorCommands.addCommands({ + 'outdent': function() { + var sel = ed.selection, dom = ed.dom; + + function hasStyleIndent(n) { + n = dom.getParent(n, dom.isBlock); + return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0; + } + + return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList'); + } + }, 'state'); + }); + + ed.onKeyUp.add(function(ed, e) { + if (state == LIST_TABBING) { + ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null); + state = LIST_UNKNOWN; + return Event.cancel(e); + } else if (state == LIST_EMPTY_ITEM) { + var li = getLi(); + var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey; + ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null); + if (tinymce.isIE) { + setCursorPositionToOriginalLi(li); + } + + return Event.cancel(e); + } else if (state == LIST_ESCAPE) { + if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) { + // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting. + // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after + // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag. + var n = ed.getDoc().createTextNode('\uFEFF'); + ed.selection.getNode().appendChild(n); + } else if (tinymce.isIE9 || tinymce.isGecko) { + // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour + // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves + ed.execCommand('Outdent'); + return Event.cancel(e); + } + } + }); + + function fixListItem(parent, reference) { + // a zero-sized non-breaking space is placed in the empty list item so that the nested list is + // displayed on the below line instead of next to it + var n = ed.getDoc().createTextNode('\uFEFF'); + parent.insertBefore(n, reference); + ed.selection.setCursorLocation(n, 0); + // repaint to remove rendering artifact. only visible when creating new list + ed.execCommand('mceRepaint'); + } + + function fixIndentedListItemForGecko(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (li) { + var parent = li.parentNode; + var grandParent = parent && parent.parentNode; + if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) { + fixListItem(grandParent, parent); + } + } + } + } + + function fixIndentedListItemForIE8(ed, e) { + if (isEnter(e)) { + var li = getLi(); + if (ed.dom.select('ul li', li).length === 1) { + var list = li.firstChild; + fixListItem(li, list); + } + } + } + + function fixDeletingFirstCharOfList(ed, e) { + function listElements(list, li) { + var elements = []; + var walker = new tinymce.dom.TreeWalker(li, list); + for (var node = walker.current(); node; node = walker.next()) { + if (ed.dom.is(node, 'ol,ul,li')) { + elements.push(node); + } + } + return elements; + } + + if (e.keyCode == tinymce.VK.BACKSPACE) { + var li = getLi(); + if (li) { + var list = ed.dom.getParent(li, 'ol,ul'); + if (list && list.firstChild === li) { + var elements = listElements(list, li); + ed.execCommand("Outdent", false, elements); + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + } + + function fixDeletingEmptyLiInWebkit(ed, e) { + var li = getLi(); + if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) { + if (ed.dom.select('ul,ol', li).length === 1) { + var prevLi = li.previousSibling; + ed.dom.remove(ed.dom.select('br', li)); + ed.dom.remove(li, true); + var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 }); + if (textNodes.length === 1) { + var textNode = textNodes[0] + ed.selection.setCursorLocation(textNode, textNode.length); + } + ed.undoManager.add(); + return Event.cancel(e); + } + } + } + + ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); }); + ed.onKeyDown.add(cancelDefaultEvents); + ed.onKeyDown.add(imageJoiningListItem); + ed.onKeyDown.add(createNewLi); + + if (tinymce.isGecko) { + ed.onKeyUp.add(fixIndentedListItemForGecko); + } + if (tinymce.isIE8) { + ed.onKeyUp.add(fixIndentedListItemForIE8); + } + if (tinymce.isGecko || tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingFirstCharOfList); + } + if (tinymce.isWebKit) { + ed.onKeyDown.add(fixDeletingEmptyLiInWebkit); + } + }, + + applyList: function(targetListType, oppositeListType) { + var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions, + selectedBlocks = ed.selection.getSelectedBlocks(); + + function cleanupBr(e) { + if (e && e.tagName === 'BR') { + dom.remove(e); + } + } + + function makeList(element) { + var list = dom.create(targetListType), li; + + function adjustIndentForNewList(element) { + // If there's a margin-left, outdent one level to account for the extra list margin. + if (element.style.marginLeft || element.style.paddingLeft) { + t.adjustPaddingFunction(false)(element); + } + } + + if (element.tagName === 'LI') { + // No change required. + } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') { + processBrs(element, function(startSection, br) { + doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode); + li = startSection.parentNode; + adjustIndentForNewList(li); + cleanupBr(br); + }); + if (li) { + if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) { + dom.split(li.parentNode.parentNode, li.parentNode); + } + attemptMergeWithAdjacent(li.parentNode, true); + } + return; + } else { + // Put the list around the element. + li = dom.create('li'); + dom.insertAfter(li, element); + li.appendChild(element); + adjustIndentForNewList(element); + element = li; + } + dom.insertAfter(list, element); + list.appendChild(element); + attemptMergeWithAdjacent(list, true); + applied.push(element); + } + + function doWrapList(start, end, template) { + var li, n = start, tmp; + while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) { + start = dom.split(start.parentNode, start.previousSibling); + start = start.nextSibling; + n = start; + } + if (template) { + li = template.cloneNode(true); + start.parentNode.insertBefore(li, start); + while (li.firstChild) dom.remove(li.firstChild); + li = dom.rename(li, 'li'); + } else { + li = dom.create('li'); + start.parentNode.insertBefore(li, start); + } + while (n && n != end) { + tmp = n.nextSibling; + li.appendChild(n); + n = tmp; + } + if (li.childNodes.length === 0) { + li.innerHTML = '
                  '; + } + makeList(li); + } + + function processBrs(element, callback) { + var startSection, previousBR, END_TO_START = 3, START_TO_END = 1, + breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl'; + + function isAnyPartSelected(start, end) { + var r = dom.createRng(), sel; + bookmark.keep = true; + ed.selection.moveToBookmark(bookmark); + bookmark.keep = false; + sel = ed.selection.getRng(true); + if (!end) { + end = start.parentNode.lastChild; + } + r.setStartBefore(start); + r.setEndAfter(end); + return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0); + } + + function nextLeaf(br) { + if (br.nextSibling) + return br.nextSibling; + if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot()) + return nextLeaf(br.parentNode); + } + + // Split on BRs within the range and process those. + startSection = element.firstChild; + // First mark the BRs that have any part of the previous section selected. + var trailingContentSelected = false; + each(dom.select(breakElements, element), function(br) { + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (isAnyPartSelected(startSection, br)) { + dom.addClass(br, '_mce_tagged_br'); + startSection = nextLeaf(br); + } + }); + trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined)); + startSection = element.firstChild; + each(dom.select(breakElements, element), function(br) { + // Got a section from start to br. + var tmp = nextLeaf(br); + if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { + return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. + } + if (dom.hasClass(br, '_mce_tagged_br')) { + callback(startSection, br, previousBR); + previousBR = null; + } else { + previousBR = br; + } + startSection = tmp; + }); + if (trailingContentSelected) { + callback(startSection, undefined, previousBR); + } + } + + function wrapList(element) { + processBrs(element, function(startSection, br, previousBR) { + // Need to indent this part + doWrapList(startSection, br); + cleanupBr(br); + cleanupBr(previousBR); + }); + } + + function changeList(element) { + if (tinymce.inArray(applied, element) !== -1) { + return; + } + if (element.parentNode.tagName === oppositeListType) { + dom.split(element.parentNode, element); + makeList(element); + attemptMergeWithNext(element.parentNode, false); + } + applied.push(element); + } + + function convertListItemToParagraph(element) { + var child, nextChild, mergedElement, splitLast; + if (tinymce.inArray(applied, element) !== -1) { + return; + } + element = splitNestedLists(element, dom); + while (dom.is(element.parentNode, 'ol,ul,li')) { + dom.split(element.parentNode, element); + } + // Push the original element we have from the selection, not the renamed one. + applied.push(element); + element = dom.rename(element, 'p'); + mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines); + if (mergedElement === element) { + // Now split out any block elements that can't be contained within a P. + // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each) + child = element.firstChild; + while (child) { + if (dom.isBlock(child)) { + child = dom.split(child.parentNode, child); + splitLast = true; + nextChild = child.nextSibling && child.nextSibling.firstChild; + } else { + nextChild = child.nextSibling; + if (splitLast && child.tagName === 'BR') { + dom.remove(child); + } + splitLast = false; + } + child = nextChild; + } + } + } + + each(selectedBlocks, function(e) { + e = findItemToOperateOn(e, dom); + if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) { + hasOppositeType = true; + } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) { + hasSameType = true; + } else { + hasNonList = true; + } + }); + + if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) { + actions = { + 'LI': changeList, + 'H1': makeList, + 'H2': makeList, + 'H3': makeList, + 'H4': makeList, + 'H5': makeList, + 'H6': makeList, + 'P': makeList, + 'BODY': makeList, + 'DIV': selectedBlocks.length > 1 ? makeList : wrapList, + defaultAction: wrapList, + elements: this.selectedBlocks() + }; + } else { + actions = { + defaultAction: convertListItemToParagraph, + elements: this.selectedBlocks() + }; + } + this.process(actions); + }, + + indent: function() { + var ed = this.ed, dom = ed.dom, indented = []; + + function createWrapItem(element) { + var wrapItem = dom.create('li', { style: 'list-style-type: none;'}); + dom.insertAfter(wrapItem, element); + return wrapItem; + } + + function createWrapList(element) { + var wrapItem = createWrapItem(element), + list = dom.getParent(element, 'ol,ul'), + listType = list.tagName, + listStyle = dom.getStyle(list, 'list-style-type'), + attrs = {}, + wrapList; + if (listStyle !== '') { + attrs.style = 'list-style-type: ' + listStyle + ';'; + } + wrapList = dom.create(listType, attrs); + wrapItem.appendChild(wrapList); + return wrapList; + } + + function indentLI(element) { + if (!hasParentInList(ed, element, indented)) { + element = splitNestedLists(element, dom); + var wrapList = createWrapList(element); + wrapList.appendChild(element); + attemptMergeWithAdjacent(wrapList.parentNode, false); + attemptMergeWithAdjacent(wrapList, false); + indented.push(element); + } + } + + this.process({ + 'LI': indentLI, + defaultAction: this.adjustPaddingFunction(true), + elements: this.selectedBlocks() + }); + + }, + + outdent: function(ui, elements) { + var t = this, ed = t.ed, dom = ed.dom, outdented = []; + + function outdentLI(element) { + var listElement, targetParent, align; + if (!hasParentInList(ed, element, outdented)) { + if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') { + return t.adjustPaddingFunction(false)(element); + } + align = dom.getStyle(element, 'text-align', true); + if (align === 'center' || align === 'right') { + dom.setStyle(element, 'text-align', 'left'); + return; + } + element = splitNestedLists(element, dom); + listElement = element.parentNode; + targetParent = element.parentNode.parentNode; + if (targetParent.tagName === 'P') { + dom.split(targetParent, element.parentNode); + } else { + dom.split(listElement, element); + if (targetParent.tagName === 'LI') { + // Nested list, need to split the LI and go back out to the OL/UL element. + dom.split(targetParent, element); + } else if (!dom.is(targetParent, 'ol,ul')) { + dom.rename(element, 'p'); + } + } + outdented.push(element); + } + } + + var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks(); + this.process({ + 'LI': outdentLI, + defaultAction: this.adjustPaddingFunction(false), + elements: listElements + }); + + each(outdented, attemptMergeWithAdjacent); + }, + + process: function(actions) { + var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r; + + function isEmptyElement(element) { + var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) { + return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark' + || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == '')); + }); + return excludeBrsAndBookmarks.length === 0; + } + + function processElement(element) { + dom.removeClass(element, '_mce_act_on'); + if (!element || element.nodeType !== 1 || selectedBlocks.length > 1 && isEmptyElement(element)) { + return; + } + element = findItemToOperateOn(element, dom); + var action = actions[element.tagName]; + if (!action) { + action = actions.defaultAction; + } + action(element); + } + + function recurse(element) { + t.splitSafeEach(element.childNodes, processElement); + } + + function brAtEdgeOfSelection(container, offset) { + return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length && + container.childNodes[offset].tagName === 'BR'; + } + + function isInTable() { + var n = sel.getNode(); + var p = dom.getParent(n, 'td'); + return p !== null; + } + + selectedBlocks = actions.elements; + + r = sel.getRng(true); + if (!r.collapsed) { + if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) { + r.setEnd(r.endContainer, r.endOffset - 1); + sel.setRng(r); + } + if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) { + r.setStart(r.startContainer, r.startOffset + 1); + sel.setRng(r); + } + } + + + if (tinymce.isIE8) { + // append a zero sized nbsp so that caret is restored correctly using bookmark + var s = t.ed.selection.getNode(); + if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) { + var i = t.ed.getDoc().createTextNode('\uFEFF'); + s.appendChild(i); + } + } + + bookmark = sel.getBookmark(); + actions.OL = actions.UL = recurse; + t.splitSafeEach(selectedBlocks, processElement); + sel.moveToBookmark(bookmark); + bookmark = null; + + // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6 + if (!isInTable()) { + // Avoids table or image handles being left behind in Firefox. + t.ed.execCommand('mceRepaint'); + } + }, + + splitSafeEach: function(elements, f) { + if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) || + /Firefox\/3\.[0-4]/.test(navigator.userAgent))) { + this.classBasedEach(elements, f); + } else { + each(elements, f); + } + }, + + classBasedEach: function(elements, f) { + var dom = this.ed.dom, nodes, element; + // Mark nodes + each(elements, function(element) { + dom.addClass(element, '_mce_act_on'); + }); + nodes = dom.select('._mce_act_on'); + while (nodes.length > 0) { + element = nodes.shift(); + dom.removeClass(element, '_mce_act_on'); + f(element); + nodes = dom.select('._mce_act_on'); + } + }, + + adjustPaddingFunction: function(isIndent) { + var indentAmount, indentUnits, ed = this.ed; + indentAmount = ed.settings.indentation; + indentUnits = /[a-z%]+/i.exec(indentAmount); + indentAmount = parseInt(indentAmount, 10); + return function(element) { + var currentIndent, newIndentAmount; + currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10); + if (isIndent) { + newIndentAmount = currentIndent + indentAmount; + } else { + newIndentAmount = currentIndent - indentAmount; + } + ed.dom.setStyle(element, 'padding-left', ''); + ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : ''); + }; + }, + + selectedBlocks: function() { + var ed = this.ed + var selectedBlocks = ed.selection.getSelectedBlocks(); + return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks; + }, + + getInfo: function() { + return { + longname : 'Lists', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + tinymce.PluginManager.add("lists", tinymce.plugins.Lists); +}()); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/css/media.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/css/media.css new file mode 100644 index 00000000..540a3b5a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/css/media.css @@ -0,0 +1,18 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js new file mode 100644 index 00000000..7bcb99e9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m0){N+=(N?"&":"")+O+"="+escape(P)}});if(N.length){G.params.flashvars=N}K=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(K,function(P,O){G.params[O]=""+P})}}G=z.attr("data-mce-json");if(!G){return}G=g.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}if(q.name==="Iframe"){x=new b("iframe",1);tinymce.each(d,function(i){var n=z.attr(i);if(i=="class"&&n){n=n.replace(/mceItem.+ ?/g,"")}if(n&&n.length>0){x.attr(i,n)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new b("script",1).attr("type","text/javascript");y=new b("#text",3);y.value="write"+q.name+"("+g.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new b("video",1).attr(tinymce.extend({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style') + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } + + data.params.src = ''; + } + + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: node.attr('type') + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } + + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = iframe.attr('width'); + height = iframe.attr('height'); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } + + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; + + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + + function get(id) { + return document.getElementById(id); + } + + function clone(obj) { + var i, len, copy, attr; + + if (null == obj || "object" != typeof obj) + return obj; + + // Handle Array + if ('length' in obj) { + copy = []; + + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } + + return copy; + } + + // Handle Object + copy = {}; + for (attr in obj) { + if (obj.hasOwnProperty(attr)) + copy[attr] = clone(obj[attr]); + } + + return copy; + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value, name) { + if (typeof(value) != 'undefined' && value != null) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') { + value = value.toLowerCase(); + value = (!name && value === 'true') || (name && value === name.toLowerCase()); + } + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor, self = this; + + self.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); + + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube *NEW* + if (src.match(/youtu.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google video + if (src.match(/video.google.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + }, + + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } + + return '' + } + + var html = ""; + + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js new file mode 100644 index 00000000..6d0de767 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.media_dlg',{list:"Liste",file:"Datei/URL",advanced:"Erweitert",general:"Allgemein",title:"Multimedia-Inhalte einf\u00fcgen/bearbeiten","align_top_left":"Oben Links","align_center":"Zentriert","align_left":"Links","align_bottom":"Unten","align_right":"Rechts","align_top":"Oben","qt_stream_warn":"In den Erweiterten Einstellungen sollten im Feld \'QT Src\' gestreamte RTSP Resourcen hinzugef\u00fcgt werden.\nZus\u00e4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.",qtsrc:"Angabe zu QT Src",progress:"Fortschritt",sound:"Ton",swstretchvalign:"Stretch V-Ausrichtung",swstretchhalign:"Stretch H-Ausrichtung",swstretchstyle:"Stretch-Art",scriptcallbacks:"Script callbacks","align_top_right":"Oben Rechts",uimode:"UI Modus",rate:"Rate",playcount:"Z\u00e4hler",defaultframe:"Frame-Voreinstellung",currentposition:"Aktuelle Position",currentmarker:"Aktueller Marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Fensterloses Video",stretchtofit:"Anzeigefl\u00e4che an verf\u00fcgbaren Platz anpassen",mute:"Stumm",invokeurls:"Invoke URLs",fullscreen:"Vollbild",enabled:"Aktiviert",autostart:"Autostart",volume:"Lautst\u00e4rke",target:"Ziel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Endzeitpunkt",starttime:"Startzeitpunkt",enablejavascript:"JavaScript aktivieren",correction:"Ohne Korrektur",targetcache:"Ziel zwischenspeichern",playeveryframe:"Jeden Frame abspielen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Men\u00fc anzeigen",loop:"Wiederholung",play:"Automatisches Abspielen",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand","class_name":"CSS-Klasse",name:"Name",id:"Id",type:"Typ",size:"Abmessungen",preview:"Vorschau","constrain_proportions":"Proportionen erhalten",controls:"Steuerung",numloop:"Anzahl Wiederholungen",console:"Konsole",cache:"Zwischenspeicher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvariablen",base:"Base",bgcolor:"Hintergrund",wmode:"WMode",salign:"S-Ausrichtung",align:"Ausrichtung",scale:"Skalierung",quality:"Qualit\u00e4t",shuffle:"Zuf\u00e4llige Wiedergabe",prefetch:"Prefetch",nojava:"Kein Java",maintainaspect:"Bildverh\u00e4ltnis beibehalten",imagestatus:"Bildstatus",center:"Zentriert",autogotourl:"Auto goto URL","shockwave_options":"Shockwave-Optionen","rmp_options":"Optionen f\u00fcr Real Media Player","wmp_options":"Optionen f\u00fcr Windows Media Player","qt_options":"Quicktime-Optionen","flash_options":"Flash-Optionen",hidden:"Versteckt","align_bottom_left":"Unten Links","align_bottom_right":"Unten Rechts",flash:"Flash",quicktime:"QuickTime","embedded_audio_options":"Integrierte Audio Optionen",windowsmedia:"WindowsMedia",realmedia:"RealMedia",shockwave:"ShockWave",audio:"Audio",video:"Video","html5_video_options":"HTML5 Video Optionen",altsource1:"Alternative Quelle 1",altsource2:"Alternative Quelle 2",preload:"Preload",poster:"Poster",source:"Quelle","html5_audio_options":"Audio Optionen","preload_none":"Nicht vorladen","preload_metadata":"Video Metadaten vorladen","preload_auto":"Benutzer Browser entscheidet automatisch",iframe:"iFrame",embeddedaudio:"Audio (eingebunden)"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js new file mode 100644 index 00000000..7f4ec31a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","embedded_audio_options":"Embedded Audio Options","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide",flash:"Flash",quicktime:"QuickTime",windowsmedia:"WindowsMedia",realmedia:"RealMedia",shockwave:"ShockWave",audio:"Audio",video:"Video",iframe:"iFrame",embeddedaudio:"Audio (embedded)"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/media.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/media.htm new file mode 100644 index 00000000..7bd3ab78 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/media.htm @@ -0,0 +1,629 @@ + + + + {#media_dlg.title} + + + + + + + + + +
                  + +
                  +
                  +
                  + {#media_dlg.general} +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + x + px +

                  + + +

                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  + {#media_dlg.advanced} +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  + +
                  +
                  +

                  {#media_dlg.html5_video_options}

                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +

                  +
                  + +
                  +
                  +

                  {#media_dlg.embedded_audio_options}

                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +

                  +
                  + +
                  +
                  +

                  {#media_dlg.html5_audio_options}

                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +

                  +
                  + +
                  +
                  +

                  {#media_dlg.flash_options}

                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  +
                  + +
                  +
                  +

                  {#media_dlg.qt_options}

                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                   
                  +
                  +
                  +

                  +
                  + +
                  +
                  +

                  {#media_dlg.wmp_options}

                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  <
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  +
                  + +
                  +
                  +

                  {#media_dlg.rmp_options}

                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  +
                  + +
                  +
                  +

                  {#media_dlg.shockwave_options}

                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +

                  +
                  +
                  + +
                  +
                  + {#media_dlg.source} + +
                  +
                  + +
                  +
                  +
                    +
                  • +
                  • +
                  +



                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf new file mode 100644 index 00000000..585d772d Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css new file mode 100644 index 00000000..0c45c7ff --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/css/media.css @@ -0,0 +1,17 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js new file mode 100644 index 00000000..37b4320b --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m0){N+=(N?"&":"")+O+"="+escape(P)}});if(N.length){G.params.flashvars=N}K=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(K,function(P,O){G.params[O]=""+P})}}G=z.attr("data-mce-json");if(!G){return}G=g.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}if(q.name==="Iframe"){x=new b("iframe",1);tinymce.each(d,function(i){var n=z.attr(i);if(i=="class"&&n){n=n.replace(/mceItem.+ ?/g,"")}if(n&&n.length>0){x.attr(i,n)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new b("script",1).attr("type","text/javascript");y=new b("#text",3);y.value="write"+q.name+"("+g.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new b("video",1).attr(tinymce.extend({id:z.attr("id"),width:z.attr("width"),height:z.attr("height"),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style') + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } + + data.params.src = ''; + } + + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: node.attr('type') + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } + + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = iframe.attr('width'); + height = iframe.attr('height'); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } + + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; + + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + + function get(id) { + return document.getElementById(id); + } + + function clone(obj) { + var i, len, copy, attr; + + if (null == obj || "object" != typeof obj) + return obj; + + // Handle Array + if ('length' in obj) { + copy = []; + + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } + + return copy; + } + + // Handle Object + copy = {}; + for (attr in obj) { + if (obj.hasOwnProperty(attr)) + copy[attr] = clone(obj[attr]); + } + + return copy; + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value, name) { + if (typeof(value) != 'undefined' && value != null) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') { + value = value.toLowerCase(); + value = (!name && value === 'true') || (name && value === name.toLowerCase()); + } + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor, self = this; + + self.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); + + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube *NEW* + if (src.match(/youtu.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google video + if (src.match(/video.google.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + }, + + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } + + return '' + } + + var html = ""; + + html += ''; + return html; + }, + + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js new file mode 100644 index 00000000..6d0de767 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.media_dlg',{list:"Liste",file:"Datei/URL",advanced:"Erweitert",general:"Allgemein",title:"Multimedia-Inhalte einf\u00fcgen/bearbeiten","align_top_left":"Oben Links","align_center":"Zentriert","align_left":"Links","align_bottom":"Unten","align_right":"Rechts","align_top":"Oben","qt_stream_warn":"In den Erweiterten Einstellungen sollten im Feld \'QT Src\' gestreamte RTSP Resourcen hinzugef\u00fcgt werden.\nZus\u00e4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.",qtsrc:"Angabe zu QT Src",progress:"Fortschritt",sound:"Ton",swstretchvalign:"Stretch V-Ausrichtung",swstretchhalign:"Stretch H-Ausrichtung",swstretchstyle:"Stretch-Art",scriptcallbacks:"Script callbacks","align_top_right":"Oben Rechts",uimode:"UI Modus",rate:"Rate",playcount:"Z\u00e4hler",defaultframe:"Frame-Voreinstellung",currentposition:"Aktuelle Position",currentmarker:"Aktueller Marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Fensterloses Video",stretchtofit:"Anzeigefl\u00e4che an verf\u00fcgbaren Platz anpassen",mute:"Stumm",invokeurls:"Invoke URLs",fullscreen:"Vollbild",enabled:"Aktiviert",autostart:"Autostart",volume:"Lautst\u00e4rke",target:"Ziel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Endzeitpunkt",starttime:"Startzeitpunkt",enablejavascript:"JavaScript aktivieren",correction:"Ohne Korrektur",targetcache:"Ziel zwischenspeichern",playeveryframe:"Jeden Frame abspielen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Men\u00fc anzeigen",loop:"Wiederholung",play:"Automatisches Abspielen",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand","class_name":"CSS-Klasse",name:"Name",id:"Id",type:"Typ",size:"Abmessungen",preview:"Vorschau","constrain_proportions":"Proportionen erhalten",controls:"Steuerung",numloop:"Anzahl Wiederholungen",console:"Konsole",cache:"Zwischenspeicher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvariablen",base:"Base",bgcolor:"Hintergrund",wmode:"WMode",salign:"S-Ausrichtung",align:"Ausrichtung",scale:"Skalierung",quality:"Qualit\u00e4t",shuffle:"Zuf\u00e4llige Wiedergabe",prefetch:"Prefetch",nojava:"Kein Java",maintainaspect:"Bildverh\u00e4ltnis beibehalten",imagestatus:"Bildstatus",center:"Zentriert",autogotourl:"Auto goto URL","shockwave_options":"Shockwave-Optionen","rmp_options":"Optionen f\u00fcr Real Media Player","wmp_options":"Optionen f\u00fcr Windows Media Player","qt_options":"Quicktime-Optionen","flash_options":"Flash-Optionen",hidden:"Versteckt","align_bottom_left":"Unten Links","align_bottom_right":"Unten Rechts",flash:"Flash",quicktime:"QuickTime","embedded_audio_options":"Integrierte Audio Optionen",windowsmedia:"WindowsMedia",realmedia:"RealMedia",shockwave:"ShockWave",audio:"Audio",video:"Video","html5_video_options":"HTML5 Video Optionen",altsource1:"Alternative Quelle 1",altsource2:"Alternative Quelle 2",preload:"Preload",poster:"Poster",source:"Quelle","html5_audio_options":"Audio Optionen","preload_none":"Nicht vorladen","preload_metadata":"Video Metadaten vorladen","preload_auto":"Benutzer Browser entscheidet automatisch",iframe:"iFrame",embeddedaudio:"Audio (eingebunden)"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js new file mode 100644 index 00000000..d0aaa139 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","embedded_audio_options":"Embedded Audio Options","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide",flash:"",quicktime:"",windowsmedia:"",realmedia:"",shockwave:"",audio:"",video:"",iframe:"",embeddedaudio:""}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm new file mode 100644 index 00000000..957d83a6 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/media.htm @@ -0,0 +1,922 @@ + + + + {#media_dlg.title} + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#media_dlg.general} + + + + + + + + + + + + + + + + + + +
                  + +
                  + + + + + +
                   
                  +
                  + + + + + + +
                  x   
                  +
                  +
                  + +
                  + {#media_dlg.preview} + +
                  +
                  + +
                  +
                  + {#media_dlg.advanced} + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + + + + + +
                   
                  +
                  +
                  + +
                  + {#media_dlg.html5_video_options} + + + + + + + + + + + + + + + + + + + + + +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                  + +
                  + + + + + + + + + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  +
                  + +
                  + {#media_dlg.embedded_audio_options} + + + + + + + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  +
                  + +
                  + {#media_dlg.html5_audio_options} + + + + + + + + + + + + + + + + +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                  + +
                  + + + + + + + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  +
                  + +
                  + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + +
                  + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + + + + + + + +
                  +
                  + +
                  + {#media_dlg.qt_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  +  
                  + + + + + +
                   
                  +
                  +
                  + +
                  + {#media_dlg.wmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  +
                  + +
                  + {#media_dlg.rmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  +   +
                  +
                  + +
                  + {#media_dlg.shockwave_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + + + +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  + + + + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#media_dlg.source} + +
                  +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf new file mode 100644 index 00000000..585d772d Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/media_orig/moxieplayer.swf differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js new file mode 100644 index 00000000..687f5486 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js new file mode 100644 index 00000000..d492fbef --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Nonbreaking', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceNonBreaking', function() { + ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); + }); + + // Register buttons + ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); + + if (ed.getParam('nonbreaking_force_tab')) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode == 9) { + e.preventDefault(); + + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + ed.execCommand('mceNonBreaking'); + } + }); + } + }, + + getInfo : function() { + return { + longname : 'Nonbreaking space', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + + // Private methods + }); + + // Register plugin + tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js new file mode 100644 index 00000000..e7f301db --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret";r=tinymce.isGecko?"\u200B":"\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return !D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(y,A){var E=A.keyCode,w,B,C,u;function t(G,F){while(G=G[F?"previousSibling":"nextSibling"]){if(G.nodeType!==3||G.nodeValue.length>0){return G}}}function x(F,G){p.select(F);p.collapse(G)}C=p.getStart();u=p.getEnd();w=g(C)||g(u);if(w&&(E<112||E>124)&&E!=e.DELETE&&E!=e.BACKSPACE){A.preventDefault();if(E==e.LEFT||E==e.RIGHT){var v=E==e.LEFT;if(y.dom.isBlock(w)){var z=v?w.previousSibling:w.nextSibling;var s=new c(z,z);var D=v?s.prev():s.next();x(D,!v)}else{x(w,v)}}}else{if(E==e.LEFT||E==e.RIGHT||E==e.BACKSPACE||E==e.DELETE){B=l(C);if(B){if(E==e.LEFT||E==e.BACKSPACE){w=t(B,true);if(w&&m(w)==="false"){A.preventDefault();if(E==e.LEFT){x(w,true)}else{j.remove(w)}}else{i(B)}}if(E==e.RIGHT||E==e.DELETE){w=t(B);if(w&&m(w)==="false"){A.preventDefault();if(E==e.RIGHT){x(w,false)}else{j.remove(w)}}else{i(B)}}}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){u.preventDefault()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(h,j){var g,f,i;g=" "+tinymce.trim(h.getParam("noneditable_editable_class","mceEditable"))+" ";f=" "+tinymce.trim(h.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";i=h.getParam("noneditable_regexp");if(i&&!i.length){i=[i]}h.onPreInit.add(function(){b(h);if(i){h.onBeforeSetContent.add(function(l,m){var n=i.length,o=m.content,k=tinymce.trim(f);if(m.format=="raw"){return}while(n--){o=o.replace(i[n],function(){var p=arguments;return''+l.dom.encode(typeof(p[1])==="string"?p[1]:p[0])+""})}m.content=o})}h.parser.addAttributeFilter("class",function(k){var l=k.length,m,n;while(l--){n=k[l];m=" "+n.attr("class")+" ";if(m.indexOf(g)!==-1){n.attr(d,"true")}else{if(m.indexOf(f)!==-1){n.attr(d,"false")}}}});h.serializer.addAttributeFilter(d,function(k,l){var m=k.length,n;while(m--){n=k[m];if(i&&n.attr("data-mce-content")){n.name="#text";n.type=3;n.raw=true;n.value=n.attr("data-mce-content")}else{n.attr(a,null);n.attr(d,null)}}});h.parser.addAttributeFilter(a,function(k,l){var m=k.length,n;while(m--){n=k[m];n.attr(d,n.attr(a));n.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js new file mode 100644 index 00000000..c87d241b --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js @@ -0,0 +1,438 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var TreeWalker = tinymce.dom.TreeWalker; + var externalName = 'contenteditable', internalName = 'data-mce-' + externalName; + var VK = tinymce.VK; + + function handleContentEditableSelection(ed) { + var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret'; + + // Setup invisible character use zero width space on Gecko since it doesn't change the height of the container + invisibleChar = tinymce.isGecko ? '\u200B' : '\uFEFF'; + + // Returns the content editable state of a node "true/false" or null + function getContentEditable(node) { + var contentEditable; + + // Ignore non elements + if (node.nodeType === 1) { + // Check for fake content editable + contentEditable = node.getAttribute(internalName); + if (contentEditable && contentEditable !== "inherit") { + return contentEditable; + } + + // Check for real content editable + contentEditable = node.contentEditable; + if (contentEditable !== "inherit") { + return contentEditable; + } + } + + return null; + }; + + // Returns the noneditable parent or null if there is a editable before it or if it wasn't found + function getNonEditableParent(node) { + var state; + + while (node) { + state = getContentEditable(node); + if (state) { + return state === "false" ? node : null; + } + + node = node.parentNode; + } + }; + + // Get caret container parent for the specified node + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } + + node = node.parentNode; + } + }; + + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; + + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Insert caret container before/after target or expand selection to include block + function insertCaretContainerOrExpandToBlock(target, before) { + var caretContainer, rng; + + // Select block + if (getContentEditable(target) === "false") { + if (dom.isBlock(target)) { + selection.select(target); + return; + } + } + + rng = dom.createRng(); + + if (getContentEditable(target) === "true") { + if (!target.firstChild) { + target.appendChild(ed.getDoc().createTextNode('\u00a0')); + } + + target = target.firstChild; + before = true; + } + + //caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar); + caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar); + + if (before) { + target.parentNode.insertBefore(caretContainer, target); + } else { + dom.insertAfter(caretContainer, target); + } + + rng.setStart(caretContainer.firstChild, 1); + rng.collapse(true); + selection.setRng(rng); + + return caretContainer; + }; + + // Removes any caret container except the one we might be in + function removeCaretContainer(caretContainer) { + var child, currentCaretContainer, lastContainer; + + if (caretContainer) { + rng = selection.getRng(true); + rng.setStartBefore(caretContainer); + rng.setEndBefore(caretContainer); + + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + + selection.setRng(rng); + } else { + currentCaretContainer = getParentCaretContainer(selection.getStart()); + while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) { + if (currentCaretContainer !== caretContainer) { + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + } + + lastContainer = caretContainer; + } + } + }; + + // Modifies the selection to include contentEditable false elements or insert caret containers + function moveSelection() { + var nonEditableStart, nonEditableEnd, isCollapsed, rng, element; + + // Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside + function hasSideContent(element, left) { + var container, offset, walker, node, len; + + container = rng.startContainer; + offset = rng.startOffset; + + // If endpoint is in middle of text node then expand to beginning/end of element + if (container.nodeType == 3) { + len = container.nodeValue.length; + if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) { + return; + } + } else { + // Can we resolve the node by index + if (offset < container.childNodes.length) { + // Browser represents caret position as the offset at the start of an element. When moving right + // this is the element we are moving into so we consider our container to be child node at offset-1 + var pos = !left && offset > 0 ? offset-1 : offset; + container = container.childNodes[pos]; + if (container.hasChildNodes()) { + container = container.firstChild; + } + } else { + // If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element + return !left ? element : null; + } + } + + // Walk left/right to look for contents + walker = new TreeWalker(container, element); + while (node = walker[left ? 'prev' : 'next']()) { + if (node.nodeType === 3 && node.nodeValue.length > 0) { + return; + } else if (getContentEditable(node) === "true") { + // Found contentEditable=true element return this one to we can move the caret inside it + return node; + } + } + + return element; + }; + + // Remove any existing caret containers + removeCaretContainer(); + + // Get noneditable start/end elements + isCollapsed = selection.isCollapsed(); + nonEditableStart = getNonEditableParent(selection.getStart()); + nonEditableEnd = getNonEditableParent(selection.getEnd()); + + // Is any fo the range endpoints noneditable + if (nonEditableStart || nonEditableEnd) { + rng = selection.getRng(true); + + // If it's a caret selection then look left/right to see if we need to move the caret out side or expand + if (isCollapsed) { + nonEditableStart = nonEditableStart || nonEditableEnd; + var start = selection.getStart(); + if (element = hasSideContent(nonEditableStart, true)) { + // We have no contents to the left of the caret then insert a caret container before the noneditable element + insertCaretContainerOrExpandToBlock(element, true); + } else if (element = hasSideContent(nonEditableStart, false)) { + // We have no contents to the right of the caret then insert a caret container after the noneditable element + insertCaretContainerOrExpandToBlock(element, false); + } else { + // We are in the middle of a noneditable so expand to select it + selection.select(nonEditableStart); + } + } else { + rng = selection.getRng(true); + + // Expand selection to include start non editable element + if (nonEditableStart) { + rng.setStartBefore(nonEditableStart); + } + + // Expand selection to include end non editable element + if (nonEditableEnd) { + rng.setEndAfter(nonEditableEnd); + } + + selection.setRng(rng); + } + } + }; + + function handleKey(ed, e) { + var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement; + + function getNonEmptyTextNodeSibling(node, prev) { + while (node = node[prev ? 'previousSibling' : 'nextSibling']) { + if (node.nodeType !== 3 || node.nodeValue.length > 0) { + return node; + } + } + }; + + function positionCaretOnElement(element, start) { + selection.select(element); + selection.collapse(start); + } + + startElement = selection.getStart() + endElement = selection.getEnd(); + + // Disable all key presses in contentEditable=false except delete or backspace + nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement); + if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) { + e.preventDefault(); + + // Arrow left/right select the element and collapse left/right + if (keyCode == VK.LEFT || keyCode == VK.RIGHT) { + var left = keyCode == VK.LEFT; + // If a block element find previous or next element to position the caret + if (ed.dom.isBlock(nonEditableParent)) { + var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling; + var walker = new TreeWalker(targetElement, targetElement); + var caretElement = left ? walker.prev() : walker.next(); + positionCaretOnElement(caretElement, !left); + } else { + positionCaretOnElement(nonEditableParent, left); + } + } + } else { + // Is arrow left/right, backspace or delete + if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) { + caretContainer = getParentCaretContainer(startElement); + if (caretContainer) { + // Arrow left or backspace + if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.LEFT) { + positionCaretOnElement(nonEditableParent, true); + } else { + dom.remove(nonEditableParent); + } + } else { + removeCaretContainer(caretContainer); + } + } + + // Arrow right or delete + if (keyCode == VK.RIGHT || keyCode == VK.DELETE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.RIGHT) { + positionCaretOnElement(nonEditableParent, false); + } else { + dom.remove(nonEditableParent); + } + } else { + removeCaretContainer(caretContainer); + } + } + } + } + } + }; + + ed.onMouseDown.addToTop(function(ed, e){ + // prevent collapsing selection to caret when clicking in a non-editable section + var node = ed.selection.getNode(); + if (getContentEditable(node) === "false" && node == e.target) { + e.preventDefault(); + } + }); + ed.onMouseUp.addToTop(moveSelection); + ed.onKeyDown.addToTop(handleKey); + ed.onKeyUp.addToTop(moveSelection); + }; + + tinymce.create('tinymce.plugins.NonEditablePlugin', { + init : function(ed, url) { + var editClass, nonEditClass, nonEditableRegExps; + + editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " "; + nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " "; + + // Setup noneditable regexps array + nonEditableRegExps = ed.getParam("noneditable_regexp"); + if (nonEditableRegExps && !nonEditableRegExps.length) { + nonEditableRegExps = [nonEditableRegExps]; + } + + ed.onPreInit.add(function() { + handleContentEditableSelection(ed); + + if (nonEditableRegExps) { + ed.onBeforeSetContent.add(function(ed, args) { + var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass); + + // Don't replace the variables when raw is used for example on undo/redo + if (args.format == "raw") { + return; + } + + while (i--) { + content = content.replace(nonEditableRegExps[i], function() { + var args = arguments; + + return '' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + ''; + }); + } + + args.content = content; + }); + } + + // Apply contentEditable true/false on elements with the noneditable/editable classes + ed.parser.addAttributeFilter('class', function(nodes) { + var i = nodes.length, className, node; + + while (i--) { + node = nodes[i]; + className = " " + node.attr("class") + " "; + + if (className.indexOf(editClass) !== -1) { + node.attr(internalName, "true"); + } else if (className.indexOf(nonEditClass) !== -1) { + node.attr(internalName, "false"); + } + } + }); + + // Remove internal name + ed.serializer.addAttributeFilter(internalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (nonEditableRegExps && node.attr('data-mce-content')) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = node.attr('data-mce-content'); + } else { + node.attr(externalName, null); + node.attr(internalName, null); + } + } + }); + + // Convert external name into internal name + ed.parser.addAttributeFilter(externalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr(internalName, node.attr(externalName)); + node.attr(externalName, null); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'Non editable elements', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js new file mode 100644 index 00000000..35085e8a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js new file mode 100644 index 00000000..a094c191 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -0,0 +1,74 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.PageBreakPlugin', { + init : function(ed, url) { + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + + pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); + + // Register commands + ed.addCommand('mcePageBreak', function() { + ed.execCommand('mceInsertContent', 0, pb); + }); + + // Register buttons + ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); + + ed.onInit.add(function() { + if (ed.theme.onResolveName) { + ed.theme.onResolveName.add(function(th, o) { + if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) + o.name = 'pagebreak'; + }); + } + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) + ed.selection.select(e); + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(pbRE, pb); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = o.content.replace(/]+>/g, function(im) { + if (im.indexOf('class="mcePageBreak') !== -1) + im = sep; + + return im; + }); + }); + }, + + getInfo : function() { + return { + longname : 'PageBreak', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css new file mode 100644 index 00000000..fca2dce9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css @@ -0,0 +1,3 @@ +iframe { + border: none !important; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js new file mode 100644 index 00000000..cc966e6c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"600",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"
                  ")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

                  "+o.encode(r).replace(/\r?\n\r?\n/g,"

                  ").replace(/\r?\n/g,"
                  ")+"

                  "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:
                   [\s\r\n]+|
                  )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
                   [\s\r\n]+|
                  )*/g,"$1"]]);d([[/

                  /g,"

                  "],[/
                  /g," "],[/

                  /g,"
                  "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

                  ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

                  $1

                  ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

                  "],[/<\/h[1-6][^>]*>/gi,"

                  "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"
                  "]])}else{if(e=="p"){h([[/\n+/g,"

                  "],[/^(.*<\/p>)(

                  )$/,"

                  $1"]])}else{h([[/\n\n/g,"

                  "],[/^(.*<\/p>)(

                  )$/,"

                  $1"],[/\n/g,"
                  "]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js new file mode 100644 index 00000000..73fe7fe9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js @@ -0,0 +1,871 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, + defs = { + paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, + paste_block_drop : false, + paste_retain_style_properties : "none", + paste_strip_class_attributes : "mso", + paste_remove_spans : false, + paste_remove_styles : false, + paste_remove_styles_if_webkit : true, + paste_convert_middot_lists : true, + paste_convert_headers_to_strong : false, + paste_dialog_width : "450", + paste_dialog_height : "400", + paste_text_use_dialog : false, + paste_text_sticky : false, + paste_text_sticky_default : false, + paste_text_notifyalways : false, + paste_text_linebreaktype : "combined", + paste_text_replacements : [ + [/\u2026/g, "..."], + [/[\x93\x94\u201c\u201d]/g, '"'], + [/[\x60\x91\x92\u2018\u2019]/g, "'"] + ] + }; + + function getParam(ed, name) { + return ed.getParam(name, defs[name]); + } + + tinymce.create('tinymce.plugins.PastePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Setup plugin events + t.onPreProcess = new tinymce.util.Dispatcher(t); + t.onPostProcess = new tinymce.util.Dispatcher(t); + + // Register default handlers + t.onPreProcess.add(t._preProcess); + t.onPostProcess.add(t._postProcess); + + // Register optional preprocess handler + t.onPreProcess.add(function(pl, o) { + ed.execCallback('paste_preprocess', pl, o); + }); + + // Register optional postprocess + t.onPostProcess.add(function(pl, o) { + ed.execCallback('paste_postprocess', pl, o); + }); + + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + + // Initialize plain text flag + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); + + // This function executes the process handlers and inserts the contents + // force_rich overrides plain text mode set by user, important for pasting with execCommand + function process(o, force_rich) { + var dom = ed.dom, rng; + + // Execute pre process handlers + t.onPreProcess.dispatch(t, o); + + // Create DOM structure + o.node = dom.create('div', 0, o.content); + + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + + // Execute post process handlers + t.onPostProcess.dispatch(t, o); + + // Serialize content + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); + + // Plain text option active? + if ((!force_rich) && (ed.pasteAsPlainText)) { + t._insertPlainText(o.content); + + if (!getParam(ed, "paste_text_sticky")) { + ed.pasteAsPlainText = false; + ed.controlManager.setActive("pastetext", false); + } + } else { + t._insert(o.content); + } + } + + // Add command for external usage + ed.addCommand('mceInsertClipboardContent', function(u, o) { + process(o, true); + }); + + if (!getParam(ed, "paste_text_use_dialog")) { + ed.addCommand('mcePasteText', function(u, v) { + var cookie = tinymce.util.Cookie; + + ed.pasteAsPlainText = !ed.pasteAsPlainText; + ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); + + if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { + if (getParam(ed, "paste_text_sticky")) { + ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + } else { + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); + } + + if (!getParam(ed, "paste_text_notifyalways")) { + cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) + } + } + }); + } + + ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); + ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); + + // This function grabs the contents from the clipboard by adding a + // hidden div and placing the caret inside it and after the browser paste + // is done it grabs that contents and processes that + function grabContent(e) { + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; + + // Check if browser supports direct plaintext access + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
                  ')}); + return; + } + } + + if (dom.get('_mcePaste')) + return; + + // Create container to paste into + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); + + // If contentEditable mode we need to find out the position of the closest element + if (body != ed.getDoc().body) + posY = dom.getPos(ed.selection.getStart(), body).y; + else + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; + + // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail + dom.setStyles(n, { + position : 'absolute', + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, + width : 1, + height : 1, + overflow : 'hidden' + }); + + if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + + // Select the container + rng = dom.doc.body.createTextRange(); + rng.moveToElementText(n); + rng.execCommand('Paste'); + + // Remove container + dom.remove(n); + + // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due + // to IE security settings so we pass the junk though better than nothing right + if (n.innerHTML === '\uFEFF\uFEFF') { + ed.execCommand('mcePasteWord'); + e.preventDefault(); + return; + } + + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); + + // Block the real paste event + return tinymce.dom.Event.cancel(e); + } else { + function block(e) { + e.preventDefault(); + }; + + // Block mousedown and click to prevent selection change + dom.bind(ed.getDoc(), 'mousedown', block); + dom.bind(ed.getDoc(), 'keydown', block); + + or = ed.selection.getRng(); + + // Move select contents inside DIV + n = n.firstChild; + rng = ed.getDoc().createRange(); + rng.setStart(n, 0); + rng.setEnd(n, 2); + sel.setRng(rng); + + // Wait a while and grab the pasted contents + window.setTimeout(function() { + var h = '', nl; + + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); + + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; + + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

                  ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

                  ').replace(/\r?\n/g, '
                  ') + '

                  '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + } + }); + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
                   [\s\r\n]+|
                  )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
                   [\s\r\n]+|
                  )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

                  /g, '

                  '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
                  /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

                  /g, '
                  '] // Replace back the double brs but into a single BR + ]); + } + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

                  ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

                  $1

                  "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

                  "], + [/<\/h[1-6][^>]*>/gi, "

                  "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(content) { + var ed = this.editor, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + content = content.replace(v, ""); + else + content = content.replace(v[0], v[1]); + }); + }; + + if ((typeof(content) === "string") && (content.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
                  tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars. + [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks + ]); + + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); + + // Perform default or custom replacements + if (is(rl, "array")) { + process(rl); + } else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + // Convert all line breaks to space + process([ + [/\n+/g, " "] + ]); + } else if (linebr == "br") { + // Convert all line breaks to
                  + process([ + [/\n/g, "
                  "] + ]); + } else if (linebr == "p") { + // Convert all line breaks to

                  ...

                  + process([ + [/\n+/g, "

                  "], + [/^(.*<\/p>)(

                  )$/, '

                  $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
                  and double line breaks to

                  ...

                  + process([ + [/\n\n/g, "

                  "], + [/^(.*<\/p>)(

                  )$/, '

                  $1'], + [/\n/g, "
                  "] + ]); + } + + ed.execCommand('mceInsertContent', false, content); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js new file mode 100644 index 00000000..96e6672e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

                  ' + row + '

                  '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 130) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js new file mode 100644 index 00000000..18f6f828 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js @@ -0,0 +1,51 @@ +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 130) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js new file mode 100644 index 00000000..84b9bc62 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.paste_dlg',{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js new file mode 100644 index 00000000..bc74daf8 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm new file mode 100644 index 00000000..34d08870 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm @@ -0,0 +1,34 @@ + + + {#paste.paste_text_desc} + + + + + + +
                  +
                  {#paste.paste_text_desc}
                  + +
                  + +
                  + +
                  + +
                  {#paste_dlg.text_title}
                  + + + +
                  +
                  + +
                  + +
                  + +
                  +
                  +
                  + + \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm new file mode 100644 index 00000000..5d450f50 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm @@ -0,0 +1,22 @@ + + + {#paste.paste_word_desc} + + + + + + +
                  +
                  {#paste.paste_word_desc}
                  +

                  {#paste_dlg.word_title}

                  +
                  +
                  +
                    +
                  • +
                  • +
                  +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js new file mode 100644 index 00000000..e47a5c63 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"
                  ")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

                  "+o.encode(r).replace(/\r?\n\r?\n/g,"

                  ").replace(/\r?\n/g,"
                  ")+"

                  "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:
                   [\s\r\n]+|
                  )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
                   [\s\r\n]+|
                  )*/g,"$1"]]);d([[/

                  /g,"

                  "],[/
                  /g," "],[/

                  /g,"
                  "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

                  ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

                  $1

                  ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

                  "],[/<\/h[1-6][^>]*>/gi,"

                  "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"
                  "]])}else{if(e=="p"){h([[/\n+/g,"

                  "],[/^(.*<\/p>)(

                  )$/,"

                  $1"]])}else{h([[/\n\n/g,"

                  "],[/^(.*<\/p>)(

                  )$/,"

                  $1"],[/\n/g,"
                  "]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js new file mode 100644 index 00000000..73fe7fe9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/editor_plugin_src.js @@ -0,0 +1,871 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each, + defs = { + paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, + paste_block_drop : false, + paste_retain_style_properties : "none", + paste_strip_class_attributes : "mso", + paste_remove_spans : false, + paste_remove_styles : false, + paste_remove_styles_if_webkit : true, + paste_convert_middot_lists : true, + paste_convert_headers_to_strong : false, + paste_dialog_width : "450", + paste_dialog_height : "400", + paste_text_use_dialog : false, + paste_text_sticky : false, + paste_text_sticky_default : false, + paste_text_notifyalways : false, + paste_text_linebreaktype : "combined", + paste_text_replacements : [ + [/\u2026/g, "..."], + [/[\x93\x94\u201c\u201d]/g, '"'], + [/[\x60\x91\x92\u2018\u2019]/g, "'"] + ] + }; + + function getParam(ed, name) { + return ed.getParam(name, defs[name]); + } + + tinymce.create('tinymce.plugins.PastePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Setup plugin events + t.onPreProcess = new tinymce.util.Dispatcher(t); + t.onPostProcess = new tinymce.util.Dispatcher(t); + + // Register default handlers + t.onPreProcess.add(t._preProcess); + t.onPostProcess.add(t._postProcess); + + // Register optional preprocess handler + t.onPreProcess.add(function(pl, o) { + ed.execCallback('paste_preprocess', pl, o); + }); + + // Register optional postprocess + t.onPostProcess.add(function(pl, o) { + ed.execCallback('paste_postprocess', pl, o); + }); + + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + + // Initialize plain text flag + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); + + // This function executes the process handlers and inserts the contents + // force_rich overrides plain text mode set by user, important for pasting with execCommand + function process(o, force_rich) { + var dom = ed.dom, rng; + + // Execute pre process handlers + t.onPreProcess.dispatch(t, o); + + // Create DOM structure + o.node = dom.create('div', 0, o.content); + + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + + // Execute post process handlers + t.onPostProcess.dispatch(t, o); + + // Serialize content + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); + + // Plain text option active? + if ((!force_rich) && (ed.pasteAsPlainText)) { + t._insertPlainText(o.content); + + if (!getParam(ed, "paste_text_sticky")) { + ed.pasteAsPlainText = false; + ed.controlManager.setActive("pastetext", false); + } + } else { + t._insert(o.content); + } + } + + // Add command for external usage + ed.addCommand('mceInsertClipboardContent', function(u, o) { + process(o, true); + }); + + if (!getParam(ed, "paste_text_use_dialog")) { + ed.addCommand('mcePasteText', function(u, v) { + var cookie = tinymce.util.Cookie; + + ed.pasteAsPlainText = !ed.pasteAsPlainText; + ed.controlManager.setActive('pastetext', ed.pasteAsPlainText); + + if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) { + if (getParam(ed, "paste_text_sticky")) { + ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + } else { + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); + } + + if (!getParam(ed, "paste_text_notifyalways")) { + cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31)) + } + } + }); + } + + ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'}); + ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'}); + + // This function grabs the contents from the clipboard by adding a + // hidden div and placing the caret inside it and after the browser paste + // is done it grabs that contents and processes that + function grabContent(e) { + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; + + // Check if browser supports direct plaintext access + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
                  ')}); + return; + } + } + + if (dom.get('_mcePaste')) + return; + + // Create container to paste into + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); + + // If contentEditable mode we need to find out the position of the closest element + if (body != ed.getDoc().body) + posY = dom.getPos(ed.selection.getStart(), body).y; + else + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; + + // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail + dom.setStyles(n, { + position : 'absolute', + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, + width : 1, + height : 1, + overflow : 'hidden' + }); + + if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + + // Select the container + rng = dom.doc.body.createTextRange(); + rng.moveToElementText(n); + rng.execCommand('Paste'); + + // Remove container + dom.remove(n); + + // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due + // to IE security settings so we pass the junk though better than nothing right + if (n.innerHTML === '\uFEFF\uFEFF') { + ed.execCommand('mcePasteWord'); + e.preventDefault(); + return; + } + + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); + + // Block the real paste event + return tinymce.dom.Event.cancel(e); + } else { + function block(e) { + e.preventDefault(); + }; + + // Block mousedown and click to prevent selection change + dom.bind(ed.getDoc(), 'mousedown', block); + dom.bind(ed.getDoc(), 'keydown', block); + + or = ed.selection.getRng(); + + // Move select contents inside DIV + n = n.firstChild; + rng = ed.getDoc().createRange(); + rng.setStart(n, 0); + rng.setEnd(n, 2); + sel.setRng(rng); + + // Wait a while and grab the pasted contents + window.setTimeout(function() { + var h = '', nl; + + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); + + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; + + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

                  ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

                  ').replace(/\r?\n/g, '
                  ') + '

                  '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + } + }); + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
                   [\s\r\n]+|
                  )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
                   [\s\r\n]+|
                  )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

                  /g, '

                  '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
                  /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

                  /g, '
                  '] // Replace back the double brs but into a single BR + ]); + } + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

                  ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

                  $1

                  "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

                  "], + [/<\/h[1-6][^>]*>/gi, "

                  "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(content) { + var ed = this.editor, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + content = content.replace(v, ""); + else + content = content.replace(v[0], v[1]); + }); + }; + + if ((typeof(content) === "string") && (content.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
                  tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars. + [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks + ]); + + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); + + // Perform default or custom replacements + if (is(rl, "array")) { + process(rl); + } else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + // Convert all line breaks to space + process([ + [/\n+/g, " "] + ]); + } else if (linebr == "br") { + // Convert all line breaks to
                  + process([ + [/\n/g, "
                  "] + ]); + } else if (linebr == "p") { + // Convert all line breaks to

                  ...

                  + process([ + [/\n+/g, "

                  "], + [/^(.*<\/p>)(

                  )$/, '

                  $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
                  and double line breaks to

                  ...

                  + process([ + [/\n\n/g, "

                  "], + [/^(.*<\/p>)(

                  )$/, '

                  $1'], + [/\n/g, "
                  "] + ]); + } + + ed.execCommand('mceInsertContent', false, content); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js new file mode 100644 index 00000000..c524f9eb --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

                  ' + row + '

                  '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js new file mode 100644 index 00000000..a52731c3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/js/pasteword.js @@ -0,0 +1,51 @@ +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js new file mode 100644 index 00000000..84b9bc62 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.paste_dlg',{"word_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.","text_linebreaks":"Zeilenumbr\u00fcche beibehalten","text_title":"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js new file mode 100644 index 00000000..bc74daf8 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm new file mode 100644 index 00000000..b6559454 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/pastetext.htm @@ -0,0 +1,27 @@ + + + {#paste.paste_text_desc} + + + + +
                  +
                  {#paste.paste_text_desc}
                  + +
                  + +
                  + +
                  + +
                  {#paste_dlg.text_title}
                  + + + +
                  + + +
                  +
                  + + \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm new file mode 100644 index 00000000..0f6bb412 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/paste_orig/pasteword.htm @@ -0,0 +1,21 @@ + + + {#paste.paste_word_desc} + + + + +
                  +
                  {#paste.paste_word_desc}
                  + +
                  {#paste_dlg.word_title}
                  + +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js new file mode 100644 index 00000000..507909c5 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js new file mode 100644 index 00000000..80f00f0d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js @@ -0,0 +1,53 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Preview', { + init : function(ed, url) { + var t = this, css = tinymce.explode(ed.settings.content_css); + + t.editor = ed; + + // Force absolute CSS urls + tinymce.each(css, function(u, k) { + css[k] = ed.documentBaseURI.toAbsolute(u); + }); + + ed.addCommand('mcePreview', function() { + ed.windowManager.open({ + file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), + width : parseInt(ed.getParam("plugin_preview_width", "550")), + height : parseInt(ed.getParam("plugin_preview_height", "600")), + resizable : "yes", + scrollbars : "yes", + popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), + inline : ed.getParam("plugin_preview_inline", 1) + }, { + base : ed.documentBaseURI.getURI() + }); + }); + + ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); + }, + + getInfo : function() { + return { + longname : 'Preview', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('preview', tinymce.plugins.Preview); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/example.html b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/example.html new file mode 100644 index 00000000..b2c3d90c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/example.html @@ -0,0 +1,28 @@ + + + + + +Example of a custom preview page + + + +Editor contents:
                  +
                  + +
                  + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js new file mode 100644 index 00000000..f8dc8105 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ' + + + + + +{#preview.preview_desc} + + + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js new file mode 100644 index 00000000..b5b3a55e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js new file mode 100644 index 00000000..3933fe65 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js @@ -0,0 +1,34 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Print', { + init : function(ed, url) { + ed.addCommand('mcePrint', function() { + ed.getWin().print(); + }); + + ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); + }, + + getInfo : function() { + return { + longname : 'Print', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('print', tinymce.plugins.Print); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js new file mode 100644 index 00000000..8e939966 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js new file mode 100644 index 00000000..f5a3de8f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js @@ -0,0 +1,101 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Save', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceSave', t._save, t); + ed.addCommand('mceCancel', t._cancel, t); + + // Register buttons + ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); + ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); + + ed.onNodeChange.add(t._nodeChange, t); + ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); + }, + + getInfo : function() { + return { + longname : 'Save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var ed = this.editor; + + if (ed.getParam('save_enablewhendirty')) { + cm.setDisabled('save', !ed.isDirty()); + cm.setDisabled('cancel', !ed.isDirty()); + } + }, + + // Private methods + + _save : function() { + var ed = this.editor, formObj, os, i, elementId; + + formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); + + if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) + return; + + tinyMCE.triggerSave(); + + // Use callback instead + if (os = ed.getParam("save_onsavecallback")) { + if (ed.execCallback('save_onsavecallback', ed)) { + ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); + ed.nodeChanged(); + } + + return; + } + + if (formObj) { + ed.isNotDirty = true; + + if (formObj.onsubmit == null || formObj.onsubmit() != false) + formObj.submit(); + + ed.nodeChanged(); + } else + ed.windowManager.alert("Error: No form element found."); + }, + + _cancel : function() { + var ed = this.editor, os, h = tinymce.trim(ed.startContent); + + // Use callback instead + if (os = ed.getParam("save_oncancelcallback")) { + ed.execCallback('save_oncancelcallback', ed); + return; + } + + ed.setContent(h); + ed.undoManager.clear(); + ed.nodeChanged(); + } + }); + + // Register plugin + tinymce.PluginManager.add('save', tinymce.plugins.Save); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css new file mode 100644 index 00000000..ecdf58c7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js new file mode 100644 index 00000000..940492aa --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:600+parseInt(a.getLang("searchreplace.delta_width",0)),height:270+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js new file mode 100644 index 00000000..4c87e8fa --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js new file mode 100644 index 00000000..80284b9f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -0,0 +1,142 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js new file mode 100644 index 00000000..7c40acd9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{findwhat:"Zu suchender Text",replacewith:"Ersetzen durch",direction:"Suchrichtung",up:"Aufw\u00e4rts",down:"Abw\u00e4rts",mcase:"Gro\u00df-/Kleinschreibung beachten",findnext:"Weitersuchen",allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.","searchnext_desc":"Weitersuchen",notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.","search_title":"Suchen","replace_title":"Suchen/Ersetzen",replaceall:"Alle ersetzen",replace:"Ersetzen"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js new file mode 100644 index 00000000..8a659009 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm new file mode 100644 index 00000000..50d4e09c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -0,0 +1,87 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
                  + + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + + + + +
                  +
                  +
                  +
                  +
                  + + +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + + + + +
                  +
                  +
                  +
                  +
                  + + +
                  +
                  +
                  +
                  + +
                  +
                  +
                    +
                  • +
                  • +
                  • +
                  • +
                  +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css new file mode 100644 index 00000000..ecdf58c7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js new file mode 100644 index 00000000..fc8a0837 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:264+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js new file mode 100644 index 00000000..4c87e8fa --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js new file mode 100644 index 00000000..80284b9f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/js/searchreplace.js @@ -0,0 +1,142 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js new file mode 100644 index 00000000..7c40acd9 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{findwhat:"Zu suchender Text",replacewith:"Ersetzen durch",direction:"Suchrichtung",up:"Aufw\u00e4rts",down:"Abw\u00e4rts",mcase:"Gro\u00df-/Kleinschreibung beachten",findnext:"Weitersuchen",allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.","searchnext_desc":"Weitersuchen",notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.","search_title":"Suchen","replace_title":"Suchen/Ersetzen",replaceall:"Alle ersetzen",replace:"Ersetzen"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js new file mode 100644 index 00000000..8a659009 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm new file mode 100644 index 00000000..5a22d8aa --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/searchreplace_orig/searchreplace.htm @@ -0,0 +1,100 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
                  + + +
                  +
                  + + + + + + + + + + + +
                  + + + + + + + + + +
                  + + + + + +
                  +
                  +
                  + +
                  + + + + + + + + + + + + + + + +
                  + + + + + + + + + +
                  + + + + + +
                  +
                  +
                  + +
                  + +
                  + + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css new file mode 100644 index 00000000..24efa021 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css @@ -0,0 +1 @@ +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js new file mode 100644 index 00000000..48549c92 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}\u201d\u201c');for(d=0;d$2");while((s=p.indexOf(""))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(g.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(g.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(g.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(f,'$1$2')}g.replace(q,t)}});i.setRng(d)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js new file mode 100644 index 00000000..86fdfceb --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js @@ -0,0 +1,436 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.SpellcheckerPlugin', { + getInfo : function() { + return { + longname : 'Spellchecker', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + init : function(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); + + if (t.rpcUrl == '{backend}') { + // Sniff if the browser supports native spellchecking (Don't know of a better way) + if (tinymce.isIE) + return; + + t.hasSupport = true; + + // Disable the context menu when spellchecking is active + ed.onContextMenu.addToTop(function(ed, e) { + if (t.active) + return false; + }); + } + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (t.rpcUrl == '{backend}') { + // Enable/disable native spellchecker + t.editor.getBody().spellcheck = t.active = !t.active; + return; + } + + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + + if (ed.getParam('spellchecker_report_no_misspellings', true)) + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + if (ed.settings.content_css !== false) + ed.contentCSS.push(url + '/css/content.css'); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + // Use basic button if we use the native spellchecker + if (t.rpcUrl == '{backend}') { + // Create simple toggle button if we have native support + if (t.hasSupport) + c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + return c; + } + + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + if (v == t.selectedLang) { + return; + } + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); + + // Build word separator regexp + for (i=0; i elements content is broken after spellchecking. + // Bug #1408: Preceding whitespace characters are removed + // @TODO: I'm not sure that both are still issues on IE9. + if (tinymce.isIE) { + // Enclose mispelled words with temporal tag + v = v.replace(rx, '$1$2'); + // Loop over the content finding mispelled words + while ((pos = v.indexOf('')) != -1) { + // Add text node for the content before the word + txt = v.substring(0, pos); + if (txt.length) { + node = doc.createTextNode(dom.decode(txt)); + elem.appendChild(node); + } + v = v.substring(pos+10); + pos = v.indexOf(''); + txt = v.substring(0, pos); + v = v.substring(pos+11); + // Add span element for the word + elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); + } + // Add text node for the rest of the content + if (v.length) { + node = doc.createTextNode(dom.decode(v)); + elem.appendChild(node); + } + } else { + // Other browsers preserve whitespace characters on innerHTML usage + elem.innerHTML = v.replace(rx, '$1$2'); + } + + // Finally, replace the node with the container + dom.replace(elem, n); + } + }); + + se.setRng(r); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; + + e = 0; // Fixes IE memory leak + + if (!m) { + m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); + t._menu = m; + } + + if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { + var ignoreRpc; + + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), wordSpan); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + if (ed.getParam('show_ignore_words', true)) { + ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + var word = wordSpan.innerHTML; + + t._removeWords(dom.decode(word)); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + } + + if (t.editor.getParam("spellchecker_enable_learn_rpc")) { + m.add({ + title : 'spellchecker.learn_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + ed.setProgressState(1); + t._sendRPC('learnWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + }); + } + + m.update(); + }); + + p1 = DOM.getPos(ed.getContentAreaContainer()); + m.settings.offset_x = p1.x; + m.settings.offset_y = p1.y; + + ed.selection.select(wordSpan); + p1 = dom.getPos(wordSpan); + m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this; + + JSONRequest.sendRPC({ + url : t.rpcUrl, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif new file mode 100644 index 00000000..7d0a4dbc Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/css/props.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/css/props.css new file mode 100644 index 00000000..3b8f0ee7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/css/props.css @@ -0,0 +1,14 @@ +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_toggle_insert_span {padding-top:10px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js new file mode 100644 index 00000000..dda9f928 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){var c=false;var f=a.selection.getSelectedBlocks();var d=[];if(f.length===1){d.push(a.selection.getNode().style.cssText)}else{tinymce.each(f,function(g){d.push(a.dom.getAttrib(g,"style"))});c=true}a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:340+parseInt(a.getLang("style.delta_height",0)),inline:1},{applyStyleToBlocks:c,plugin_url:b,styles:d})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js new file mode 100644 index 00000000..eaa7c771 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js @@ -0,0 +1,71 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + + var applyStyleToBlocks = false; + var blocks = ed.selection.getSelectedBlocks(); + var styles = []; + + if (blocks.length === 1) { + styles.push(ed.selection.getNode().style.cssText); + } + else { + tinymce.each(blocks, function(block) { + styles.push(ed.dom.getAttrib(block, 'style')); + }); + applyStyleToBlocks = true; + } + + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 340 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + applyStyleToBlocks : applyStyleToBlocks, + plugin_url : url, + styles : styles + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); + }, + + getInfo : function() { + return { + longname : 'Style', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/js/props.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/js/props.js new file mode 100644 index 00000000..0a8a8ec3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/js/props.js @@ -0,0 +1,709 @@ +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function aggregateStyles(allStyles) { + var mergedStyles = {}; + + tinymce.each(allStyles, function(style) { + if (style !== '') { + var parsedStyles = tinyMCEPopup.editor.dom.parseStyle(style); + for (var name in parsedStyles) { + if (parsedStyles.hasOwnProperty(name)) { + if (mergedStyles[name] === undefined) { + mergedStyles[name] = parsedStyles[name]; + } + else if (name === 'text-decoration') { + if (mergedStyles[name].indexOf(parsedStyles[name]) === -1) { + mergedStyles[name] = mergedStyles[name] +' '+ parsedStyles[name]; + } + } + } + } + } + }); + + return mergedStyles; +} + +var applyActionIsInsert; +var existingStyles; + +function init(ed) { + var ce = document.getElementById('container'), h; + + existingStyles = aggregateStyles(tinyMCEPopup.getWindowArg('styles')); + ce.style.cssText = tinyMCEPopup.editor.dom.serializeStyle(existingStyles); + + applyActionIsInsert = ed.getParam("edit_css_style_insert_span", false); + document.getElementById('toggle_insert_span').checked = applyActionIsInsert; + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + f.text_none.checked = inStr(ce.style.textDecoration, 'none'); + updateTextDecorations(); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9.]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) + return s.replace(/[^0-9.]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +function updateTextDecorations(){ + var el = document.forms[0].elements; + + var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"]; + var noneChecked = el["text_none"].checked; + tinymce.each(textDecorations, function(id) { + el[id].disabled = noneChecked; + if (noneChecked) { + el[id].checked = false; + } + }); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js new file mode 100644 index 00000000..ad04664e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.style_dlg',{"text_lineheight":"Zeilenh\u00f6he","text_variant":"Variante","text_style":"Stil","text_weight":"Dicke","text_size":"Gr\u00f6\u00dfe","text_font":"Schriftart","text_props":"Text","positioning_tab":"Positionierung","list_tab":"Liste","border_tab":"Rahmen","box_tab":"Box","block_tab":"Block","background_tab":"Hintergrund","text_tab":"Text",apply:"\u00dcbernehmen",title:"CSS-Styles bearbeiten",clip:"Ausschnitt",placement:"Platzierung",overflow:"Verhalten bei \u00dcbergr\u00f6\u00dfe",zindex:"Z-Wert",visibility:"Sichtbar","positioning_type":"Art der Positionierung",position:"Positionierung","bullet_image":"Listenpunkt-Grafik","list_type":"Listenpunkt-Art",color:"Textfarbe",height:"H\u00f6he",width:"Breite",style:"Format",margin:"\u00c4u\u00dferer Abstand",left:"Links",bottom:"Unten",right:"Rechts",top:"Oben",same:"Alle gleich",padding:"Innerer Abstand","box_clear":"Umflie\u00dfung verhindern","box_float":"Umflie\u00dfung","box_height":"H\u00f6he","box_width":"Breite","block_display":"Umbruchverhalten","block_whitespace":"Automatischer Umbruch","block_text_indent":"Einr\u00fcckung","block_text_align":"Ausrichtung","block_vertical_alignment":"Vertikale Ausrichtung","block_letterspacing":"Buchstabenabstand","block_wordspacing":"Wortabstand","background_vpos":"Position Y","background_hpos":"Position X","background_attachment":"Wasserzeicheneffekt","background_repeat":"Wiederholung","background_image":"Hintergrundbild","background_color":"Hintergrundfarbe","text_none":"keine","text_blink":"blinkend","text_case":"Schreibung","text_striketrough":"durchgestrichen","text_underline":"unterstrichen","text_overline":"\u00fcberstrichen","text_decoration":"Gestaltung","text_color":"Farbe",text:"Text",background:"Hintergrund",block:"Block",box:"Box",border:"Rahmen",list:"Liste"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js new file mode 100644 index 00000000..9a1d4a22 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/props.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/props.htm new file mode 100644 index 00000000..7dc087a3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/props.htm @@ -0,0 +1,845 @@ + + + + {#style_dlg.title} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#style_dlg.text} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + + + + + + +
                    + + +
                  +
                  + +
                  + + + +
                  + + + + + + +
                  + +   + + +
                  +
                  + +
                  + + + + + +
                   
                  +
                  {#style_dlg.text_decoration} + + + + + + + + + + + + + + + + + + + + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.background} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + + + +
                   
                  +
                  + + + + +
                   
                  +
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.block} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.box} + + + + + + + + + + + + + + +
                  + + + + + + +
                    + + +
                  +
                     
                  + + + + + + +
                    + + +
                  +
                     
                  +
                  + +
                  +
                  + {#style_dlg.padding} + + + + + + + + + + + + + + + + + + + + + + +
                   
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.margin} + + + + + + + + + + + + + + + + + + + + + + +
                   
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  + + + + + + +
                    + + +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.border} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                    {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
                        
                  {#style_dlg.top}   + + + + + + +
                    + + +
                  +
                    + + + + + +
                   
                  +
                  {#style_dlg.right}   + + + + + + +
                    + + +
                  +
                    + + + + + +
                   
                  +
                  {#style_dlg.bottom}   + + + + + + +
                    + + +
                  +
                    + + + + + +
                   
                  +
                  {#style_dlg.left}   + + + + + + +
                    + + +
                  +
                    + + + + + +
                   
                  +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.list} + + + + + + + + + + + + + + + +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.position} + + + + + + + + + + + + + + + + + + + + + +
                     
                  + + + + + + +
                    + + +
                  +
                     
                  + + + + + + +
                    + + +
                  +
                     
                  +
                  + +
                  +
                  + {#style_dlg.placement} + + + + + + + + + + + + + + + + + + + + + + +
                   
                  {#style_dlg.top} + + + + + + +
                    + + +
                  +
                  {#style_dlg.right} + + + + + + +
                    + + +
                  +
                  {#style_dlg.bottom} + + + + + + +
                    + + +
                  +
                  {#style_dlg.left} + + + + + + +
                    + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#style_dlg.clip} + + + + + + + + + + + + + + + + + + + + + + +
                   
                  {#style_dlg.top} + + + + + + +
                    + + +
                  +
                  {#style_dlg.right} + + + + + + +
                    + + +
                  +
                  {#style_dlg.bottom} + + + + + + +
                    + + +
                  +
                  {#style_dlg.left} + + + + + + +
                    + + +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  + + +
                  + +
                  + + + +
                  +
                  + +
                  +
                  +
                  + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/readme.txt b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/readme.txt new file mode 100644 index 00000000..5bac3020 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/style/readme.txt @@ -0,0 +1,19 @@ +Edit CSS Style plug-in notes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Unlike WYSIWYG editor functionality that operates only on the selected text, +typically by inserting new HTML elements with the specified styles. +This plug-in operates on the HTML blocks surrounding the selected text. +No new HTML elements are created. + +This plug-in only operates on the surrounding blocks and not the nearest +parent node. This means that if a block encapsulates a node, +e.g

                  text

                  , then only the styles in the block are +recognized, not those in the span. + +When selecting text that includes multiple blocks at the same level (peers), +this plug-in accumulates the specified styles in all of the surrounding blocks +and populates the dialogue checkboxes accordingly. There is no differentiation +between styles set in all the blocks versus styles set in some of the blocks. + +When the [Update] or [Apply] buttons are pressed, the styles selected in the +checkboxes are applied to all blocks that surround the selected text. diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js new file mode 100644 index 00000000..42a82d11 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js new file mode 100644 index 00000000..a1579c85 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js @@ -0,0 +1,122 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; + + tinymce.create('tinymce.plugins.TabFocusPlugin', { + init : function(ed, url) { + function tabCancel(ed, e) { + if (e.keyCode === 9) + return Event.cancel(e); + } + + function tabHandler(ed, e) { + var x, i, f, el, v; + + function find(d) { + el = DOM.select(':input:enabled,*[tabindex]'); + + function canSelectRecursive(e) { + return e.nodeName==="BODY" || (e.type != 'hidden' && + !(e.style.display == "none") && + !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); + } + function canSelectInOldIe(el) { + return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; + } + function isOldIe() { + return tinymce.isIE6 || tinymce.isIE7; + } + function canSelect(el) { + return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); + } + + each(el, function(e, i) { + if (e.id == ed.id) { + x = i; + return false; + } + }); + if (d > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) + return el[i]; + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) + return el[i]; + } + } + + return null; + } + + if (e.keyCode === 9) { + v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); + + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') + el = find(-1); + else + el = DOM.get(v[0]); + } else { + if (v[1] == ':next') + el = find(1); + else + el = DOM.get(v[1]); + } + + if (el) { + if (el.id && (ed = tinymce.get(el.id || el.name))) + ed.focus(); + else + window.setTimeout(function() { + if (!tinymce.isWebKit) + window.focus(); + el.focus(); + }, 10); + + return Event.cancel(e); + } + } + } + + ed.onKeyUp.add(tabCancel); + + if (tinymce.isGecko) { + ed.onKeyPress.add(tabHandler); + ed.onKeyDown.add(tabCancel); + } else + ed.onKeyDown.add(tabHandler); + + }, + + getInfo : function() { + return { + longname : 'Tabfocus', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/cell.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/cell.htm new file mode 100644 index 00000000..a72a8d69 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/cell.htm @@ -0,0 +1,180 @@ + + + + {#table_dlg.cell_title} + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + +
                  + + + +
                  + +
                  +
                  +
                  + +
                  +
                  + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                  +
                  +
                  +
                  + +
                  +
                  + +
                  + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css new file mode 100644 index 00000000..a067ecdf --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css @@ -0,0 +1,17 @@ +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; +} \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/row.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/row.css new file mode 100644 index 00000000..1f7755da --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/row.css @@ -0,0 +1,25 @@ +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/table.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/table.css new file mode 100644 index 00000000..d11c3f69 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/css/table.css @@ -0,0 +1,13 @@ +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js new file mode 100644 index 00000000..ad462f0e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js @@ -0,0 +1 @@ +(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='
                  '}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}if(!d.isIE){function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){r.dom.add(r.getBody(),"p",null,'
                  ')}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&z.childNodes.length==1&&z.firstChild.nodeName=="BR"){w.dom.remove(z)}});if(d.isGecko){r.onKeyDown.add(function(z,B){if(B.keyCode===d.VK.ENTER&&B.shiftKey){var A=z.selection.getRng().startContainer;var C=q.getParent(A,"td,th");if(C){var w=z.getDoc().createTextNode("\uFEFF");q.insertAfter(w,A)}}})}s();r.startContent=r.getContent({format:"raw"})}});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js new file mode 100644 index 00000000..832b5e94 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js @@ -0,0 +1,1428 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var each = tinymce.each; + + // Checks if the selection/caret is at the start of the specified block element + function isAtStart(rng, par) { + var doc = par.ownerDocument, rng2 = doc.createRange(), elm; + + rng2.setStartBefore(par); + rng2.setEnd(rng.endContainer, rng.endOffset); + + elm = doc.createElement('body'); + elm.appendChild(rng2.cloneContents()); + + // Check for text characters of other elements that should be treated as content + return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; + }; + + function getSpanVal(td, name) { + return parseInt(td.getAttribute(name) || 1); + } + + /** + * Table Grid class. + */ + function TableGrid(table, dom, selection) { + var grid, startPos, endPos, selectedCell; + + buildGrid(); + selectedCell = dom.getParent(selection.getStart(), 'th,td'); + if (selectedCell) { + startPos = getPos(selectedCell); + endPos = findEndPos(); + selectedCell = getCell(startPos.x, startPos.y); + } + + function cloneNode(node, children) { + node = node.cloneNode(children); + node.removeAttribute('id'); + + return node; + } + + function buildGrid() { + var startY = 0; + + grid = []; + + each(['thead', 'tbody', 'tfoot'], function(part) { + var rows = dom.select('> ' + part + ' tr', table); + + each(rows, function(tr, y) { + y += startY; + + each(dom.select('> td, > th', tr), function(td, x) { + var x2, y2, rowspan, colspan; + + // Skip over existing cells produced by rowspan + if (grid[y]) { + while (grid[y][x]) + x++; + } + + // Get col/rowspan from cell + rowspan = getSpanVal(td, 'rowspan'); + colspan = getSpanVal(td, 'colspan'); + + // Fill out rowspan/colspan right and down + for (y2 = y; y2 < y + rowspan; y2++) { + if (!grid[y2]) + grid[y2] = []; + + for (x2 = x; x2 < x + colspan; x2++) { + grid[y2][x2] = { + part : part, + real : y2 == y && x2 == x, + elm : td, + rowspan : rowspan, + colspan : colspan + }; + } + } + }); + }); + + startY += rows.length; + }); + }; + + function getCell(x, y) { + var row; + + row = grid[y]; + if (row) + return row[x]; + }; + + function setSpanVal(td, name, val) { + if (td) { + val = parseInt(val); + + if (val === 1) + td.removeAttribute(name, 1); + else + td.setAttribute(name, val, 1); + } + } + + function isCellSelected(cell) { + return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); + }; + + function getSelectedRows() { + var rows = []; + + each(table.rows, function(row) { + each(row.cells, function(cell) { + if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { + rows.push(row); + return false; + } + }); + }); + + return rows; + }; + + function deleteTable() { + var rng = dom.createRng(); + + rng.setStartAfter(table); + rng.setEndAfter(table); + + selection.setRng(rng); + + dom.remove(table); + }; + + function cloneCell(cell) { + var formatNode; + + // Clone formats + tinymce.walk(cell, function(node) { + var curNode; + + if (node.nodeType == 3) { + each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { + node = cloneNode(node, false); + + if (!formatNode) + formatNode = curNode = node; + else if (curNode) + curNode.appendChild(node); + + curNode = node; + }); + + // Add something to the inner node + if (curNode) + curNode.innerHTML = tinymce.isIE ? ' ' : '
                  '; + + return false; + } + }, 'childNodes'); + + cell = cloneNode(cell, false); + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + if (formatNode) { + cell.appendChild(formatNode); + } else { + if (!tinymce.isIE) + cell.innerHTML = '
                  '; + } + + return cell; + }; + + function cleanup() { + var rng = dom.createRng(); + + // Empty rows + each(dom.select('tr', table), function(tr) { + if (tr.cells.length == 0) + dom.remove(tr); + }); + + // Empty table + if (dom.select('tr', table).length == 0) { + rng.setStartAfter(table); + rng.setEndAfter(table); + selection.setRng(rng); + dom.remove(table); + return; + } + + // Empty header/body/footer + each(dom.select('thead,tbody,tfoot', table), function(part) { + if (part.rows.length == 0) + dom.remove(part); + }); + + // Restore selection to start position if it still exists + buildGrid(); + + // Restore the selection to the closest table position + row = grid[Math.min(grid.length - 1, startPos.y)]; + if (row) { + selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); + selection.collapse(true); + } + }; + + function fillLeftDown(x, y, rows, cols) { + var tr, x2, r, c, cell; + + tr = grid[y][x].elm.parentNode; + for (r = 1; r <= rows; r++) { + tr = dom.getNext(tr, 'tr'); + + if (tr) { + // Loop left to find real cell + for (x2 = x; x2 >= 0; x2--) { + cell = grid[y + r][x2].elm; + + if (cell.parentNode == tr) { + // Append clones after + for (c = 1; c <= cols; c++) + dom.insertAfter(cloneCell(cell), cell); + + break; + } + } + + if (x2 == -1) { + // Insert nodes before first cell + for (c = 1; c <= cols; c++) + tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); + } + } + } + }; + + function split() { + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan, newCell, i; + + if (isCellSelected(cell)) { + cell = cell.elm; + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan > 1 || rowSpan > 1) { + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + // Insert cells right + for (i = 0; i < colSpan - 1; i++) + dom.insertAfter(cloneCell(cell), cell); + + fillLeftDown(x, y, rowSpan - 1, colSpan); + } + } + }); + }); + }; + + function merge(cell, cols, rows) { + var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; + + // Use specified cell and cols/rows + if (cell) { + pos = getPos(cell); + startX = pos.x; + startY = pos.y; + endX = startX + (cols - 1); + endY = startY + (rows - 1); + } else { + // Use selection + startX = startPos.x; + startY = startPos.y; + endX = endPos.x; + endY = endPos.y; + } + + // Find start/end cells + startCell = getCell(startX, startY); + endCell = getCell(endX, endY); + + // Check if the cells exists and if they are of the same part for example tbody = tbody + if (startCell && endCell && startCell.part == endCell.part) { + // Split and rebuild grid + split(); + buildGrid(); + + // Set row/col span to start cell + startCell = getCell(startX, startY).elm; + setSpanVal(startCell, 'colSpan', (endX - startX) + 1); + setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); + + // Remove other cells and add it's contents to the start cell + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + if (!grid[y] || !grid[y][x]) + continue; + + cell = grid[y][x].elm; + + if (cell != startCell) { + // Move children to startCell + children = tinymce.grep(cell.childNodes); + each(children, function(node) { + startCell.appendChild(node); + }); + + // Remove bogus nodes if there is children in the target cell + if (children.length) { + children = tinymce.grep(startCell.childNodes); + count = 0; + each(children, function(node) { + if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) + startCell.removeChild(node); + }); + } + + // Remove cell + dom.remove(cell); + } + } + } + + // Remove empty rows etc and restore caret location + cleanup(); + } + }; + + function insertRow(before) { + var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; + + // Find first/last row + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + cell = cell.elm; + rowElm = cell.parentNode; + newRow = cloneNode(rowElm, false); + posY = y; + + if (before) + return false; + } + }); + + if (before) + return !posY; + }); + + for (x = 0; x < grid[0].length; x++) { + // Cell not found could be because of an invalid table structure + if (!grid[posY][x]) + continue; + + cell = grid[posY][x].elm; + + if (cell != lastCell) { + if (!before) { + rowSpan = getSpanVal(cell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan + 1); + continue; + } + } else { + // Check if cell above can be expanded + if (posY > 0 && grid[posY - 1][x]) { + otherCell = grid[posY - 1][x].elm; + rowSpan = getSpanVal(otherCell, 'rowSpan'); + if (rowSpan > 1) { + setSpanVal(otherCell, 'rowSpan', rowSpan + 1); + continue; + } + } + } + + // Insert new cell into new row + newCell = cloneCell(cell); + setSpanVal(newCell, 'colSpan', cell.colSpan); + + newRow.appendChild(newCell); + + lastCell = cell; + } + } + + if (newRow.hasChildNodes()) { + if (!before) + dom.insertAfter(newRow, rowElm); + else + rowElm.parentNode.insertBefore(newRow, rowElm); + } + }; + + function insertCol(before) { + var posX, lastCell; + + // Find first/last column + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + posX = x; + + if (before) + return false; + } + }); + + if (before) + return !posX; + }); + + each(grid, function(row, y) { + var cell, rowSpan, colSpan; + + if (!row[posX]) + return; + + cell = row[posX].elm; + if (cell != lastCell) { + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan == 1) { + if (!before) { + dom.insertAfter(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } else { + cell.parentNode.insertBefore(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } + } else + setSpanVal(cell, 'colSpan', cell.colSpan + 1); + + lastCell = cell; + } + }); + }; + + function deleteCols() { + var cols = []; + + // Get selected column indexes + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { + each(grid, function(row) { + var cell = row[x].elm, colSpan; + + colSpan = getSpanVal(cell, 'colSpan'); + + if (colSpan > 1) + setSpanVal(cell, 'colSpan', colSpan - 1); + else + dom.remove(cell); + }); + + cols.push(x); + } + }); + }); + + cleanup(); + }; + + function deleteRows() { + var rows; + + function deleteRow(tr) { + var nextTr, pos, lastCell; + + nextTr = dom.getNext(tr, 'tr'); + + // Move down row spanned cells + each(tr.cells, function(cell) { + var rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan - 1); + pos = getPos(cell); + fillLeftDown(pos.x, pos.y, 1, 1); + } + }); + + // Delete cells + pos = getPos(tr.cells[0]); + each(grid[pos.y], function(cell) { + var rowSpan; + + cell = cell.elm; + + if (cell != lastCell) { + rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan <= 1) + dom.remove(cell); + else + setSpanVal(cell, 'rowSpan', rowSpan - 1); + + lastCell = cell; + } + }); + }; + + // Get selected rows and move selection out of scope + rows = getSelectedRows(); + + // Delete all selected rows + each(rows.reverse(), function(tr) { + deleteRow(tr); + }); + + cleanup(); + }; + + function cutRows() { + var rows = getSelectedRows(); + + dom.remove(rows); + cleanup(); + + return rows; + }; + + function copyRows() { + var rows = getSelectedRows(); + + each(rows, function(row, i) { + rows[i] = cloneNode(row, true); + }); + + return rows; + }; + + function pasteRows(rows, before) { + var selectedRows = getSelectedRows(), + targetRow = selectedRows[before ? 0 : selectedRows.length - 1], + targetCellCount = targetRow.cells.length; + + // Calc target cell count + each(grid, function(row) { + var match; + + targetCellCount = 0; + each(row, function(cell, x) { + if (cell.real) + targetCellCount += cell.colspan; + + if (cell.elm.parentNode == targetRow) + match = 1; + }); + + if (match) + return false; + }); + + if (!before) + rows.reverse(); + + each(rows, function(row) { + var cellCount = row.cells.length, cell; + + // Remove col/rowspans + for (i = 0; i < cellCount; i++) { + cell = row.cells[i]; + setSpanVal(cell, 'colSpan', 1); + setSpanVal(cell, 'rowSpan', 1); + } + + // Needs more cells + for (i = cellCount; i < targetCellCount; i++) + row.appendChild(cloneCell(row.cells[cellCount - 1])); + + // Needs less cells + for (i = targetCellCount; i < cellCount; i++) + dom.remove(row.cells[i]); + + // Add before/after + if (before) + targetRow.parentNode.insertBefore(row, targetRow); + else + dom.insertAfter(row, targetRow); + }); + }; + + function getPos(target) { + var pos; + + each(grid, function(row, y) { + each(row, function(cell, x) { + if (cell.elm == target) { + pos = {x : x, y : y}; + return false; + } + }); + + return !pos; + }); + + return pos; + }; + + function setStartCell(cell) { + startPos = getPos(cell); + }; + + function findEndPos() { + var pos, maxX, maxY; + + maxX = maxY = 0; + + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan; + + if (isCellSelected(cell)) { + cell = grid[y][x]; + + if (x > maxX) + maxX = x; + + if (y > maxY) + maxY = y; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + }); + }); + + return {x : maxX, y : maxY}; + }; + + function setEndCell(cell) { + var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; + + endPos = getPos(cell); + + if (startPos && endPos) { + // Get start/end positions + startX = Math.min(startPos.x, endPos.x); + startY = Math.min(startPos.y, endPos.y); + endX = Math.max(startPos.x, endPos.x); + endY = Math.max(startPos.y, endPos.y); + + // Expand end positon to include spans + maxX = endX; + maxY = endY; + + // Expand startX + for (y = startY; y <= maxY; y++) { + cell = grid[y][startX]; + + if (!cell.real) { + if (startX - (cell.colspan - 1) < startX) + startX -= cell.colspan - 1; + } + } + + // Expand startY + for (x = startX; x <= maxX; x++) { + cell = grid[startY][x]; + + if (!cell.real) { + if (startY - (cell.rowspan - 1) < startY) + startY -= cell.rowspan - 1; + } + } + + // Find max X, Y + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + cell = grid[y][x]; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + } + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + + // Add new selection + for (y = startY; y <= maxY; y++) { + for (x = startX; x <= maxX; x++) { + if (grid[y][x]) + dom.addClass(grid[y][x].elm, 'mceSelected'); + } + } + } + }; + + // Expose to public + tinymce.extend(this, { + deleteTable : deleteTable, + split : split, + merge : merge, + insertRow : insertRow, + insertCol : insertCol, + deleteCols : deleteCols, + deleteRows : deleteRows, + cutRows : cutRows, + copyRows : copyRows, + pasteRows : pasteRows, + getPos : getPos, + setStartCell : setStartCell, + setEndCell : setEndCell + }); + }; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload + + function createTableGrid(node) { + var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); + + if (tblElm) + return new TableGrid(tblElm, ed.dom, selection); + }; + + function cleanup() { + // Restore selection possibilities + ed.getBody().style.webkitUserSelect = ''; + + if (hasCellSelection) { + ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + hasCellSelection = false; + } + }; + + // Register buttons + each([ + ['table', 'table.desc', 'mceInsertTable', true], + ['delete_table', 'table.del', 'mceTableDelete'], + ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table.row_desc', 'mceTableRowProps', true], + ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] + ], function(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') { + ed.selection.select(e); + ed.nodeChanged(); + } + }); + } + + ed.onPreProcess.add(function(ed, args) { + var nodes, i, node, dom = ed.dom, value; + + nodes = dom.select('table', args.node); + i = nodes.length; + while (i--) { + node = nodes[i]; + dom.setAttrib(node, 'data-mce-style', ''); + + if ((value = dom.getAttrib(node, 'width'))) { + dom.setStyle(node, 'width', value); + dom.setAttrib(node, 'width', ''); + } + + if ((value = dom.getAttrib(node, 'height'))) { + dom.setStyle(node, 'height', value); + dom.setAttrib(node, 'height', ''); + } + } + }); + + // Handle node change updates + ed.onNodeChange.add(function(ed, cm, n) { + var p; + + n = ed.selection.getStart(); + p = ed.dom.getParent(n, 'td,th,caption'); + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + + // Disable table tools if we are in caption + if (p && p.nodeName === 'CAPTION') + p = 0; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p); + cm.setDisabled('merge_cells', !p); + }); + + ed.onInit.add(function(ed) { + var startTable, startCell, dom = ed.dom, tableGrid; + + winMan = ed.windowManager; + + // Add cell selection logic + ed.onMouseDown.add(function(ed, e) { + if (e.button != 2) { + cleanup(); + + startCell = dom.getParent(e.target, 'td,th'); + startTable = dom.getParent(startCell, 'table'); + } + }); + + dom.bind(ed.getDoc(), 'mouseover', function(e) { + var sel, table, target = e.target; + + if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { + table = dom.getParent(target, 'table'); + if (table == startTable) { + if (!tableGrid) { + tableGrid = createTableGrid(table); + tableGrid.setStartCell(startCell); + + ed.getBody().style.webkitUserSelect = 'none'; + } + + tableGrid.setEndCell(target); + hasCellSelection = true; + } + + // Remove current selection + sel = ed.selection.getSel(); + + try { + if (sel.removeAllRanges) + sel.removeAllRanges(); + else + sel.empty(); + } catch (ex) { + // IE9 might throw errors here + } + + e.preventDefault(); + } + }); + + ed.onMouseUp.add(function(ed, e) { + var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; + + // Move selection to startCell + if (startCell) { + if (tableGrid) + ed.getBody().style.webkitUserSelect = ''; + + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + } + + // Try to expand text selection as much as we can only Gecko supports cell selection + selectedCells = dom.select('td.mceSelected,th.mceSelected'); + if (selectedCells.length > 0) { + rng = dom.createRng(); + node = selectedCells[0]; + endNode = selectedCells[selectedCells.length - 1]; + rng.setStartBefore(node); + rng.setEndAfter(node); + + setPoint(node, 1); + walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); + + do { + if (node.nodeName == 'TD' || node.nodeName == 'TH') { + if (!dom.hasClass(node, 'mceSelected')) + break; + + lastNode = node; + } + } while (node = walker.next()); + + setPoint(lastNode); + + sel.setRng(rng); + } + + ed.nodeChanged(); + startCell = tableGrid = startTable = null; + } + }); + + ed.onKeyUp.add(function(ed, e) { + cleanup(); + }); + + ed.onKeyDown.add(function (ed, e) { + fixTableCellSelection(ed); + }); + + ed.onMouseDown.add(function (ed, e) { + if (e.button != 2) { + fixTableCellSelection(ed); + } + }); + function tableCellSelected(ed, rng, n, currentCell) { + // The decision of when a table cell is selected is somewhat involved. The fact that this code is + // required is actually a pointer to the root cause of this bug. A cell is selected when the start + // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) + // or the parent of the table (in the case of the selection containing the last cell of a table). + var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), + tableParent, allOfCellSelected, tableCellSelection; + if (table) + tableParent = table.parentNode; + allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && + rng.startOffset == 0 && + rng.endOffset == 0 && + currentCell && + (n.nodeName=="TR" || n==tableParent); + tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; + return allOfCellSelected || tableCellSelection; + // return false; + } + + // this nasty hack is here to work around some WebKit selection bugs. + function fixTableCellSelection(ed) { + if (!tinymce.isWebKit) + return; + + var rng = ed.selection.getRng(); + var n = ed.selection.getNode(); + var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); + + if (!tableCellSelected(ed, rng, n, currentCell)) + return; + if (!currentCell) { + currentCell=n; + } + + // Get the very last node inside the table cell + var end = currentCell.lastChild; + while (end.lastChild) + end = end.lastChild; + + // Select the entire table cell. Nothing outside of the table cell should be selected. + rng.setEnd(end, end.nodeValue.length); + ed.selection.setRng(rng); + } + ed.plugins.table.fixTableCellSelection=fixTableCellSelection; + + // Add context menu + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); + }); + } + + // Fix to allow navigating up and down in a table in WebKit browsers. + if (tinymce.isWebKit) { + function moveSelection(ed, e) { + var VK = tinymce.VK; + var key = e.keyCode; + + function handle(upBool, sourceNode, event) { + var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; + var currentRow = ed.dom.getParent(sourceNode, 'tr'); + var siblingRow = currentRow[siblingDirection]; + + if (siblingRow) { + moveCursorToRow(ed, sourceNode, siblingRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } else { + var tableNode = ed.dom.getParent(currentRow, 'table'); + var middleNode = currentRow.parentNode; + var parentNodeName = middleNode.nodeName.toLowerCase(); + if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { + var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); + if (targetParent !== null) { + return moveToRowInTarget(upBool, targetParent, sourceNode, event); + } + } + return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); + } + } + + function getTargetParent(upBool, topNode, secondNode, nodeName) { + var tbodies = ed.dom.select('>' + nodeName, topNode); + var position = tbodies.indexOf(secondNode); + if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { + return getFirstHeadOrFoot(upBool, topNode); + } else if (position === -1) { + var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; + return tbodies[topOrBottom]; + } else { + return tbodies[position + (upBool ? -1 : 1)]; + } + } + + function getFirstHeadOrFoot(upBool, parent) { + var tagName = upBool ? 'thead' : 'tfoot'; + var headOrFoot = ed.dom.select('>' + tagName, parent); + return headOrFoot.length !== 0 ? headOrFoot[0] : null; + } + + function moveToRowInTarget(upBool, targetParent, sourceNode, event) { + var targetRow = getChildForDirection(targetParent, upBool); + targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } + + function escapeTable(upBool, currentRow, siblingDirection, table, event) { + var tableSibling = table[siblingDirection]; + if (tableSibling) { + moveCursorToStartOfElement(tableSibling); + return true; + } else { + var parentCell = ed.dom.getParent(table, 'td,th'); + if (parentCell) { + return handle(upBool, parentCell, event); + } else { + var backUpSibling = getChildForDirection(currentRow, !upBool); + moveCursorToStartOfElement(backUpSibling); + return tinymce.dom.Event.cancel(event); + } + } + } + + function getChildForDirection(parent, up) { + var child = parent && parent[up ? 'lastChild' : 'firstChild']; + // BR is not a valid table child to return in this case we return the table cell + return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child; + } + + function moveCursorToStartOfElement(n) { + ed.selection.setCursorLocation(n, 0); + } + + function isVerticalMovement() { + return key == VK.UP || key == VK.DOWN; + } + + function isInTable(ed) { + var node = ed.selection.getNode(); + var currentRow = ed.dom.getParent(node, 'tr'); + return currentRow !== null; + } + + function columnIndex(column) { + var colIndex = 0; + var c = column; + while (c.previousSibling) { + c = c.previousSibling; + colIndex = colIndex + getSpanVal(c, "colspan"); + } + return colIndex; + } + + function findColumn(rowElement, columnIndex) { + var c = 0; + var r = 0; + each(rowElement.children, function(cell, i) { + c = c + getSpanVal(cell, "colspan"); + r = i; + if (c > columnIndex) + return false; + }); + return r; + } + + function moveCursorToRow(ed, node, row, upBool) { + var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); + var tgtColumnIndex = findColumn(row, srcColumnIndex); + var tgtNode = row.childNodes[tgtColumnIndex]; + var rowCellTarget = getChildForDirection(tgtNode, upBool); + moveCursorToStartOfElement(rowCellTarget || tgtNode); + } + + function shouldFixCaret(preBrowserNode) { + var newNode = ed.selection.getNode(); + var newParent = ed.dom.getParent(newNode, 'td,th'); + var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); + return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) + } + + function checkSameParentTable(nodeOne, NodeTwo) { + return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); + } + + if (isVerticalMovement() && isInTable(ed)) { + var preBrowserNode = ed.selection.getNode(); + setTimeout(function() { + if (shouldFixCaret(preBrowserNode)) { + handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); + } + }, 0); + } + } + + ed.onKeyDown.add(moveSelection); + } + + // Fixes an issue on Gecko where it's impossible to place the caret behind a table + // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled + if (!tinymce.isIE) { + function fixTableCaretPos() { + var last; + + // Skip empty text nodes form the end + for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; + + if (last && last.nodeName == 'TABLE') + ed.dom.add(ed.getBody(), 'p', null, '
                  '); + }; + + // Fixes an bug where it's impossible to place the caret before a table in Gecko + // this fix solves it by detecting when the caret is at the beginning of such a table + // and then manually moves the caret infront of the table + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + var rng, table, dom = ed.dom; + + // On gecko it's not possible to place the caret before a table + if (e.keyCode == 37 || e.keyCode == 38) { + rng = ed.selection.getRng(); + table = dom.getParent(rng.startContainer, 'table'); + + if (table && ed.getBody().firstChild == table) { + if (isAtStart(rng, table)) { + rng = dom.createRng(); + + rng.setStartBefore(table); + rng.setEndBefore(table); + + ed.selection.setRng(rng); + + e.preventDefault(); + } + } + } + }); + } + + ed.onKeyUp.add(fixTableCaretPos); + ed.onSetContent.add(fixTableCaretPos); + ed.onVisualAid.add(fixTableCaretPos); + + ed.onPreProcess.add(function(ed, o) { + var last = o.node.lastChild; + + if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') + ed.dom.remove(last); + }); + + + /** + * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line + */ + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) { + var node = ed.selection.getRng().startContainer; + var tableCell = dom.getParent(node, 'td,th'); + if (tableCell) { + var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF"); + dom.insertAfter(zeroSizedNbsp, node); + } + } + }); + } + + + fixTableCaretPos(); + ed.startContent = ed.getContent({format : 'raw'}); + } + }); + + // Register action commands + each({ + mceTableSplitCells : function(grid) { + grid.split(); + }, + + mceTableMergeCells : function(grid) { + var rowSpan, colSpan, cell; + + cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); + if (cell) { + rowSpan = cell.rowSpan; + colSpan = cell.colSpan; + } + + if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { + winMan.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + rows : rowSpan, + cols : colSpan, + onaction : function(data) { + grid.merge(cell, data.cols, data.rows); + }, + plugin_url : url + }); + } else + grid.merge(); + }, + + mceTableInsertRowBefore : function(grid) { + grid.insertRow(true); + }, + + mceTableInsertRowAfter : function(grid) { + grid.insertRow(); + }, + + mceTableInsertColBefore : function(grid) { + grid.insertCol(true); + }, + + mceTableInsertColAfter : function(grid) { + grid.insertCol(); + }, + + mceTableDeleteCol : function(grid) { + grid.deleteCols(); + }, + + mceTableDeleteRow : function(grid) { + grid.deleteRows(); + }, + + mceTableCutRow : function(grid) { + clipboardRows = grid.cutRows(); + }, + + mceTableCopyRow : function(grid) { + clipboardRows = grid.copyRows(); + }, + + mceTablePasteRowBefore : function(grid) { + grid.pasteRows(clipboardRows, true); + }, + + mceTablePasteRowAfter : function(grid) { + grid.pasteRows(clipboardRows); + }, + + mceTableDelete : function(grid) { + grid.deleteTable(); + } + }, function(func, name) { + ed.addCommand(name, function() { + var grid = createTableGrid(); + + if (grid) { + func(grid); + ed.execCommand('mceRepaint'); + cleanup(); + } + }); + }); + + // Register dialog commands + each({ + mceInsertTable : function(val) { + winMan.open({ + url : url + '/table.htm', + width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), + height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + action : val ? val.action : 0 + }); + }, + + mceTableRowProps : function() { + winMan.open({ + url : url + '/row.htm', + width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }, + + mceTableCellProps : function() { + winMan.open({ + url : url + '/cell.htm', + width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + } + }, function(func, name) { + ed.addCommand(name, function(ui, val) { + func(val); + }); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(tinymce); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js new file mode 100644 index 00000000..d6f32905 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js @@ -0,0 +1,319 @@ +tinyMCEPopup.requireLangPack(); + +var ed; + +function init() { + ed = tinyMCEPopup.editor; + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + + var inst = ed; + var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); + var formObj = document.forms[0]; + var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); + + // Get table cell data + var celltype = tdElm.nodeName.toLowerCase(); + var align = ed.dom.getAttrib(tdElm, 'align'); + var valign = ed.dom.getAttrib(tdElm, 'valign'); + var width = trimSize(getStyle(tdElm, 'width', 'width')); + var height = trimSize(getStyle(tdElm, 'height', 'height')); + var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); + var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); + var className = ed.dom.getAttrib(tdElm, 'class'); + var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + var id = ed.dom.getAttrib(tdElm, 'id'); + var lang = ed.dom.getAttrib(tdElm, 'lang'); + var dir = ed.dom.getAttrib(tdElm, 'dir'); + var scope = ed.dom.getAttrib(tdElm, 'scope'); + + // Setup form + addClassesToList('class', 'table_cell_styles'); + TinyMCE_EditableSelects.init(); + + if (!ed.dom.hasClass(tdElm, 'mceSelected')) { + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.backgroundimage.value = backgroundimage; + formObj.width.value = width; + formObj.height.value = height; + formObj.id.value = id; + formObj.lang.value = lang; + formObj.style.value = ed.dom.serializeStyle(st); + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'valign', valign); + selectByValue(formObj, 'class', className, true, true); + selectByValue(formObj, 'celltype', celltype); + selectByValue(formObj, 'dir', dir); + selectByValue(formObj, 'scope', scope); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + } else + tinyMCEPopup.dom.hide('action'); +} + +function updateAction() { + var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getStart(); + tdElm = ed.dom.getParent(el, "td,th"); + trElm = ed.dom.getParent(el, "tr"); + tableElm = ed.dom.getParent(el, "table"); + + // Cell is selected + if (ed.dom.hasClass(tdElm, 'mceSelected')) { + // Update all selected sells + tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { + updateCell(td); + }); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (getSelectValue(formObj, 'action')) { + case "cell": + var celltype = getSelectValue(formObj, 'celltype'); + var scope = getSelectValue(formObj, 'scope'); + + function doUpdate(s) { + if (s) { + updateCell(tdElm); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + } + }; + + if (ed.getParam("accessibility_warnings", 1)) { + if (celltype == "th" && scope == "") + tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); + else + doUpdate(1); + + return; + } + + updateCell(tdElm); + break; + + case "row": + var cell = trElm.firstChild; + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + cell = updateCell(cell, true); + } while ((cell = nextCell(cell)) != null); + + break; + + case "col": + var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + if (cell == tdElm) + break; + col += cell.getAttribute("colspan"); + } while ((cell = nextCell(cell)) != null); + + for (var i=0; i 0) { + tinymce.each(tableElm.rows, function(tr) { + var i; + + for (i = 0; i < tr.cells.length; i++) { + if (dom.hasClass(tr.cells[i], 'mceSelected')) { + updateRow(tr, true); + return; + } + } + }); + + inst.addVisual(); + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (action) { + case "row": + updateRow(trElm); + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + + if (!isCssSize(border)) { + dom.setAttrib(elm, 'border', border); + } else { + dom.setAttrib(elm, 'border', ''); + } + + if (border == '') { + dom.setStyle(elm, 'border-width', ''); + dom.setStyle(elm, 'border', ''); + dom.setAttrib(elm, 'border', ''); + } + + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
                  '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = cssSize(border); + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); + } else + inst.execCommand('mceInsertContent', false, html); + + tinymce.each(dom.select('table[data-mce-new]'), function(node) { + var tdorth = dom.select('td,th', node); + + // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document + if (tinymce.isIE && node.nextSibling == null) { + dom.insertAfter(dom.create('p'), node); + } + + try { + // IE9 might fail to do this selection + inst.selection.setCursorLocation(tdorth[0], 0); + } catch (ex) { + // Ignore + } + + dom.setAttrib(node, 'data-mce-new', ''); + }); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function isCssSize(value) { + return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); +} + +function cssSize(value, def) { + value = tinymce.trim(value || def); + + if (!isCssSize(value)) { + return parseInt(value, 10) + 'px'; + } + + return value; +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) + st['border-width'] = cssSize(formObj.border.value); + else { + if (!formObj.border.value) { + st['border'] = ''; + st['border-width'] = ''; + } + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = cssSize(formObj.border.value, 1); + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js new file mode 100644 index 00000000..5a64ebd7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.table_dlg',{"rules_border":"alle 4 Seiten (Border)","rules_box":"alle 4 Seiten (Box)","rules_vsides":"links und rechts","rules_rhs":"nur rechts","rules_lhs":"nur links","rules_hsides":"oben und unten","rules_below":"nur unten","rules_above":"nur oben","rules_void":"keins",rules:"Gitter","frame_all":"zwischen allen Zellen","frame_cols":"zwischen Spalten","frame_rows":"zwischen Zeilen","frame_groups":"zwischen Gruppen","frame_none":"keine",frame:"Rahmen",caption:"Beschriftung der Tabelle","missing_scope":"Wollen Sie wirklich keine Beziehung f\u00fcr diese \u00dcberschrift angeben? Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.","cell_limit":"Sie haben die maximale Zellenzahl von {$cells} \u00fcberschritten.","row_limit":"Sie haben die maximale Zeilenzahl von {$rows} \u00fcberschritten.","col_limit":"Sie haben die maximale Spaltenzahl von {$cols} \u00fcberschritten.",colgroup:"Horizontal gruppieren",rowgroup:"Vertikal gruppieren",scope:"Bezug",tfoot:"Tabellenfu\u00df",tbody:"Tabelleninhalt",thead:"Tabellenkopf","row_all":"Alle Zeilen ver\u00e4ndern","row_even":"Gerade Zeilen ver\u00e4ndern","row_odd":"Ungerade Zeilen ver\u00e4ndern","row_row":"Diese Zeile ver\u00e4ndern","cell_all":"Alle Zellen der Tabelle ver\u00e4ndern","cell_row":"Alle Zellen in dieser Zeile ver\u00e4ndern","cell_cell":"Diese Zelle ver\u00e4ndern",th:"\u00dcberschrift",td:"Textzelle",summary:"Zusammenfassung",bgimage:"Hintergrundbild",rtl:"Rechts nach links",ltr:"Links nach rechts",mime:"MIME-Type des Inhalts",langcode:"Sprachcode",langdir:"Schriftrichtung",style:"Format",id:"ID","merge_cells_title":"Zellen vereinen",bgcolor:"Hintergrundfarbe",bordercolor:"Rahmenfarbe","align_bottom":"Unten","align_top":"Oben",valign:"Vertikale Ausrichtung","cell_type":"Zellentyp","cell_title":"Eigenschaften der Zelle","row_title":"Eigenschaften der Zeile","align_middle":"Mittig","align_right":"Rechts","align_left":"Links","align_default":"Standard",align:"Ausrichtung",border:"Rahmen",cellpadding:"Abstand innerhalb der Zellen",cellspacing:"Zellenabstand",rows:"Zeilen",cols:"Spalten",height:"H\u00f6he",width:"Breite",title:"Tabelle einf\u00fcgen/bearbeiten",rowtype:"Gruppierung","advanced_props":"Erweiterte Einstellungen","general_props":"Allgemeine Einstellungen","advanced_tab":"Erweitert","general_tab":"Allgemein","cell_col":"Alle Zellen in dieser Spalte aktualisieren"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js new file mode 100644 index 00000000..463e09ee --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm new file mode 100644 index 00000000..d231090e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm @@ -0,0 +1,32 @@ + + + + {#table_dlg.merge_cells_title} + + + + + + +
                  +
                  + {#table_dlg.merge_cells_title} + + + + + + + + + +
                  :
                  :
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/row.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/row.htm new file mode 100644 index 00000000..1885401f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/row.htm @@ -0,0 +1,158 @@ + + + + {#table_dlg.row_title} + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + +
                  + +
                  + +
                  +
                  +
                  + +
                  +
                  + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + +
                  + + + + + +
                   
                  +
                  + + + + + + +
                   
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  + +
                  + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/table.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/table.htm new file mode 100644 index 00000000..b92fa741 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/table/table.htm @@ -0,0 +1,188 @@ + + + + {#table_dlg.title} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +
                  +
                  +
                  + +
                  +
                  + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + +
                  + + + + + +
                   
                  +
                  + +
                  + +
                  + +
                  + + + + + +
                   
                  +
                  + + + + + +
                   
                  +
                  +
                  +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/blank.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/blank.htm new file mode 100644 index 00000000..ecde53fa --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/blank.htm @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/css/template.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/css/template.css new file mode 100644 index 00000000..2d23a493 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/css/template.css @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js new file mode 100644 index 00000000..2fa7a62a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",600),height:b.getParam("template_popup_height",185),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/js/template.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/js/template.js new file mode 100644 index 00000000..bc3045d2 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template/js/template.js @@ -0,0 +1,106 @@ +tinyMCEPopup.requireLangPack(); + +var TemplateDialog = { + preInit : function() { + var url = tinyMCEPopup.getParam("template_external_list_url"); + + if (url != null) + document.write(''); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x + + {#template_dlg.title} + + + + + +
                  +
                  +
                  {#template_dlg.desc}
                  +
                  +
                  +
                  +
                  + + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                    +
                  • +
                  • +
                  +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm new file mode 100644 index 00000000..ecde53fa --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/blank.htm @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css new file mode 100644 index 00000000..2d23a493 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/css/template.css @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js new file mode 100644 index 00000000..ebe3c27d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js new file mode 100644 index 00000000..bc3045d2 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/template_orig/js/template.js @@ -0,0 +1,106 @@ +tinyMCEPopup.requireLangPack(); + +var TemplateDialog = { + preInit : function() { + var url = tinyMCEPopup.getParam("template_external_list_url"); + + if (url != null) + document.write(''); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x + + {#template_dlg.title} + + + + + +
                  +
                  +
                  {#template_dlg.desc}
                  +
                  + +
                  +
                  +
                  +
                  + {#template_dlg.preview} + +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css new file mode 100644 index 00000000..17b9aeff --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css @@ -0,0 +1,19 @@ +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat} +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre {margin-left: 3px} +section, article, address, hgroup, aside {margin: 1em 0 0 3px} + +p {background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)} +h1 {background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)} +h2 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)} +h3 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)} +h4 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)} +h5 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)} +h6 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)} +div {background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)} +section {background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)} +article {background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)} +blockquote {background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)} +address {background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)} +pre {background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)} +hgroup {background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)} +aside {background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js new file mode 100644 index 00000000..62cc2e4c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.VisualBlocks",{init:function(a,b){var c;if(!window.NodeList){return}a.addCommand("mceVisualBlocks",function(){var e=a.dom,d;if(!c){c=e.uniqueId();d=e.create("link",{id:c,rel:"stylesheet",href:b+"/css/visualblocks.css"});a.getDoc().getElementsByTagName("head")[0].appendChild(d)}else{d=e.get(c);d.disabled=!d.disabled}a.controlManager.setActive("visualblocks",!d.disabled)});a.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"});a.onInit.add(function(){if(a.settings.visualblocks_default_state){a.execCommand("mceVisualBlocks")}})},getInfo:function(){return{longname:"Visual blocks",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("visualblocks",tinymce.plugins.VisualBlocks)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js new file mode 100644 index 00000000..e74c0bdc --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js @@ -0,0 +1,63 @@ +/** + * editor_plugin_src.js + * + * Copyright 2012, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualBlocks', { + init : function(ed, url) { + var cssId; + + // We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects + if (!window.NodeList) { + return; + } + + ed.addCommand('mceVisualBlocks', function() { + var dom = ed.dom, linkElm; + + if (!cssId) { + cssId = dom.uniqueId(); + linkElm = dom.create('link', { + id: cssId, + rel : 'stylesheet', + href : url + '/css/visualblocks.css' + }); + + ed.getDoc().getElementsByTagName('head')[0].appendChild(linkElm); + } else { + linkElm = dom.get(cssId); + linkElm.disabled = !linkElm.disabled; + } + + ed.controlManager.setActive('visualblocks', !linkElm.disabled); + }); + + ed.addButton('visualblocks', {title : 'visualblocks.desc', cmd : 'mceVisualBlocks'}); + + ed.onInit.add(function() { + if (ed.settings.visualblocks_default_state) { + ed.execCommand('mceVisualBlocks'); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual blocks', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('visualblocks', tinymce.plugins.VisualBlocks); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js new file mode 100644 index 00000000..1a148e8b --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!="raw"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive("visualchars",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(g=0;g$1');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js new file mode 100644 index 00000000..df985905 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js @@ -0,0 +1,83 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualChars', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceVisualChars', t._toggleVisualChars, t); + + // Register buttons + ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); + + ed.onBeforeGetContent.add(function(ed, o) { + if (t.state && o.format != 'raw' && !o.draft) { + t.state = true; + t._toggleVisualChars(false); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual characters', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _toggleVisualChars : function(bookmark) { + var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; + + t.state = !t.state; + ed.controlManager.setActive('visualchars', t.state); + + if (bookmark) + bm = s.getBookmark(); + + if (t.state) { + nl = []; + tinymce.walk(b, function(n) { + if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) + nl.push(n); + }, 'childNodes'); + + for (i = 0; i < nl.length; i++) { + nv = nl[i].nodeValue; + nv = nv.replace(/(\u00a0)/g, '$1'); + + div = ed.dom.create('div', null, nv); + while (node = div.lastChild) + ed.dom.insertAfter(node, nl[i]); + + ed.dom.remove(nl[i]); + } + } else { + nl = ed.dom.select('span.mceItemNbsp', b); + + for (i = nl.length - 1; i >= 0; i--) + ed.dom.remove(nl[i], 1); + } + + s.moveToBookmark(bm); + } + }); + + // Register plugin + tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js new file mode 100644 index 00000000..42ece209 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(k,"span",{},'0')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js new file mode 100644 index 00000000..34b26555 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js @@ -0,0 +1,122 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.WordCount', { + block : 0, + id : null, + countre : null, + cleanre : null, + + init : function(ed, url) { + var t = this, last = 0, VK = tinymce.VK; + + t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ + t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); + t.update_rate = ed.getParam('wordcount_update_rate', 2000); + t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); + t.id = ed.id + '-word-count'; + + ed.onPostRender.add(function(ed, cm) { + var row, id; + + // Add it to the specified id or the theme advanced path + id = ed.getParam('wordcount_target_id'); + if (!id) { + row = tinymce.DOM.get(ed.id + '_path_row'); + + if (row) + tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); + } else { + tinymce.DOM.add(id, 'span', {}, '0'); + } + }); + + ed.onInit.add(function(ed) { + ed.selection.onSetContent.add(function() { + t._count(ed); + }); + + t._count(ed); + }); + + ed.onSetContent.add(function(ed) { + t._count(ed); + }); + + function checkKeys(key) { + return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); + } + + function checkDelOrBksp(key) { + return key === VK.DELETE || key === VK.BACKSPACE; + } + + ed.onKeyUp.add(function(ed, e) { + if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { + t._count(ed); + } + + last = e.keyCode; + }); + }, + + _getCount : function(ed) { + var tc = 0; + var tx = ed.getContent({ format: 'raw' }); + + if (tx) { + tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces + tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + + // deal with html entities + tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); + tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation + + var wordArray = tx.match(this.countre); + if (wordArray) { + tc = wordArray.length; + } + } + + return tc; + }, + + _count : function(ed) { + var t = this; + + // Keep multiple calls from happening at the same time + if (t.block) + return; + + t.block = 1; + + setTimeout(function() { + if (!ed.destroyed) { + var tc = t._getCount(ed); + tinymce.DOM.setHTML(t.id, tc.toString()); + setTimeout(function() {t.block = 0;}, t.update_rate); + } + }, 1); + }, + + getInfo: function() { + return { + longname : 'Word Count plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); +})(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm new file mode 100644 index 00000000..30a894f7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  : + +
                  :
                  : + +
                  : + +
                  +
                  +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  +
                  +
                  +
                  +
                  + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm new file mode 100644 index 00000000..c1093459 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  : + +
                  :
                  : + +
                  : + +
                  +
                  +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  +
                  +
                  +
                  +
                  + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm new file mode 100644 index 00000000..e8d606a3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  + +
                  :
                  : + +
                  : + +
                  +
                  +
                  +
                  +
                  + {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  +
                  +
                  +
                  +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm new file mode 100644 index 00000000..0ac6bdb6 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  : + +
                  :
                  : + +
                  : + +
                  +
                  +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  +
                  +
                  +
                  +
                  + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css new file mode 100644 index 00000000..9a6a235c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css @@ -0,0 +1,11 @@ +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css new file mode 100644 index 00000000..e67114db --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css @@ -0,0 +1,9 @@ +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm new file mode 100644 index 00000000..5f667510 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
                  : + + + + + +
                  +
                  :
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  : + +
                  :
                  : + +
                  : + +
                  +
                  +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  +
                  +
                  +
                  +
                  + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js new file mode 100644 index 00000000..9b98a515 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js new file mode 100644 index 00000000..f2405721 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -0,0 +1,132 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), + height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + + ed.onPreInit.add(function() { + // Fixed IE issue where it can't handle these elements correctly + ed.dom.create('abbr'); + }); + }, + + getInfo : function() { + return { + longname : 'XHTML Xtras Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm new file mode 100644 index 00000000..d001ac7c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + + +
                  + + +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
                  : + + + + + +
                  +
                  :
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  : + +
                  :
                  : + +
                  : + +
                  +
                  +
                  +
                  +
                  + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  :
                  +
                  +
                  +
                  +
                  + + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js new file mode 100644 index 00000000..4b51a257 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js @@ -0,0 +1,28 @@ +/** + * abbr.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement('abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js new file mode 100644 index 00000000..6ec2f887 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js @@ -0,0 +1,28 @@ +/** + * acronym.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js new file mode 100644 index 00000000..9c99995a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js @@ -0,0 +1,111 @@ +/** + * attributes.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + dom.setAttrib(elm, attrib.toLowerCase(), value); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + setAttrib(elm, 'onfocus'); + setAttrib(elm, 'onblur'); + setAttrib(elm, 'onclick'); + setAttrib(elm, 'ondblclick'); + setAttrib(elm, 'onmousedown'); + setAttrib(elm, 'onmouseup'); + setAttrib(elm, 'onmouseover'); + setAttrib(elm, 'onmousemove'); + setAttrib(elm, 'onmouseout'); + setAttrib(elm, 'onkeypress'); + setAttrib(elm, 'onkeydown'); + setAttrib(elm, 'onkeyup'); + + // Refresh in old MSIE +// if (tinyMCE.isMSIE5) +// elm.outerHTML = elm.outerHTML; +} + +function insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js new file mode 100644 index 00000000..009b7154 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js @@ -0,0 +1,28 @@ +/** + * cite.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js new file mode 100644 index 00000000..1f957dc7 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -0,0 +1,53 @@ +/** + * del.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('del'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertDel() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('del'); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); + for (var i=0; i 0) { + tagName = element_name; + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select('span,font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); + }); +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js new file mode 100644 index 00000000..c4addfb0 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js @@ -0,0 +1,53 @@ +/** + * ins.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('ins'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertIns() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); + for (var i=0; i + + + {#advanced_dlg.about_title} + + + + + + + +
                  +
                  +

                  {#advanced_dlg.about_title}

                  +

                  Version: ()

                  +

                  TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

                  +

                  Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

                  +

                  For more information about this software visit the TinyMCE website.

                  + +
                  + Got Moxie? +
                  +
                  + +
                  +
                  +

                  {#advanced_dlg.about_loaded}

                  + +
                  +
                  + +

                   

                  +
                  +
                  + +
                  +
                  +
                  +
                  + +
                  + +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm new file mode 100644 index 00000000..75c93b79 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm @@ -0,0 +1,26 @@ + + + + {#advanced_dlg.anchor_title} + + + + +
                  + + + + + + + + +
                  {#advanced_dlg.anchor_title}
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm new file mode 100644 index 00000000..4c67fe30 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm @@ -0,0 +1,55 @@ + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + + + + + +
                  + + + + + + + + + +
                   
                   
                  +
                  + + + + + + + + + + + + + + + + +
                   
                   
                   
                  +
                  {#advanced_dlg.charmap_usage}
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm new file mode 100644 index 00000000..ad1bb0f6 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm @@ -0,0 +1,74 @@ + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
                  + + +
                  +
                  +
                  + {#advanced_dlg.colorpicker_picker_title} +
                  + + +
                  + +
                  + +
                  +
                  +
                  +
                  + +
                  +
                  + {#advanced_dlg.colorpicker_palette_title} +
                  + +
                  + +
                  +
                  +
                  + +
                  +
                  + {#advanced_dlg.colorpicker_named_title} +
                  + +
                  + +
                  + +
                  + {#advanced_dlg.colorpicker_name} +
                  +
                  +
                  +
                  + +
                  + + +
                  + +
                  + +
                  +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js new file mode 100644 index 00000000..a8870181 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js @@ -0,0 +1 @@ +(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(m,k){var q,p=m.dom,n="",o,l;previewStyles=m.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function j(r){return r.replace(/%(\w+)/g,"")}name=k.block||k.inline||"span";q=p.create(name);f(k.styles,function(s,r){s=j(s);if(s){p.setStyle(q,r,s)}});f(k.attributes,function(s,r){s=j(s);if(s){p.setAttrib(q,r,s)}});f(k.classes,function(r){r=j(r);if(!p.hasClass(q,r)){p.addClass(q,r)}});p.setStyles(q,{position:"absolute",left:-65535});m.getBody().appendChild(q);o=p.getStyle(m.getBody(),"fontSize",true);o=/px$/.test(o)?parseInt(o,10):0;f(previewStyles.split(" "),function(r){var s=p.getStyle(q,r,true);if(r=="font-size"){if(/em|%$/.test(s)){if(o===0){return}s=parseFloat(s,10)/(/%$/.test(s)?100:1);s=(s*o)+"px"}}n+=r+":"+s+";"});p.remove(q);return n}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},k.settings);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},""),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j"));i.setHTML(l,q.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true)}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(i.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(i.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js new file mode 100644 index 00000000..d94c8e49 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js @@ -0,0 +1,1467 @@ +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Generates a preview for a format + function getPreviewCss(ed, fmt) { + var previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName; + + previewStyles = ed.settings.preview_styles; + + // No preview forced + if (previewStyles === false) + return ''; + + // Default preview + if (!previewStyles) + previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color'; + + // Removes any variables since these can't be previewed + function removeVars(val) { + return val.replace(/%(\w+)/g, ''); + }; + + // Create block/inline element to use for preview + name = fmt.block || fmt.inline || 'span'; + previewElm = dom.create(name); + + // Add format styles to preview element + each(fmt.styles, function(value, name) { + value = removeVars(value); + + if (value) + dom.setStyle(previewElm, name, value); + }); + + // Add attributes to preview element + each(fmt.attributes, function(value, name) { + value = removeVars(value); + + if (value) + dom.setAttrib(previewElm, name, value); + }); + + // Add classes to preview element + each(fmt.classes, function(value) { + value = removeVars(value); + + if (!dom.hasClass(previewElm, value)) + dom.addClass(previewElm, value); + }); + + // Add the previewElm outside the visual area + dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); + ed.getBody().appendChild(previewElm); + + // Get parent container font size so we can compute px values out of em/% for older IE:s + parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true); + parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; + + each(previewStyles.split(' '), function(name) { + var value = dom.getStyle(previewElm, name, true); + + // Old IE won't calculate the font size so we need to do that manually + if (name == 'font-size') { + if (/em|%$/.test(value)) { + if (parentFontSize === 0) { + return; + } + + // Convert font size from em/% to px + value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); + value = (value * parentFontSize) + 'px'; + } + } + + previewCss += name + ':' + value + ';'; + }); + + dom.remove(previewElm); + + return previewCss; + }; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + controls : { + bold : ['bold_desc', 'Bold'], + italic : ['italic_desc', 'Italic'], + underline : ['underline_desc', 'Underline'], + strikethrough : ['striketrough_desc', 'Strikethrough'], + justifyleft : ['justifyleft_desc', 'JustifyLeft'], + justifycenter : ['justifycenter_desc', 'JustifyCenter'], + justifyright : ['justifyright_desc', 'JustifyRight'], + justifyfull : ['justifyfull_desc', 'JustifyFull'], + bullist : ['bullist_desc', 'InsertUnorderedList'], + numlist : ['numlist_desc', 'InsertOrderedList'], + outdent : ['outdent_desc', 'Outdent'], + indent : ['indent_desc', 'Indent'], + cut : ['cut_desc', 'Cut'], + copy : ['copy_desc', 'Copy'], + paste : ['paste_desc', 'Paste'], + undo : ['undo_desc', 'Undo'], + redo : ['redo_desc', 'Redo'], + link : ['link_desc', 'mceLink'], + unlink : ['unlink_desc', 'unlink'], + image : ['image_desc', 'mceImage'], + cleanup : ['cleanup_desc', 'mceCleanup'], + help : ['help_desc', 'mceHelp'], + code : ['code_desc', 'mceCodeEditor'], + hr : ['hr_desc', 'InsertHorizontalRule'], + removeformat : ['removeformat_desc', 'RemoveFormat'], + sub : ['sub_desc', 'subscript'], + sup : ['sup_desc', 'superscript'], + forecolor : ['forecolor_desc', 'ForeColor'], + forecolorpicker : ['forecolor_desc', 'mceForeColor'], + backcolor : ['backcolor_desc', 'HiliteColor'], + backcolorpicker : ['backcolor_desc', 'mceBackColor'], + charmap : ['charmap_desc', 'mceCharMap'], + visualaid : ['visualaid_desc', 'mceToggleVisualAid'], + anchor : ['anchor_desc', 'mceInsertAnchor'], + newdocument : ['newdocument_desc', 'mceNewDocument'], + blockquote : ['blockquote_desc', 'mceBlockQuote'] + }, + + stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], + + init : function(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + + // Default settings + t.settings = s = extend({ + theme_advanced_path : true, + theme_advanced_toolbar_location : 'bottom', + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", + theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", + theme_advanced_toolbar_align : "center", + theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", + theme_advanced_more_colors : 1, + theme_advanced_row_height : 23, + theme_advanced_resize_horizontal : 1, + theme_advanced_resizing_use_cookie : 1, + theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, + readonly : ed.settings.readonly + }, ed.settings); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + + if (/^\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + + // Init editor + ed.onInit.add(function() { + if (!ed.settings.readonly) { + ed.onNodeChange.add(t._nodeChanged, t); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + case "styleselect": + return this._createStyleSelect(); + + case "formatselect": + return this._createBlockFormats(); + + case "fontselect": + return this._createFontSelect(); + + case "fontsizeselect": + return this._createFontSizeSelect(); + + case "forecolor": + return this._createForeColorMenu(); + + case "backcolor": + return this._createBackColorMenu(); + } + + if ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); + + if (ctrl.getLength() == 0) { + each(ed.dom.getClasses(), function(o, idx) { + var name = 'style_' + idx, fmt; + + fmt = { + inline : 'span', + attributes : {'class' : o['class']}, + selector : '*' + }; + + ed.formatter.register(name, fmt); + + ctrl.add(o['class'], name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; + + // Setup style select box + ctrl = ctrlMan.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(name) { + var matches, formatNames = [], removedFormat; + + each(ctrl.items, function(item) { + formatNames.push(item.value); + }); + + ed.focus(); + ed.undoManager.add(); + + // Toggle off the current format(s) + matches = ed.formatter.matchAll(formatNames); + tinymce.each(matches, function(match) { + if (!name || match == name) { + if (match) + ed.formatter.remove(match); + + removedFormat = true; + } + }); + + if (!removedFormat) + ed.formatter.apply(name); + + ed.undoManager.add(); + ed.nodeChanged(); + + return false; // No auto select + } + }); + + // Handle specified format + ed.onPreInit.add(function() { + var counter = 0, formats = ed.getParam('style_formats'); + + if (formats) { + each(formats, function(fmt) { + var name, keys = 0; + + each(fmt, function() {keys++;}); + + if (keys > 1) { + name = fmt.name = fmt.name || 'style_' + (counter++); + ed.formatter.register(name, fmt); + ctrl.add(fmt.title, name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } else + ctrl.add(fmt.title); + }); + } else { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { + var name, fmt; + + if (val) { + name = 'style_' + (counter++); + fmt = { + inline : 'span', + classes : val, + selector : '*' + }; + + ed.formatter.register(name, fmt); + ctrl.add(t.editor.translate(key), name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); + } + }); + } + }); + + // Auto import classes if the ctrl box is empty + if (ctrl.getLength() == 0) { + ctrl.onPostRender.add(function(ed, n) { + if (!ctrl.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return ctrl; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', { + title : 'advanced.fontdefault', + onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + + ed.execCommand('FontName', false, v); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && cur.value == v) { + c.select(null); + } + + return false; // No auto select + } + }); + + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + + if (v['class']) { + ed.focus(); + ed.undoManager.add(); + ed.formatter.toggle('fontsize_class', {value : v['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else + ed.execCommand('FontSize', false, v.fontSize); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { + c.select(null); + } + + return false; // No auto select + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + p : 'advanced.paragraph', + address : 'advanced.address', + pre : 'advanced.pre', + h1 : 'advanced.h1', + h2 : 'advanced.h2', + h3 : 'advanced.h3', + h4 : 'advanced.h4', + h5 : 'advanced.h5', + h6 : 'advanced.h6', + div : 'advanced.div', + blockquote : 'advanced.blockquote', + code : 'advanced.code', + dt : 'advanced.dt', + dd : 'advanced.dd', + samp : 'advanced.samp' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() { + return getPreviewCss(t.editor, {block: v}); + }}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = sc.rows; + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + return false; + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + // Make sure focus is given to toolbar in Safari. + // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame + if (tinymce.isWebKit) { + window.focus(); + } + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_ifr'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h, store) { + var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Resize iframe and container + DOM.setStyle(e, 'height', ''); + DOM.setStyle(ifr, 'height', h); + + if (s.theme_advanced_resize_horizontal) { + DOM.setStyle(e, 'width', ''); + DOM.setStyle(ifr, 'width', w); + + // Make sure that the size is never smaller than the over all ui + if (w < e.clientWidth) { + w = e.clientWidth; + DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); + } + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (c.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; + + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); + + t.toolbarGroup = toolbarGroup; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + toolbarGroup.add(tb); + + o.deltaHeight -= s.theme_advanced_row_height; + } + h.push(toolbarGroup.renderHTML()); + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + + + if (s.theme_advanced_resizing) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + t.resizeTo(o.cw, o.ch); + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var mouseMoveHandler1, mouseMoveHandler2, + mouseUpHandler1, mouseUpHandler2, + startX, startY, startWidth, startHeight, width, height, ifrElm; + + function resizeOnMove(e) { + e.preventDefault(); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + + t.resizeTo(width, height); + }; + + function endResize(e) { + // Stop listening + Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); + Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); + Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); + Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); + }; + + e.preventDefault(); + + // Get the current rect size + startX = e.screenX; + startY = e.screenY; + ifrElm = DOM.get(t.editor.id + '_ifr'); + startWidth = width = ifrElm.clientWidth; + startHeight = height = ifrElm.clientHeight; + + // Register envent handlers + mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); + mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); + mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); + mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _updateUndoStatus : function(ed) { + var cm = ed.controlManager, um = ed.undoManager; + + cm.setDisabled('undo', !um.hasUndo() && !um.typing); + cm.setDisabled('redo', !um.hasRedo()); + }, + + _nodeChanged : function(ed, cm, n, co, ob) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + function getParent(name) { + var i, parents = ob.parents, func = name; + + if (typeof(name) == 'string') { + func = function(node) { + return node.nodeName == name; + }; + } + + for (i = 0; i < parents.length; i++) { + if (func(parents[i])) + return parents[i]; + } + }; + + cm.setActive('visualaid', ed.hasVisual); + t._updateUndoStatus(ed); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = getParent('A'); + if (c = cm.get('link')) { + if (!p || !p.name) { + c.setDisabled(!p && co); + c.setActive(!!p); + } + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name); + } + + if (c = cm.get('anchor')) { + c.setActive(!co && !!p && p.name); + } + + p = getParent('IMG'); + if (c = cm.get('image')) + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + t._importClasses(); + + formatNames = []; + each(c.items, function(item) { + formatNames.push(item.value); + }); + + matches = ed.formatter.matchAll(formatNames); + c.select(matches[0]); + tinymce.each(matches, function(match, index) { + if (index > 0) { + c.mark(match); + } + }); + } + + if (c = cm.get('formatselect')) { + p = getParent(DOM.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + // Find out current fontSize, fontFamily and fontClass + getParent(function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + } + + if (ed.dom.is(n, s.theme_advanced_font_selector)) { + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + // Select font size + if (c = cm.get('fontsizeselect')) { + // Use computed style + if (s.theme_advanced_runtime_fontsize && !fz && !cl) + fz = ed.dom.getStyle(n, 'fontSize', true); + + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + + DOM.setHTML(p, ''); + + getParent(function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and bogus/hidden elements + if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) + return; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML') + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '') + + if (v) { + ti += 'class: ' + v + ' '; + + if (DOM.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : this.url + '/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : this.url + '/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}(tinymce)); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/image.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/image.htm new file mode 100644 index 00000000..b8ba729f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/image.htm @@ -0,0 +1,80 @@ + + + + {#advanced_dlg.image_title} + + + + + + +
                  + + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + + + + +
                   
                  + x +
                  +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg new file mode 100644 index 00000000..b1a377ab Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif new file mode 100644 index 00000000..dec3f7c7 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif new file mode 100644 index 00000000..ca222490 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif new file mode 100644 index 00000000..410c7ad0 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif new file mode 100644 index 00000000..acdf4085 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif new file mode 100644 index 00000000..8f10e7aa Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif new file mode 100644 index 00000000..fdfe0b9a Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif new file mode 100644 index 00000000..9314d044 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif new file mode 100644 index 00000000..38848651 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif new file mode 100644 index 00000000..35701040 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif new file mode 100644 index 00000000..ab50f2d8 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/img/windowsmedia.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js new file mode 100644 index 00000000..5b358457 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js @@ -0,0 +1,73 @@ +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
                  ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
                  ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
                  '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js new file mode 100644 index 00000000..2940db35 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js @@ -0,0 +1,44 @@ +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + v = ed.dom.getAttrib(elm, 'name'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor, elm, name = document.forms[0].anchorName.value; + + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + if (elm) { + elm.setAttribute('name', name); + elm.name = name; + } else + // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '\uFEFF')); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js new file mode 100644 index 00000000..bb186955 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js @@ -0,0 +1,363 @@ +/** + * charmap.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); +}); + +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = '
                  '+ + ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
                  '; + html = html.replace(/<\/tr>/g, ''); + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js new file mode 100644 index 00000000..cc891c17 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js @@ -0,0 +1,345 @@ +tinyMCEPopup.requireLangPack(); + +var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; + +var colors = [ + "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", + "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", + "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", + "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", + "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", + "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", + "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", + "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", + "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", + "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", + "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", + "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", + "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", + "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", + "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", + "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", + "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", + "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", + "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", + "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", + "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", + "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", + "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", + "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", + "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", + "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", + "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" +]; + +var named = { + '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', + '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', + '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', + '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', + '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', + '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', + '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', + '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', + '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', + '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', + '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', + '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', + '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', + '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', + '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', + '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', + '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', + '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', + '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', + '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', + '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', + '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', + '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' +}; + +var namedLookup = {}; + +function init() { + var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; + + tinyMCEPopup.resizeToInnerSize(); + + generatePicker(); + generateWebColors(); + generateNamedColors(); + + if (inputColor) { + changeFinalColor(inputColor); + + col = convertHexToRGB(inputColor); + + if (col) + updateLight(col.r, col.g, col.b); + } + + for (key in named) { + value = named[key]; + namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); + } +} + +function toHexColor(color) { + var matches, red, green, blue, toInt = parseInt; + + function hex(value) { + value = parseInt(value).toString(16); + + return value.length > 1 ? value : '0' + value; // Padd with leading zero + }; + + color = tinymce.trim(color); + color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' + color = namedLookup[color] || color; + + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); + + if (matches) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else { + matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); + + if (matches) { + red = toInt(matches[1], 16); + green = toInt(matches[2], 16); + blue = toInt(matches[3], 16); + } else { + matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); + + if (matches) { + red = toInt(matches[1] + matches[1], 16); + green = toInt(matches[2] + matches[2], 16); + blue = toInt(matches[3] + matches[3], 16); + } else { + return ''; + } + } + } + + return '#' + hex(red) + hex(green) + hex(blue); +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + var hexColor = toHexColor(color); + + if (hexColor === '') { + var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); + tinyMCEPopup.alert(text + ': ' + color); + } + else { + tinyMCEPopup.restoreSelection(); + + if (f) + f(hexColor); + + tinyMCEPopup.close(); + } +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
                  '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
                  ' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
                  '; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value.replace(/ /g, '%20'), + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + st = tinyMCEPopup.dom.parseStyle(this.styleVal); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); + this.styleVal = dom.serializeStyle(st, 'img'); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js new file mode 100644 index 00000000..53ff409e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js @@ -0,0 +1,153 @@ +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js new file mode 100644 index 00000000..8bc169ed --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js @@ -0,0 +1,78 @@ +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + turnWrapOn(); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function setWhiteSpaceCss(value) { + var el = document.getElementById('htmlSource'); + tinymce.DOM.setStyle(el, 'white-space', value); +} + +function turnWrapOff() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre'); + } else { + setWrap('off'); + } +} + +function turnWrapOn() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre-wrap'); + } else { + setWrap('soft'); + } +} + +function toggleWordWrap(elm) { + if (elm.checked) { + turnWrapOn(); + } else { + turnWrapOff(); + } +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 110) + 'px'; + } +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js new file mode 100644 index 00000000..034195ca --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advanced',{"underline_desc":"Unterstrichen (Strg+U)","italic_desc":"Kursiv (Strg+I)","bold_desc":"Fett (Strg+B)",dd:"Definitionsbeschreibung",dt:"Definitionsbegriff",samp:"Beispiel",code:"Code",blockquote:"Zitatblock",h6:"\u00dcberschrift 6",h5:"\u00dcberschrift 5",h4:"\u00dcberschrift 4",h3:"\u00dcberschrift 3",h2:"\u00dcberschrift 2",h1:"\u00dcberschrift 1",pre:"Rohdaten",address:"Adresse",div:"Zusammenh\u00e4ngender Bereich",paragraph:"Absatz",block:"Vorlage",fontdefault:"Schriftart","font_size":"Schriftgr\u00f6\u00dfe","style_select":"Format","anchor_delta_width":"13","more_colors":"Weitere Farben","toolbar_focus":"Zur Werkzeugleiste springen: Alt+Q; Zum Editor springen: Alt-Z; Zum Elementpfad springen: Alt-X",newdocument:"Wollen Sie wirklich den ganzen Inhalt l\u00f6schen?",path:"Pfad","clipboard_msg":"Kopieren, Ausschneiden und Einf\u00fcgen sind im Mozilla Firefox nicht m\u00f6glich.\nWollen Sie mehr \u00fcber dieses Problem erfahren?","blockquote_desc":"Zitatblock","help_desc":"Hilfe","newdocument_desc":"Neues Dokument","image_props_desc":"Bildeigenschaften","paste_desc":"Einf\u00fcgen","copy_desc":"Kopieren","cut_desc":"Ausschneiden","anchor_desc":"Anker einf\u00fcgen/ver\u00e4ndern","visualaid_desc":"Hilfslinien und unsichtbare Elemente ein-/ausblenden","charmap_desc":"Sonderzeichen einf\u00fcgen","backcolor_desc":"Hintergrundfarbe","forecolor_desc":"Textfarbe","custom1_desc":"Benutzerdefinierte Beschreibung","removeformat_desc":"Formatierungen zur\u00fccksetzen","hr_desc":"Trennlinie einf\u00fcgen","sup_desc":"Hochgestellt","sub_desc":"Tiefgestellt","code_desc":"HTML-Quellcode bearbeiten","cleanup_desc":"Quellcode aufr\u00e4umen","image_desc":"Bild einf\u00fcgen/ver\u00e4ndern","unlink_desc":"Link entfernen","link_desc":"Link einf\u00fcgen/ver\u00e4ndern","redo_desc":"Wiederholen (Strg+Y)","undo_desc":"R\u00fcckg\u00e4ngig (Strg+Z)","indent_desc":"Einr\u00fccken","outdent_desc":"Ausr\u00fccken","numlist_desc":"Sortierte Liste","bullist_desc":"Unsortierte Liste","justifyfull_desc":"Blocksatz","justifyright_desc":"Rechtsb\u00fcndig","justifycenter_desc":"Zentriert","justifyleft_desc":"Linksb\u00fcndig","striketrough_desc":"Durchgestrichen","help_shortcut":"Dr\u00fccken Sie ALT-F10 f\u00fcr die Toolbar. Dr\u00fccken Sie ALT-0 f\u00fcr Hilfe","rich_text_area":"Rich Text Feld","shortcuts_desc":"Eingabehilfe",toolbar:"Toolbar","anchor_delta_height":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js new file mode 100644 index 00000000..d33ca1dd --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advanced_dlg',{"link_list":"Linkliste","link_is_external":"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?","link_is_email":"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?","link_titlefield":"Titel","link_target_blank":"Neues Fenster \u00f6ffnen","link_target_same":"Im selben Fenster \u00f6ffnen","link_target":"Fenster","link_url":"Adresse","link_title":"Link einf\u00fcgen/ver\u00e4ndern","image_align_right":"Rechts","image_align_left":"Links","image_align_textbottom":"Unten im Text","image_align_texttop":"Oben im Text","image_align_bottom":"Unten","image_align_middle":"Mittig","image_align_top":"Oben","image_align_baseline":"Zeile","image_align":"Ausrichtung","image_hspace":"Horizontaler Abstand","image_vspace":"Vertikaler Abstand","image_dimensions":"Abmessungen","image_alt":"Alternativtext","image_list":"Bilderliste","image_border":"Rahmen","image_src":"Adresse","image_title":"Bild einf\u00fcgen/ver\u00e4ndern","charmap_title":"Sonderzeichen","colorpicker_name":"Name:","colorpicker_color":"Farbe:","colorpicker_named_title":"Benannte Farben","colorpicker_named_tab":"Benannte Farben","colorpicker_palette_title":"Farbpalette","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Farbwahl","colorpicker_picker_tab":"Farbwahl","colorpicker_title":"Farbe","code_wordwrap":"Automatischer Zeilenumbruch","code_title":"HTML-Quellcode bearbeiten","anchor_name":"Name des Ankers","anchor_title":"Anker einf\u00fcgen/ver\u00e4ndern","about_loaded":"Geladene Plugins","about_version":"Version","about_author":"Urheber","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"Lizenzbedingungen","about_help":"Hilfe","about_general":"\u00dcber","about_title":"\u00dcber TinyMCE","charmap_usage":"Navigation mit linken und rechten Pfeilen.","anchor_invalid":"Bitte geben Sie einen g\u00fcltigen Namen f\u00fcr den Anker ein!","accessibility_help":"Eingabehilfe","accessibility_usage_title":"Allgemeine Verwendung","invalid_color_value":"Ung\u00fcltige Farbangabe"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js new file mode 100644 index 00000000..6e584818 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js new file mode 100644 index 00000000..e451f377 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced_dlg',{"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","charmap_usage":"Use left and right arrows to navigate.","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/link.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/link.htm new file mode 100644 index 00000000..5d9dea9b --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/link.htm @@ -0,0 +1,57 @@ + + + + {#advanced_dlg.link_title} + + + + + + + +
                  + + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + +
                  + + + + +
                   
                  +
                  +
                  + +
                  + + +
                  +
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm new file mode 100644 index 00000000..20ec2f5a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm @@ -0,0 +1,47 @@ + + + + {#advanced_dlg.accessibility_help} + + + + +

                  {#advanced_dlg.accessibility_usage_title}

                  +

                  Toolbars

                  +

                  Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

                  + +

                  Status Bar

                  +

                  To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

                  + +

                  Context Menu

                  +

                  Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

                  + +

                  Keyboard Shortcuts

                  + + + + + + + + + + + + + + + + + + + + + +
                  KeystrokeFunction
                  Control-BBold
                  Control-IItalic
                  Control-ZUndo
                  Control-YRedo
                  + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css new file mode 100644 index 00000000..52a1d67e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css @@ -0,0 +1,51 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +.mceHideBrInPre pre br {display: none} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css new file mode 100644 index 00000000..f0122265 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css @@ -0,0 +1,117 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png new file mode 100644 index 00000000..1e53560e Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif new file mode 100644 index 00000000..d2f93671 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif new file mode 100644 index 00000000..85e31dfb Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif new file mode 100644 index 00000000..adfdddcc Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif new file mode 100644 index 00000000..5bb90fd6 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif new file mode 100644 index 00000000..06812cb4 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css new file mode 100644 index 00000000..56df08a1 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css @@ -0,0 +1,215 @@ +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr;background:transparent} +.defaultSkin iframe {display:block;} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} +.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} +.defaultSkin span.mce_visualblocks {background-position: -40px -40px} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css new file mode 100644 index 00000000..36073f6f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content.css @@ -0,0 +1,27 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ +/* You can extend this CSS by adding your own CSS file with the the content_css option */ + +/* Import other styles */ +@import url('content_base.css'); +@import url('content_typography.css'); +@import url('content_grid.css'); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css new file mode 100644 index 00000000..5d5ed2cb --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_base.css @@ -0,0 +1,56 @@ +/* This file contains the CSS data for the editable area(iframe) of TinyMCE */ +/* You can extend this CSS by adding your own CSS file with the the content_css option */ + +* html body { + overflow-y: auto !important; overflow-x: auto !important; + font-size: 0; line-height: 0; +} + +body#tinymce, body#tinymce td, body#tinymce pre, body#tinymce ol, body#tinymce ul, body#tinymce li { + font-family: Arial, sans-serif; + font-size: 11px; line-height: 16px; font-weight: normal; color: #cc4343 !important; + white-space: normal; +} +body#tinymce { + margin: 0; padding: 10px 10px 10px 0 !important; + width: 620px; +} +body#tinymce.fullscreen { + width: 620px !important; /* Use this to apply the actual page-width and guarantee a wysiwyg content-structure */ +} + +a:link, a:visited, a:hover, a:active { + padding: 0; + color: #309bbf !important; + text-decoration: none !important; +} + +a.external:link, a.external:visited, a.external:hover, a.external:active { + padding: 0; + color: #309bbf !important; + text-decoration: underline !important; +} + +/* -- Absolute Break (Style=Umbruch) ---------- */ + +.clear { + clear: both !important; padding: 2px 0; + border-top-width: 2px !important; border-bottom-width: 2px !important; +} + +ol.clear, ul.clear { padding: 2px 0 2px 10px !important; } + +/* Clearing floats without extra markup + Based on How To Clear Floats Without Structural Markup by PiE + [http://www.positioniseverything.net/easyclearing.html] */ + +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clearfix {display: inline-block; border-top-width: 2px !important; border-bottom-width: 2px !important; } +* html .clearfix {height: 1%;} +.clearfix {display: block;} \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css new file mode 100644 index 00000000..7f7a3759 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure.css @@ -0,0 +1,69 @@ +/* -- Basic Elements ---------- */ + +body#tinymce { + width: 630px; /* 10px more than body#tinymce in content_base.css to provide equal line-breaks */ +} +body#tinymce.fullscreen { + padding-left: 10px !important; + width: 630px !important; /* 10px more than body#tinymce.fullscreen in content_base.css to provide equal line-breaks */ + background: #eee; +} + +/* -- Typographic Elements ---------- */ + +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce ol, +body#tinymce ul, +body#tinymce code, +body#tinymce pre, +body#tinymce blockquote { + padding: 2px 5px 5px; + line-height: 16px !important; + background-color: #fff; +} +body#tinymce p.mce-grid-container { + padding: 2px 0 0; + line-height: 16px !important; + background-color: transparent; + border-top: 0px dashed #999 !important; + border-bottom: 0px solid #999 !important; +} +body#tinymce table.mceItemTable td { + border: 1px dashed #bbb !important; +} +body#tinymce div h2, +body#tinymce div h3, +body#tinymce div h4, +body#tinymce div p, +body#tinymce div code, +body#tinymce div pre { + padding-left: 0; +} + +body#tinymce h2:before, +body#tinymce h3:before, +body#tinymce h4:before, +body#tinymce p:before, +body#tinymce ol:before, +body#tinymce ul:before, +body#tinymce code:before, +body#tinymce pre:before, +body#tinymce blockquote:before, +body#tinymce div:before { + position: relative; display: block; + font-family: "Andale Mono"; font-size: 9px; font-weight: normal; color: #999; +} +body#tinymce ol:before, +body#tinymce ul:before { + margin-left: -30px; +} +body#tinymce blockquote:before { + margin-left: -25px; +} +body#tinymce p.mce-grid-container:before { + margin-bottom: 3px; + color: #7c7c7c; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css new file mode 100644 index 00000000..03d9ec24 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_de.css @@ -0,0 +1,16 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h2:before { content: "Überschrift 2"; } +body#tinymce h3:before { content: "Überschrift 3"; } +body#tinymce h4:before { content: "Überschrift 4"; } +body#tinymce ol:before { content: "Sortierte Liste"; } +body#tinymce ul:before { content: "Unsortierte Liste"; } +body#tinymce p:before { content: "Absatz"; } +body#tinymce p.mce-grid-container:before { content: "Template"; } +body#tinymce code:before { content: "Code"; } +body#tinymce pre:before { content: "Vorformatiert"; } +body#tinymce blockquote:before { content: "Zitatblock"; } \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css new file mode 100644 index 00000000..a770a460 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_en.css @@ -0,0 +1,16 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h2:before { content: "Heading 2"; } +body#tinymce h3:before { content: "Heading 3"; } +body#tinymce h4:before { content: "Heading 4"; } +body#tinymce ol:before { content: "Ordered List"; } +body#tinymce ul:before { content: "Unordered List"; } +body#tinymce p:before { content: "Paragraph"; } +body#tinymce code:before { content: "Code"; } +body#tinymce pre:before { content: "Preformatted"; } +body#tinymce blockquote:before { content: "Blockquote"; } +body#tinymce div:before { content: "Div"; } \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css new file mode 100644 index 00000000..871ea13f --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_documentstructure_pl.css @@ -0,0 +1,16 @@ +/* -- Import Basic Documentstructure CSS ---------- */ + +@import url('content_documentstructure.css'); + +/* -- Language Specific Settings ---------- */ + +body#tinymce h2:before { content: "Nagłówek 2"; } +body#tinymce h3:before { content: "Nagłówek 3"; } +body#tinymce h4:before { content: "Nagłówek 4"; } +body#tinymce ol:before { content: "Lista numerowana"; } +body#tinymce ul:before { content: "Lista nienumerowana"; } +body#tinymce p:before { content: "Paragraf"; } +body#tinymce code:before { content: "Kod"; } +body#tinymce pre:before { content: "Preformatowane"; } +body#tinymce blockquote:before { content: "Cytat"; } +body#tinymce div:before { content: "Blok"; } diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css new file mode 100644 index 00000000..c203794e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_grid.css @@ -0,0 +1,85 @@ +/* ----------------------------------------------------------------------- + + CSS for the display of grid-templates in the editor + Grid applies to tables & tabledesks instead of the originally used divs + + Grid based on BLUEPRINT CSS + http://code.google.com/p/blueprintcss/ + +----------------------------------------------------------------------- */ + + + +/* Basic Grid Properties +----------------------------------------------------------------------- */ + +.span-1, .span-2, .span-3, .span-4, +.span-5, .span-6, .span-7, .span-8, +.span-9, .span-10, .span-11, .span-12, +.span-13, .span-14, .span-15, .span-16, +.span-17, .span-18, .span-19, .span-20, +.span-21, .span-22, .span-23, .span-24 { + overflow: hidden !important; +} + +/* Use these classes to set the width of a column. */ +.span-1 { width: 30px; } +.span-2 { width: 70px; } +.span-3 { width: 110px; } +.span-4 { width: 150px; } +.span-5 { width: 190px; } +.span-6 { width: 230px; } +.span-7 { width: 270px; } +.span-8 { width: 310px; } +.span-9 { width: 350px; } +.span-10 { width: 390px; } +.span-11 { width: 430px; } +.span-12 { width: 470px; } +.span-13 { width: 510px; } +.span-14 { width: 550px; } +.span-15 { width: 590px; } +.span-16 { width: 630px; } +.span-17 { width: 670px; } +.span-18 { width: 710px; } +.span-19 { width: 750px; } +.span-20 { width: 790px; } +.span-21 { width: 830px; } +.span-22 { width: 870px; } +.span-23 { width: 910px; } +.span-24 { width: 950px; margin: 0; } + + + +/* Table - Grid Properties +----------------------------------------------------------------------- */ + +body#tinymce table.mceItemTable { + margin: 0 0 0 -1px; padding: 0; + border: 0 !important; + background: transparent; + table-layout: fixed; + border-collapse: collapse; + border-spacing: 0; +} +body#tinymce table.mceItemTable td { + margin: 0; padding: 0; + border: 1px dashed #ddd !important; + background: transparent; + vertical-align: top; +} +/* Simulates Blueprints class .last */ +body#tinymce table.mceItemTable td + td { + padding-left: 10px !important; +} +/* Nested Tables */ +table.mceItemTable td table.mceItemTable { + margin: -1px 0 -1px -1px !important; +} + + + +/* Append, Prepend, Push, Pull, Borders & Misc Classes/Elements: + Not implemented yet. +----------------------------------------------------------------------- */ + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css new file mode 100644 index 00000000..213cbbd3 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/content_typography.css @@ -0,0 +1,96 @@ +/* -- Typographic Elements ---------- */ + +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce li, +body#tinymce pre { + color: #666 !important; +} +body#tinymce h2, +body#tinymce h3, +body#tinymce h4, +body#tinymce p, +body#tinymce ol, +body#tinymce ul, +body#tinymce code, +body#tinymce pre, +body#tinymce blockquote, +body#tinymce div { + margin: 0 0 10px; padding: 0; +} +body#tinymce h2 { + font-size: 17px; line-height: 21px; +} +body#tinymce h3 { + font-size: 15px; line-height: 19px; +} +body#tinymce h4 { + font-size: 12px; line-height: 16px; +} +body#tinymce ol, +body#tinymce ul { + padding-left: 35px !important; + list-style-position: outside; +} +body#tinymce ul { + list-style-type: disc; +} +body#tinymce ol li, +body#tinymce ul li { + margin-bottom: 5px; +} +body#tinymce ol li:last-child, +body#tinymce ul li:last-child { + margin-bottom: 0 !important; +} +body#tinymce pre, +body#tinymce code { + font-family: "Andale Mono"; +} +body#tinymce blockquote { + padding-left: 30px !important; +} + +/* -- Divs ---------- */ + +/*body#tinymce div { + min-height: 15px; + height: auto; + outline: 1px dashed #bbb; +}*/ + +/* -- Tables ---------- */ + +/*body#tinymce table.mceItemTable { + margin: 0; padding: 0; + border: 0 !important; + background: #ebe9e6 !important; + table-layout: auto; + border-collapse: collapse; + border-spacing: 0; +} +body#tinymce table.mceItemTable td { + border: 1px dashed #ccc !important; + background: #ebe9e6 !important; +} + +body#tinymce td { + vertical-align: top; +}*/ + +/* -- Images ---------- */ + +body#tinymce img { float: none; border: none !important; } + +body#tinymce img.img_left { float: left !important; margin: 14px 20px 14px 0; } +body#tinymce img.img_right { float: right !important; margin: 14px 0 14px 20px; border: none; } +body#tinymce img.img_block { display: block; float: none !important; clear: both !important; margin: 14px 0 !important; border: none; } + +body#tinymce img.img_left_nospacetop { float: left !important; margin: 2px 20px 14px 0; } +body#tinymce img.img_right_nospacetop { float: right !important; margin: 2px 0 14px 20px; border: none; } +body#tinymce img.img_block_nospacetop { display: block; float: none !important; clear: both !important; margin: 2px 0 14px 0 !important; border: none; } + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css new file mode 100644 index 00000000..763ac60e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/dialog.css @@ -0,0 +1,431 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ + + +/* Import & Modifications of Django/Grappelli styles +----------------------------------------------------------------------- */ +@import url('../../../../../../../css/base.css'); + + + +/* Generic +----------------------------------------------------------------------- */ +body { + clear: both; + margin: 0; + padding: 0 20px 0; + height: 100%; + background: #fff !important; +} +body.filebrowser { + margin: 0 !important; +} +body > *:first-child { + margin-top: 20px; +} + +html { + height: 100%; +} +html, body { + background: transparent; + overflow-x: hidden !important; + overflow-y: auto !important; +} +table { width: 100%; border-spacing: 0; } +td { padding: 0; } + +textarea { resize: none; outline: none; } +a:link, a:visited { color: black; } +a:hover { color: #2B6FB6; } + +div.submit-row { + position: relative; + float: left; + clear: both; + margin-top: 15px !important; +} + + +/* Tabs +----------------------------------------------------------------------- */ +.tabs { + position: relative; + float: left; + clear: both; + width: 100%; + font-size: 11px; + line-height: normal; + background: transparent; +} + +.tabs ul { + margin: 0; + padding: 0; + list-style: none; +} + +.tabs li { + float: left; + margin: 0 4px 0 0; padding: 2px 0 2px 12px; + line-height: 18px; + border: 1px solid #d4d4d4; + border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; + border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; + border-bottom: none; + outline: 0; + background: #e0f0f5; + list-style: none; +} + +.tabs li.current { + border-color: #c4c4c4; + background: #ddd; +} +.tabs span { + float: left; + display: block; + padding: 0px 10px 0 0; + outline: 0; +} +.tabs a { text-decoration: none; outline: 0; } +.tabs a:link, .tabs a:visited, .tabs a:hover { color: #666 !important; font-weight: bold; } +.tabs .current a, .tabs .current a:link, .tabs .current a:visited { color: #444 !important; font-weight: bold; } + + +/* Panels +----------------------------------------------------------------------- */ + +.panel_wrapper div.panel { + display: none; + position: relative; + float: none; + clear: both; + padding-top: 0; +} +.panel_wrapper div.current { + display: block; + width: 100%; + height: auto !important; + overflow: visible; /* Should be auto but that breaks Safari */ + padding-top: 0; +} +.panel_wrapper { + position: relative; + float: none; + clear: both; +} +.tabs + .panel_wrapper { + border-top-left-radius: 0; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; +} + +.mceActionPanel { +} + + + +/* Columns +----------------------------------------------------------------------- */ +.column { float: left; } + + +/* Titles +----------------------------------------------------------------------- */ +h1, h2, h3, h4 {color:#666; margin:0; padding:0; padding-top:5px;} +h3 { font-size:14px; } +.title { margin-bottom: 5px; font-size:12px; font-weight:bold; color:#666;} +p.helptext { margin: -5px 0 5px; } + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} + +#link .panel_wrapper, #link div.current { height: 125px; } +#image .panel_wrapper, #image div.current { height: 190px; } + + +/* Forms & Fieldsets +----------------------------------------------------------------------- */ +fieldset { + margin: 0; padding: 0; width: 100% !important; + border-top-left-radius: 0 !important; -moz-border-radius-topleft: 0 !important; -webkit-border-top-left-radius: 0 !important; +} +legend { + margin: 20px 0 0; + font-size: 15px; font-weight: bold; + color:#2B6FB6; display: none; +} +legend + .row { border-top: none !important; } + +/*label { + display: block; float: left; + font-size: 11px; width: 150px !important; +}*/ +.required { font-weight: bold; } +label.msg { display:none; } +label.invalid { color:#EE0000; display:inline; } +input.invalid { border:1px solid #EE0000; } +label.additional { position: relative; display: inline; float: none; top: 1px; } +.description label { margin: 0 0 12px !important; padding: 0 !important; } +#constrainlabel { display: inline; float: none; position: relative; top: 1px !important; } + +input[type=text], input[type=password], +select { + width: 100% !important; +} +input#src, input#href { + width: 100% !important; + padding-right: 28px; +} +input.size, input.number { + margin-right: 1px; + width: 50px !important; +} +input#width, input#height { + text-align: center; + vertical-align: middle; + width: 50px; +} +input.radio { + position: relative; + margin: 0 5px 13px 0; +} +input.checkbox { + position: relative; + margin: 0 5px 13px 0 !important; +} +.row input[type=radio], +.row input[type=radio] { +/* top: 0 !important;*/ +} +input[type=radio].standalone, +input[type=checkbox].standalone { + top: 6px !important; +} +input.radio.additional, input.checkbox.additional { + margin-left: 10px !important; +} +input#constrain { + position: relative; + margin: 0 5px 0 0 !important; +} +input + input#constrain { + margin-left: 32px !important; +} +p.constrain { + padding: 5px 0 0 !important; +} +input.radio.inline { + position: relative; top: 1px; + margin: 0 5px 0 0 !important; +} +input.checkbox.inline { + position: relative; top: -1px; + margin: 0 5px 0 0 !important; +} +/*.row.inline label { + margin: 0; +}*/ +.row.inline input.radio + label, .row.inline input.checkbox + label { + display: inline; float: none; position: relative; top: -1px !important; + margin-right: 30px; +} +.row.inline input.radio { + position: relative; top: -1px; + margin: 0 5px 0 0 !important; +} +.row.inline input.checkbox { + position: relative; top: -2px; + margin: 0 5px 0 0 !important; +} + +.input_noborder { border: 0; } + +#textareaContainer, #iframecontainer { + margin-bottom: 5px; + width: 100% !important; + border: 1px solid #d4d4d4; + border-radius: 5px !important; -moz-border-radius: 5px !important; -webkit-border-radius: 5px !important; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; +} +#textareaContainer { + border: 0; +} +#iframecontainer { + padding: 2px 0; +} +textarea#htmlSource { + width: 100% !important; height: 100%; + color: #444; font-family: 'Courier New',Courier,monospace; font-size: 12px; font-weight: normal; +/* border: 0 !important;*/ +} +#iframecontainer iframe { + border-radius: 5px !important; -moz-border-radius: 5px !important; -webkit-border-radius: 5px !important; +} + + + +/* Browse-Icons +----------------------------------------------------------------------- */ +.browse span { position: relative; top: -25px; margin-bottom: -25px; } +.browse span { + position: relative; display: block; float: right; + width: 23px; + height: 23px; + background-position: 50% 50%; + background-repeat: no-repeat; + cursor: pointer !important; +} + + + +/* Source +----------------------------------------------------------------------- */ +.wordWrapCode { vertical-align:middle; border:1px none #000; background:transparent; } +.mceActionPanel { margin-top:5px; } + + +/* Charmap +----------------------------------------------------------------------- */ +#charmap table { + border: 0; +} +#charmap tbody td { + border-bottom: 0; +} +#charmap td { + padding: 0 !important; +} +#charmap td.title { + border: 0 !important; +} +#charmap td#charmapView { +/* border: 1px solid #d4d4d4 !important;*/ +/* border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;*/ +/* background: #fff;*/ + + border: 0 !important; +} +td#charmapView > table { + border-collapse: collapse; +} + +#charmapgroup { + margin-right: 10px; +} +#charmapgroup table { + border: 1px solid #d4d4d4 !important; + border-collapse: collapse; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #fff; +} + +#charmapgroup table tr { + height: 18px !important; +} +#charmapgroup table td.charmap { + padding: 0 !important; + width: 18px; height: 18px; + text-align: center; + vertical-align: middle; + border-left: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; + cursor: pointer !important; +} +#charmapgroup table tr:first-child td.charmap { + border-top: none; +} +#charmapgroup table tr td.charmap:first-child { + border-left: none; +} +#charmapgroup table tr:last-child td.charmap { + border-bottom: none; +} + + +#charmap a:link, #charmap a:visited { + display: block; + padding: 0; + width: 100%; height: 100%; + color: #444; font-size: 12px; line-height: 18px; text-decoration: none; + border: none; +} +#charmap a:hover, #charmap a:active { + color: #444; + background: #e0f0f5; +} +td#charmapView > table tr:first-child td.charmap:first-child a { + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; +} +td#charmapView > table tr:first-child td.charmap:last-child a { + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; +} +td#charmapView > table tr:last-child td.charmap:first-child a { + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; +} +td#charmapView > table tr:last-child td.charmap:last-child a { + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; +} + +#charmap > table tr:last-child table td { + border: 0 !important; +} + +.selected-character { + position: relative; float: left; + margin-left: 20px; + width: 80px; +} +#codeV { + height: 80px; margin-bottom: 5px; + text-align: center; font-size: 40px; line-height: 80px !important; + border: 1px solid #d4d4d4 !important; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #e0f0f5; color: #444; +} +#codeN { + font-size: 10px; line-height: 11px; font-family: Arial,Helvetica,sans-serif; text-align:center; + color: #444; +} +.legend { + position: absolute; float: left; bottom: 18px; + margin-left: 20px; padding: 5px; + width: 70px; + border: 1px solid #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.legend span { color: #aaa; font-size: 10px; } +#codeA, #codeB { color: #444; } +#codeA { margin-bottom: 5px; } \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png new file mode 100644 index 00000000..a3758ef9 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/blockquote.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png new file mode 100644 index 00000000..10a09f1e Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bold.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png new file mode 100644 index 00000000..81dc1a9b Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/bullist.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png new file mode 100644 index 00000000..56e0f051 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/charmap.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png new file mode 100644 index 00000000..497a5ad5 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/cleanup.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png new file mode 100644 index 00000000..e36895f4 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/code.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png new file mode 100644 index 00000000..bc65403c Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/fullscreen.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png new file mode 100644 index 00000000..f4108807 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/image.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png new file mode 100644 index 00000000..07f0e0f7 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/italic.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png new file mode 100644 index 00000000..4c569a2d Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/link.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png new file mode 100644 index 00000000..6fc421dd Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/media.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png new file mode 100644 index 00000000..267242e0 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/numlist.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png new file mode 100644 index 00000000..73408167 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/pasteword.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png new file mode 100644 index 00000000..2f454441 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/redo.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png new file mode 100644 index 00000000..539d2bb4 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/search.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png new file mode 100644 index 00000000..466d68a3 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/show_advanced.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png new file mode 100644 index 00000000..b7b613d4 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/table.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png new file mode 100644 index 00000000..b7b613d4 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/template.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png new file mode 100644 index 00000000..9042cd3e Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/underline.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png new file mode 100644 index 00000000..a5df8a4b Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/undo.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png new file mode 100644 index 00000000..677b426d Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/unlink.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png new file mode 100644 index 00000000..c075fc1a Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/buttons/visualchars.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png new file mode 100644 index 00000000..0b20b492 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show-hover.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png new file mode 100644 index 00000000..c5e796c0 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-fb_show.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png new file mode 100644 index 00000000..22d4b0c8 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/icons/icon-mceResize.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png new file mode 100644 index 00000000..9f5a976c Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/img/menu/icon-mceOpen.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css new file mode 100644 index 00000000..ad7b94b4 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/grappelli/ui.css @@ -0,0 +1,492 @@ +/* ----------------------------------------------------------------------- + + Grappelli Skin - Tiny MCE + * based on Tiny MCE http://tinymce.moxiecode.com/ + + Grappelli Skin - Django Admin Interface + * http://code.google.com/p/django-grappelli/ + + Based on Django Admin Interface + * http://www.djangoproject.com + + Developed for Mozilla Firefox 3.0+ / using CSS 3 Specifications + + * See README for instructions on how to use Grappelli. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + + * Copyright (c) 2009, vonautomatisch werkstaetten. All rights reserved. + See LICENSE for more info. + +----------------------------------------------------------------------- */ + + + +/* Reset +----------------------------------------------------------------------- */ + +.grappelliSkin table, .grappelliSkin tbody, .grappelliSkin tr, .grappelliSkin td, +.grappelliSkin div, .grappelliSkin iframe, +.grappelliSkin a, .grappelliSkin img, .grappelliSkin span, +.grappelliSkin *, .grappelliSkin .text { + margin: 0; + padding: 0; + width: auto; + font-family: Arial, sans-serif; font-size: 11px; line-height: 15px; font-weight: normal; + text-decoration: none; text-align: left; white-space: nowrap; + border: none; + border-collapse: separate; + background: transparent; + vertical-align: baseline; + cursor: default; +} +.grappelliSkin table, .grappelliSkin tbody, .grappelliSkin tr, .grappelliSkin td { + margin: 0 !important; + border: 0 !important; + outline: 0 !important; +} +.grappelliSkin a { + text-decoration: none; + cursor: pointer; +} +.grappelliSkin table td { + padding: 0; + vertical-align: middle; +} +.grappelliSkin table td > a:first-child, +.grappelliSkin table th > a:first-child { + position: relative; + top: 0 !important; +} + + + +/* Containers +----------------------------------------------------------------------- */ + +.grappelliSkin table { + background: transparent; +} +.grappelliSkin iframe { + display: block; + position: relative; top: 0; + margin: 0; padding-top: 0; + border-top: 1px solid #fff; + border-bottom: 1px solid #d4d4d4; +} +.predelete .grappelliSkin iframe { + border-top: 1px solid #ffe5e5; + border-bottom: 1px solid #e5caca; +} +.grappelliSkin td.mceToolbar { + padding-bottom: 5px; + border-bottom: 1px solid #d4d4d4!important; +} +.predelete .grappelliSkin td.mceToolbar { + border-bottom: 1px solid #e5caca !important; +} +.grappelliSkin td.mceToolbar.advanced_icons { + border-top: 1px solid #ccc !important; +} +.predelete .grappelliSkin td.mceToolbar.advanced_icons { + border-top: 1px solid #ffe5e5 !important; +} +.grappelliSkin td.mceIframeContainer { + margin-top: 0; padding-top: 0; + height: auto !important; + vertical-align: top !important; +} + + + +/* Layout +----------------------------------------------------------------------- */ + +#changelist span.mceEditor.grappelliSkin { + display: inline-block; + margin: -4px 0 -5px; +} +.grappelliSkin table.mceLayout { + height: auto !important; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: transparent; +} +.predelete .grappelliSkin table.mceLayout { + background: transparent !important; +} +#mce_fullscreen_container { +/* height: 100% !important;*/ + background: transparent; + background: #eee; +} +#mce_fullscreen_container table.mceLayout { + height: 100% !important; + border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; + background: #eee !important; +} + +#mce_fullscreen_container .grappelliSkin table.mceLayout tr.mceFirst > td { + padding: 8px 8px 5px; +} + +/* Additional Toolbar-Rows */ +#changelist .grappelliSkin table.mceToolbar { + margin: 0 !important; +} + +.grappelliSkin table.mceToolbar + table.mceToolbar, +#changelist .grappelliSkin table.mceToolbar + table.mceToolbar { + margin-top: 5px !important; + height: 28px; + background: transparent; +} +.grappelliSkin span.mceIcon, .grappelliSkin img.mceIcon { + display: block; + width: 20px; height: 20px; +} + + + +/* Buttons +----------------------------------------------------------------------- */ + +.grappelliSkin .mceButton { + display: block; + margin-right: 2px; + width: 23px; height: 23px !important; + background: #fff; +} +.grappelliSkin .mceButton span, .grappelliSkin .mceListBox .mceOpen { + cursor: pointer; +} + +.grappelliSkin a.mceButtonEnabled { + border: 1px solid; + border-color: #d4d4d4 #c4c4c4 #c4c4c4 #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; +} +.grappelliSkin a.mceButtonEnabled:hover { + background: #e1f0f5; +} +.grappelliSkin a.mceButtonActive, .grappelliSkin a.mceButtonSelected { + border-color: #c0c0c0 #d2d2d2 #d2d2d2 #c0c0c0 !important; + background: #ddd; +} +.grappelliSkin .mceButtonDisabled { + border: 1px solid; + border-color: #d4d4d4 #fff #fff #d4d4d4; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: transparent; +} +.predelete .grappelliSkin .mceButtonDisabled { + border-color: #e5caca #ffe5e5 #ffe5e5 #e5caca; +} +.grappelliSkin .mceButtonDisabled span { + opacity: 0.4; +} + + + +/* Separator +----------------------------------------------------------------------- */ + +.grappelliSkin .mceSeparator { + display: block; + width: 4px; height: 22px; +} + + + +/* Listbox +----------------------------------------------------------------------- */ + +.grappelliSkin table.mceListBox { + background: transparent; +} + +.grappelliSkin .mceListBox, .grappelliSkin .mceListBox a { + display: block; +} +.grappelliSkin .mceListBox .mceText { + position: relative; + padding: 2px 0 0 4px !important; + width: 90px; height: 21px; + border: 1px solid; + border-color: #c4c4c4 #d4d4d4 #d4d4d4 #c4c4c4; + border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + background: #fafafa; + color: #666 !important; font-size: 11px !important; line-height: 20px; + overflow: hidden; +} + +.grappelliSkin .mceListBox .mceOpen { + margin-right: 4px; + width: 14px; height: 23px; + border: 1px solid; + border-color: #c4c4c4; + border-left: none; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; + background: #ddd url('img/menu/icon-mceOpen.png'); +} +.grappelliSkin table.mceListBoxEnabled:hover .mceText, +.grappelliSkin .mceListBoxHover .mceText, +.grappelliSkin .mceListBoxSelected .mceText { + background: #fff; +} +.grappelliSkin table.mceListBoxEnabled:hover .mceOpen, +.grappelliSkin .mceListBoxHover .mceOpen, +.grappelliSkin .mceListBoxSelected .mceOpen { + border-color: #c4c4c4 #d4d4d4 #d4d4d4 #c4c4c4; + background-color: #e1f0f5; +} +.grappelliSkin .mceListBoxSelected .mceText, +.grappelliSkin .mceListBoxSelected .mceOpen { + border-bottom-left-radius: 0 !important; -moz-border-radius-bottomleft: 0 !important; -webkit-border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; -moz-border-radius-bottomright: 0 !important; -webkit-border-bottom-right-radius: 0 !important; +} + +.grappelliSkin .mceListBoxMenu { + overflow: auto; + overflow-x: hidden; +} +.grappelliSkin .mceOldBoxModel .mceListBox .mceText { + height: 23px; +} + + + +/* SplitButton (not defined yet) +----------------------------------------------------------------------- */ +/* ColorSplitButton (not defined yet) +----------------------------------------------------------------------- */ + + + +/* Menu +----------------------------------------------------------------------- */ + +.grappelliSkin .mceMenu { + position: absolute; left: 0; top: -1px; z-index: 1000; + padding: 0; + min-width: 109px !important; + border: 1px solid #c4c4c4; + border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; + border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; + box-shadow: 0 5px 10px #999; -moz-box-shadow: 0 5px 10px #999; -webkit-box-shadow: 0 5px 10px #999; +} +.grappelliSkin .mceMenu table { + width: 100% !important; + border-top-right-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; + background: #fff; +} + +.grappelliSkin .mceMenu.mceDropDown { + border-radius: 5px !important; -moz-border-radius: 5px !important; -webkit-border-radius: 5px !important; + border: 2px solid #eee; +} +.grappelliSkin .mceMenu.mceDropDown table { + border-radius: 2px !important; -moz-border-radius: 2px !important; -webkit-border-radius: 2px !important; +} +.grappelliSkin .mceMenu a, .grappelliSkin .mceMenu span, .grappelliSkin .mceMenu { + display: block; + width: auto !important; + cursor: pointer; +} +.grappelliSkin .mceMenu td { + height: 18px; + border-bottom: 1px solid #d0d0d0; +} +.grappelliSkin .mceMenu tr.mceFirst td a { + border-top-right-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; +} +.grappelliSkin .mceMenu.mceDropDown tr.mceFirst td a { + border-top-left-radius: 3px; -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; +} +.grappelliSkin tr.mceMenuItemSeparator + tr.mceFirst td a { + border-top: none !important; + border-radius: 0 !important; -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; +} +.grappelliSkin .mceMenu tr.mceLast td { + border-bottom: none !important; +} +.grappelliSkin .mceMenu tr.mceLast td a { + border-bottom: none; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; +} + +.grappelliSkin .mceMenu a { + position: relative; + padding: 4px 0 3px; + color: #666 !important; +} +.grappelliSkin .mceMenu .mceText { + position: relative; display: block; + margin: 0; padding: 0 25px 0 4px; +} +.grappelliSkin .mceMenu .mceIcon { + display: none; + width: 0; height: 0; +} +.grappelliSkin .mceMenu .mceMenuItemEnabled a:hover, +.grappelliSkin .mceMenu .mceMenuItemEnabled a:active, +.grappelliSkin .mceMenu .mceMenuItemActive { + background-color: #e1f0f5; +} +.grappelliSkin .mceMenuItemSelected a { + background-color: #ddd; +} +.grappelliSkin td.mceMenuItemSeparator { + height: 2px; + border: none; + background: #a9a9a9; +} + +.grappelliSkin .mceMenuItemTitle a { + border: 0; + background: #f2d6d6; +} + +.grappelliSkin .mceMenuItemTitle span.mceText { + padding-left: 4px; + color: #666; +} +.grappelliSkin .mceMenuItemDisabled .mceText { + color: #999; +} + + + +/* Language Specific Content Additions +----------------------------------------------------------------------- */ + +.grappelliSkin .mceMenuItemTitle span.mceText[title="Format"]:before, +.grappelliSkin .mceMenuItemTitle span.mceText[title="Style"]:before { + content: "Reset "; +} +.grappelliSkin .mceMenuItemTitle span.mceText[title="Format "]:after, +.grappelliSkin .mceMenuItemTitle span.mceText[title="Stil"]:after { + content: " zurücksetzen"; +} + + + +/* Statusbar: Progress, Resize +----------------------------------------------------------------------- */ + +#mce_fullscreen_container .grappelliSkin td.mceStatusbar { + border-top: 1px solid #fff; + height: 100%; +} +.grappelliSkin td.mceStatusbar > div { + display: none; +} + +.grappelliSkin .mcePlaceHolder { + position: relative; + border: 1px solid #d4d4d4; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; + background: #d6ebf2 url('img/icons/icon-mceResize.png') 50% 100% no-repeat; + cursor: s-resize; +} +.predelete .grappelliSkin .mcePlaceHolder { + border: 1px solid #e5caca; +} +.table .grappelliSkin .mcePlaceHolder, +.table .grappelliSkin .mcePlaceHolder { + left: 0; +} + +.grappelliSkin a.mceResize { + display: block; + width: 100%; height: 20px; + border: 1px solid transparent; + border-top-color: #fff; + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; + background-image: url('img/icons/icon-mceResize.png'); + background-position: 50% 50%; + background-repeat: no-repeat; + cursor: s-resize; +} +.predelete .grappelliSkin a.mceResize { + border-top-color: #ffe5e5; +} +.grappelliSkin a.mceResize:link, .grappelliSkin a.mceResize:visited { + background-color: transparent; +} +.grappelliSkin a.mceResize:hover, .grappelliSkin a.mceResize:active { + border-color: #d4d4d4; + border-top-color: #ebebeb; + background-color: #d6ebf2; +} +.predelete .grappelliSkin a.mceResize:hover, .predelete .grappelliSkin a.mceResize:active { + border-color: #e5caca; + border-top-color: #ffe5e5; + background-color: #d6ebf2; +} + + + +/* Formats +----------------------------------------------------------------------- */ + +.grappelliSkin .mce_formatPreview a { /*apply specific styles here*/ } +.grappelliSkin .mce_p span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_pre span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h1 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h2 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h3 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h4 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h5 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_h6 span.mceText { /*apply specific styles here*/ } +.grappelliSkin .mce_div span.mceText { /*apply specific styles here*/ } + + + +/* Toolbar: Theme & Plugins Defaults +----------------------------------------------------------------------- */ + +.grappelliSkin .mceToolbar span { + /*width: 100%; */height: 100%; + background-position: 0 0; + background-repeat: no-repeat; +} + + + +/* Button Icons +----------------------------------------------------------------------- */ + +.grappelliSkin span.mce_bold { background-image: url('img/buttons/bold.png'); } +.grappelliSkin span.mce_italic { background-image: url('img/buttons/italic.png'); } +.grappelliSkin span.mce_underline { background-image: url('img/buttons/underline.png'); } +.grappelliSkin span.mce_undo { background-image: url('img/buttons/undo.png'); } +.grappelliSkin span.mce_redo { background-image: url('img/buttons/redo.png'); } +.grappelliSkin span.mce_bullist { background-image: url('img/buttons/bullist.png'); } +.grappelliSkin span.mce_numlist { background-image: url('img/buttons/numlist.png'); } +.grappelliSkin span.mce_blockquote { background-image: url('img/buttons/blockquote.png'); } +.grappelliSkin span.mce_link { background-image: url('img/buttons/link.png'); } +.grappelliSkin span.mce_unlink { background-image: url('img/buttons/unlink.png'); } +.grappelliSkin span.mce_image { background-image: url('img/buttons/image.png'); } +.grappelliSkin span.mce_code { background-image: url('img/buttons/code.png'); } +.grappelliSkin span.mce_charmap { background-image: url('img/buttons/charmap.png'); } + +.grappelliSkin span.mce_fullscreen { background-image: url('img/buttons/fullscreen.png'); } +.grappelliSkin span.mce_media { background-image: url('img/buttons/media.png'); } +.grappelliSkin span.mce_pasteword { background-image: url('img/buttons/pasteword.png'); } +.grappelliSkin span.mce_template { background-image: url('img/buttons/template.png'); } +.grappelliSkin span.mce_table { background-image: url('img/buttons/table.png'); } +.grappelliSkin span.mce_search { background-image: url('img/buttons/search.png'); } +.grappelliSkin span.mce_cleanup { background-image: url('img/buttons/cleanup.png'); } + +.grappelliSkin span.mce_grappelli_adv { background-image: url('img/buttons/show_advanced.png'); } +.grappelliSkin span.mce_grappelli_documentstructure { background-image: url('img/buttons/visualchars.png'); } + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css new file mode 100644 index 00000000..fe09e214 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css @@ -0,0 +1,25 @@ +body, td, pre { margin:8px;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} +.mceHideBrInPre pre br {display: none} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css new file mode 100644 index 00000000..b2ed097c --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css @@ -0,0 +1,105 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +background:#F0F0EE; +color: black; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE; color:#000;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;background-color:transparent;} +a:hover {color:#2B6FB6;background-color:transparent;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;background-color:transparent;} +input.invalid {border:1px solid #EE0000;background-color:transparent;} +input {background:#FFF; border:1px solid #CCC;color:black;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +font-weight:bold; +width:94px; height:23px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#cancel {float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} +.tabs li.current {font-weight: bold; margin-right:2px;} +.tabs span {float:left; display:block; padding:0px 10px 0 0;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css new file mode 100644 index 00000000..a2cfcc39 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css @@ -0,0 +1,102 @@ +/* Reset */ +.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} +.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} +.highcontrastSkin table td {vertical-align:middle} + +.highcontrastSkin .mceIconOnly {display: block !important;} + +/* External */ +.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} +.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} + +/* Layout */ +.highcontrastSkin table.mceLayout {border: 1px solid;} +.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} +.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} +.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} +.highcontrastSkin .mceStatusbar div {float:left} +.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} + +.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} +.highcontrastSkin .mceToolbar tr { display: block;} +.highcontrastSkin .mceToolbar table { display: block; } + +/* Button */ + +.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} +.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} +.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} + +/* Separator */ +.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} + +/* ListBox */ +.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} +.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} +.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} + +.highcontrastSkin .mceListBoxMenu {overflow-y:auto} + +/* SplitButton */ +.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} +.highcontrastSkin .mceSplitButton tr { display: table-row; } +.highcontrastSkin table.mceSplitButton { display: table; } +.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } +.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} + +/* Menu */ +.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} +.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } +.highcontrastSkin .mceMenu table {background:white; color: black} +.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} +.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} +.highcontrastSkin .mceMenu td {height:2em} +.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} +.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} +.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} +.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} +.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} +.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} +.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} +.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} +.highcontrastSkin .mceMenu span.mceMenuLine {display:none} +.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} +.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} + +/* ColorSplitButton */ +.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} +.highcontrastSkin .mceColorSplitMenu td {padding:2px} +.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} +.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} +.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} +.highcontrastSkin .mceColorPreview {display:none;} +.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} + +/* Progress,Resize */ +.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.highcontrastSkin .mce_p span.mceText {} +.highcontrastSkin .mce_address span.mceText {font-style:italic} +.highcontrastSkin .mce_pre span.mceText {font-family:monospace} +.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css new file mode 100644 index 00000000..3537c8bc --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css @@ -0,0 +1,49 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +.mceHideBrInPre pre br {display: none} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css new file mode 100644 index 00000000..ec087722 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css @@ -0,0 +1,117 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px} +#cancel {background:url(../default/img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png new file mode 100644 index 00000000..13a5cb03 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png new file mode 100644 index 00000000..7fc57f2b Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png new file mode 100644 index 00000000..c0dcc6ca Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css new file mode 100644 index 00000000..7b5103be --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -0,0 +1,218 @@ +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {padding-left: 3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} +.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} +.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} +.o2k7Skin span.mce_visualblocks {background-position: -40px -40px} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css new file mode 100644 index 00000000..50c9b76a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -0,0 +1,8 @@ +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css new file mode 100644 index 00000000..960a8e47 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -0,0 +1,5 @@ +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm new file mode 100644 index 00000000..800e2d93 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm @@ -0,0 +1,26 @@ + + + {#advanced_dlg.code_title} + + + + + +
                  +
                  {#advanced_dlg.code_title}
                  +
                  + + +
                  +
                  +
                  +
                  +
                    +
                  • +
                  • +
                  +
                  +
                  + + + diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js new file mode 100644 index 00000000..4b3209cc --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js @@ -0,0 +1 @@ +(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js new file mode 100644 index 00000000..01ce87c5 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js @@ -0,0 +1,84 @@ +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + deltaHeight : -20 + }; + }, + + getInfo : function() { + return { + longname : 'Simple theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + } + }); + + tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); +})(); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif new file mode 100644 index 00000000..6fcbcb5d Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js new file mode 100644 index 00000000..59bf788d --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/langs/de.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.simple',{"cleanup_desc":"Quellcode aufr\u00e4umen","redo_desc":"Wiederholen (Strg+Y)","undo_desc":"R\u00fcckg\u00e4ngig (Strg+Z)","numlist_desc":"Nummerierung","bullist_desc":"Aufz\u00e4hlung","striketrough_desc":"Durchgestrichen","underline_desc":"Unterstrichen (Strg+U)","italic_desc":"Kursiv (Strg+I)","bold_desc":"Fett (Strg+B)"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js new file mode 100644 index 00000000..088ed0fc --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"}); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css new file mode 100644 index 00000000..2506c807 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css @@ -0,0 +1,25 @@ +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css new file mode 100644 index 00000000..076fe84e --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css @@ -0,0 +1,32 @@ +/* Reset */ +.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css new file mode 100644 index 00000000..595809fa --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css @@ -0,0 +1,17 @@ +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png new file mode 100644 index 00000000..527e3495 Binary files /dev/null and b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png differ diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css new file mode 100644 index 00000000..cf6c35d1 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css @@ -0,0 +1,35 @@ +/* Reset */ +.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/tiny_mce.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/tiny_mce.js new file mode 100644 index 00000000..2d09557a --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/tiny_mce.js @@ -0,0 +1 @@ +(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"5b2",releaseDate:"2012-03-15",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?d:[g.scope]);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){if(o.hasOwnProperty(i)){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);(function(n){var l=n.VK,m=l.BACKSPACE,j=l.DELETE;function p(r,t,s){try{r.getDoc().execCommand(t,false,s)}catch(q){}}function d(q){var s=q.dom,r=q.selection;q.onKeyDown.add(function(u,z){var t,A,x,y,v;if(z.isDefaultPrevented()){return}v=z.keyCode==j;if((v||z.keyCode==m)&&!l.modifierPressed(z)){z.preventDefault();t=r.getRng();A=s.getParent(t.startContainer,s.isBlock);if(v){A=s.getNext(A,s.isBlock)}if(A){x=A.firstChild;while(x&&x.nodeType==3&&x.nodeValue.length==0){x=x.nextSibling}if(x&&x.nodeName==="SPAN"){y=x.cloneNode(false)}}u.getDoc().execCommand(v?"ForwardDelete":"Delete",false,null);A=s.getParent(t.startContainer,s.isBlock);n.each(s.select("span.Apple-style-span,font.Apple-style-span",A),function(B){var C=r.getBookmark();if(y){s.replace(y.cloneNode(false),B,true)}else{s.remove(B,true)}r.moveToBookmark(C)})}})}function e(q){function r(u){var t=q.dom.create("body");var v=u.cloneContents();t.appendChild(v);return q.selection.serializer.serialize(t,{format:"html"})}function s(t){var v=r(t);var x=q.dom.createRng();x.selectNode(q.getBody());var u=r(x);return v===u}q.onKeyDown.addToTop(function(u,x){var v=x.keyCode;if(v==j||v==m){var t=u.selection.getRng(true);if(!t.collapsed&&s(t)){u.setContent("",{format:"raw"});u.nodeChanged();x.preventDefault()}}})}function c(q){q.dom.bind(q.getDoc(),"focusin",function(){q.selection.setRng(q.selection.getRng())})}function g(q){q.onKeyDown.add(function(r,u){if(u.keyCode===m){if(r.selection.isCollapsed()&&r.selection.getRng(true).startOffset===0){var t=r.selection.getNode();var s=t.previousSibling;if(s&&s.nodeName&&s.nodeName.toLowerCase()==="hr"){r.dom.remove(s);n.dom.Event.cancel(u)}}}})}function i(q){if(!Range.prototype.getClientRects){q.onMouseDown.add(function(s,t){if(t.target.nodeName==="HTML"){var r=s.getBody();r.blur();setTimeout(function(){r.focus()},0)}})}}function h(q){q.onClick.add(function(r,s){s=s.target;if(/^(IMG|HR)$/.test(s.nodeName)){r.selection.getSel().setBaseAndExtent(s,0,s,1)}if(s.nodeName=="A"&&r.dom.hasClass(s,"mceItemAnchor")){r.selection.select(s)}r.nodeChanged()})}function b(q){var s=q.selection,v=q.dom;function t(){var x=v.getAttribs(s.getStart().cloneNode(false));return function(){var y=s.getStart();if(y!==q.getBody()){v.setAttrib(y,"style",null);n.each(x,function(z){y.setAttributeNode(z.cloneNode(true))})}}}function r(){return !s.isCollapsed()&&s.getStart()!=s.getEnd()}function u(x,y){y.preventDefault();return false}q.onKeyPress.add(function(x,z){var y;if((z.keyCode==8||z.keyCode==46)&&r()){y=t();x.getDoc().execCommand("delete",false,null);y();z.preventDefault();return false}});v.bind(q.getDoc(),"cut",function(y){var x;if(r()){x=t();q.onKeyUp.addToTop(u);setTimeout(function(){x();q.onKeyUp.remove(u)},0)}})}function o(q){var s,r;q.dom.bind(q.getDoc(),"selectionchange",function(){if(r){clearTimeout(r);r=0}r=window.setTimeout(function(){var t=q.selection.getRng();if(!s||!n.dom.RangeUtils.compareRanges(t,s)){q.nodeChanged();s=t}},50)})}function a(q){document.body.setAttribute("role","application")}function f(q){q.onKeyDown.add(function(r,t){if(t.keyCode===m){if(r.selection.isCollapsed()&&r.selection.getRng(true).startOffset===0){var s=r.selection.getNode().previousSibling;if(s&&s.nodeName&&s.nodeName.toLowerCase()==="table"){return n.dom.Event.cancel(t)}}}})}function k(r){var q=r.getDoc().documentMode;if(q&&q>7){return}p(r,"RespectVisibilityInDesign",true);r.dom.addClass(r.getBody(),"mceHideBrInPre");r.parser.addNodeFilter("pre",function(s,u){var v=s.length,y,t,z,x;while(v--){y=s[v].getAll("br");t=y.length;while(t--){z=y[t];x=z.prev;if(x&&x.type===3&&x.value.charAt(x.value-1)!="\n"){x.value+="\n"}else{z.parent.insert(new n.html.Node("#text",3),z,true).value="\n"}}}});r.serializer.addNodeFilter("pre",function(s,u){var v=s.length,y,t,z,x;while(v--){y=s[v].getAll("br");t=y.length;while(t--){z=y[t];x=z.prev;if(x&&x.type==3){x.value=x.value.replace(/\r?\n$/,"")}}}})}n.create("tinymce.util.Quirks",{Quirks:function(q){f(q);if(n.isWebKit){d(q);e(q);c(q);h(q);if(n.isIDevice){o(q)}}if(n.isIE){g(q);e(q);a(q);k(q)}if(n.isGecko){g(q);i(q);b(q)}}})})(tinymce);(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(r){var y={},p,n,v,q,u=d.url_converter,x=d.url_converter_scope||this;function o(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function t(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!t(B)){return}if(!t(A)){return}if(!t(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function s(A){q=true;return a[A]}function i(B,A){if(q){B=B.replace(/\uFEFF[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(r){r=r.replace(/\\[\"\';:\uFEFF]/g,s).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,s)});while(p=b.exec(r)){n=p[1].replace(l,"").toLowerCase();v=p[2].replace(l,"");if(n&&v.length>0){if(n==="font-weight"&&v==="700"){v="bold"}else{if(n==="color"||n==="background-color"){v=v.toLowerCase()}}v=v.replace(k,c);v=v.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=i(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=i(A||E||D);if(u){A=u.call(x,A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[n]=q?i(v,true):v}b.lastIndex=p.index+p[0].length}o("border","");o("border","-width");o("border","-color");o("border","-style");o("padding","");o("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][C]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li options p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(T=z.length-1;T>=U;T--){S=z[T];if(S.valid){n.end(S.name)}}z.length=U}}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9-:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");C=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;J={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};L=e.getShortEndedElements();I=e.getSelfClosingElements();G=e.getBoolAttrs();u=c.validate;r=c.remove_internals;x=c.fix_self_closing;p=a.isIE;o=/^:/;while(g=l.exec(D)){if(F0&&z[z.length-1].name===H){t(H)}if(!u||(m=e.getElementRule(H))){k=true;if(u){O=m.attributes;E=m.attributePatterns}if(Q=g[8]){y=Q.indexOf("data-mce-type")!==-1;if(y&&r){k=false}M=[];M.map={};Q.replace(C,function(T,S,X,W,V){var Y,U;S=S.toLowerCase();X=S in G?S:j(X||W||V||"");if(u&&!y&&S.indexOf("data-")!==0){Y=O[S];if(!Y&&E){U=E.length;while(U--){Y=E[U];if(Y.pattern.test(S)){break}}if(U===-1){Y=null}}if(!Y){return}if(Y.validValues&&!(X in Y.validValues)){return}}M.map[S]=X;M.push({name:S,value:X})})}else{M=[];M.map={}}if(u&&!y){R=m.attributesRequired;K=m.attributesDefault;f=m.attributesForced;if(f){P=f.length;while(P--){s=f[P];q=s.name;h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}if(K){P=K.length;while(P--){s=K[P];q=s.name;if(!(q in M.map)){h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}}if(R){P=R.length;while(P--){if(R[P] in M.map){break}}if(P===-1){k=false}}if(M.map["data-mce-bogus"]){k=false}}if(k){n.start(H,M,N)}}else{k=false}if(A=J[H]){A.lastIndex=F=g.index+g[0].length;if(g=A.exec(D)){if(k){B=D.substr(F,g.index-F)}F=g.index+g[0].length}else{B=D.substr(F);F=D.length}if(k&&B.length>0){n.text(B,true)}if(k){n.end(H)}l.lastIndex=F;continue}if(!N){if(!Q||Q.indexOf("/")!=Q.length-1){z.push({name:H,valid:k})}else{if(k){n.end(H)}}}}else{if(H=g[1]){n.comment(H)}else{if(H=g[2]){n.cdata(H)}else{if(H=g[3]){n.doctype(H)}else{if(H=g[4]){n.pi(H,g[5])}}}}}}F=g.index+g[0].length}if(F=0;P--){H=z[P];if(H.valid){n.end(H.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){O.value=l;O=O.prev}else{M=O.prev;O.remove();O=M}}}n=new b.html.SaxParser({validate:y,fix_self_closing:!y,cdata:function(l){A.append(I("#cdata",4)).value=l},text:function(N,l){var M;if(!J){N=N.replace(k," ");if(A.lastChild&&o[A.lastChild.name]){N=N.replace(D,"")}}if(N.length!==0){M=I("#text",3);M.raw=!!l;A.append(M).value=N}},comment:function(l){A.append(I("#comment",8)).value=l},pi:function(l,M){A.append(I(l,7)).value=M;G(A)},doctype:function(M){var l;l=A.append(I("#doctype",10));l.value=M;G(A)},start:function(l,U,N){var S,P,O,M,Q,V,T,R;O=y?h.getElementRule(l):{};if(O){S=I(O.outputName||l,1);S.attributes=U;S.shortEnded=N;A.append(S);R=p[A.name];if(R&&p[S.name]&&!R[S.name]){K.push(S)}P=d.length;while(P--){Q=d[P].name;if(Q in U.map){E=c[Q];if(E){E.push(S)}else{c[Q]=[S]}}}if(o[l]){G(S)}if(!N){A=S}if(!J&&s[l]){J=true}}},end:function(l){var Q,N,P,M,O;N=y?h.getElementRule(l):{};if(N){if(o[l]){if(!J){for(Q=A.firstChild;Q&&Q.type===3;){P=Q.value.replace(D,"");if(P.length>0){Q.value=P;Q=Q.next}else{M=Q.next;Q.remove();Q=M}}for(Q=A.lastChild;Q&&Q.type===3;){P=Q.value.replace(t,"");if(P.length>0){Q.value=P;Q=Q.prev}else{M=Q.prev;Q.remove();Q=M}}}Q=A.prev;if(Q&&Q.type===3){P=Q.value.replace(D,"");if(P.length>0){Q.value=P}else{Q.remove()}}}if(J&&s[l]){J=false}if(N.removeEmpty||N.paddEmpty){if(A.isEmpty(u)){if(N.paddEmpty){A.empty().append(new a("#text","3")).value="\u00a0"}else{if(!A.attributes.map.name){O=A.parent;A.empty().remove();A=O;return}}}}A=A.parent}}},h);H=A=new a(m.context||g.root_name,11);n.parse(v);if(y&&K.length){if(!m.context){j(K)}else{m.invalid=true}}if(q&&H.name=="body"){F()}if(!m.invalid){for(L in i){E=e[L];z=i[L];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(C=0,B=E.length;C0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i)||l.offsetWidth||l.clientWidth,h:parseInt(k)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=k.select("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
                  "+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="
                  "+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r==0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,T=0,F=1,j=2,E=true,S=false,V="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L});function x(){return e.createDocumentFragment()}function q(W,t){C(E,W,t)}function s(W,t){C(S,W,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[V]}else{O[h]=O[Q];O[V]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Z,t){var ac=O[h],X=O[V],ab=O[Q],W=O[A],aa=t.startContainer,ae=t.startOffset,Y=t.endContainer,ad=t.endOffset;if(Z===0){return H(ac,X,aa,ae)}if(Z===1){return H(ab,W,aa,ae)}if(Z===2){return H(ab,W,Y,ad)}if(Z===3){return H(ac,X,Y,ad)}}function p(){l(j)}function I(){return l(T)}function d(){return l(F)}function D(Z){var W=this[h],t=this[V],Y,X;if((W.nodeType===3||W.nodeType===4)&&W.nodeValue){if(!t){W.parentNode.insertBefore(Z,W)}else{if(t>=W.nodeValue.length){c.insertAfter(Z,W)}else{Y=W.splitText(t);W.parentNode.insertBefore(Z,Y)}}}else{if(W.childNodes.length>0){X=W.childNodes[t]}if(X){W.insertBefore(Z,X)}else{W.appendChild(Z)}}}function N(W){var t=O.extractContents();O.insertNode(W);W.appendChild(t);O.selectNode(W)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[V],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,W){var X;if(t.nodeType==3){return t}if(W<0){return t}X=t.firstChild;while(X&&W>0){--W;X=X.nextSibling}if(X){return X}return t}function m(){return(O[h]==O[Q]&&O[V]==O[A])}function H(Y,aa,W,Z){var ab,X,t,ac,ae,ad;if(Y==W){if(aa==Z){return 0}if(aa0){O.collapse(W)}}else{O.collapse(W)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ac){var ab,Y=0,ae=0,W,aa,X,Z,t,ad;if(O[h]==O[Q]){return f(ac)}for(ab=O[Q],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[h]){return r(ab,ac)}++Y}for(ab=O[h],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[Q]){return U(ab,ac)}++ae}aa=ae-Y;X=O[h];while(aa>0){X=X.parentNode;aa--}Z=O[Q];while(aa<0){Z=Z.parentNode;aa++}for(t=X.parentNode,ad=Z.parentNode;t!=ad;t=t.parentNode,ad=ad.parentNode){X=t;Z=ad}return o(X,Z,ac)}function f(ab){var ad,ae,t,X,Y,ac,Z,W,aa;if(ab!=j){ad=x()}if(O[V]==O[A]){return ad}if(O[h].nodeType==3){ae=O[h].nodeValue;t=ae.substring(O[V],O[A]);if(ab!=F){X=O[h];W=O[V];aa=O[A]-O[V];if(W===0&&aa>=X.nodeValue.length-1){X.parentNode.removeChild(X)}else{X.deleteData(W,aa)}O.collapse(E)}if(ab==j){return}if(t.length>0){ad.appendChild(e.createTextNode(t))}return ad}X=P(O[h],O[V]);Y=O[A]-O[V];while(X&&Y>0){ac=X.nextSibling;Z=z(X,ab);if(ad){ad.appendChild(Z)}--Y;X=ac}if(ab!=F){O.collapse(E)}return ad}function r(ac,Z){var ab,aa,W,t,Y,X;if(Z!=j){ab=x()}aa=i(ac,Z);if(ab){ab.appendChild(aa)}W=n(ac);t=W-O[V];if(t<=0){if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}aa=ac.previousSibling;while(t>0){Y=aa.previousSibling;X=z(aa,Z);if(ab){ab.insertBefore(X,ab.firstChild)}--t;aa=Y}if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}function U(aa,Z){var ac,W,ab,t,Y,X;if(Z!=j){ac=x()}ab=R(aa,Z);if(ac){ac.appendChild(ab)}W=n(aa);++W;t=O[A]-W;ab=aa.nextSibling;while(ab&&t>0){Y=ab.nextSibling;X=z(ab,Z);if(ac){ac.appendChild(X)}--t;ab=Y}if(Z!=F){O.setStartAfter(aa);O.collapse(E)}return ac}function o(aa,t,ad){var X,af,Z,ab,ac,W,ae,Y;if(ad!=j){af=x()}X=R(aa,ad);if(af){af.appendChild(X)}Z=aa.parentNode;ab=n(aa);ac=n(t);++ab;W=ac-ab;ae=aa.nextSibling;while(W>0){Y=ae.nextSibling;X=z(ae,ad);if(af){af.appendChild(X)}ae=Y;--W}X=i(t,ad);if(af){af.appendChild(X)}if(ad!=F){O.setStartAfter(aa);O.collapse(E)}return af}function i(ab,ac){var X=P(O[Q],O[A]-1),ad,aa,Z,t,W,Y=X!=O[Q];if(X==ab){return M(X,Y,S,ac)}ad=X.parentNode;aa=M(ad,S,S,ac);while(ad){while(X){Z=X.previousSibling;t=M(X,Y,S,ac);if(ac!=j){aa.insertBefore(t,aa.firstChild)}Y=E;X=Z}if(ad==ab){return aa}X=ad.previousSibling;ad=ad.parentNode;W=M(ad,S,S,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function R(ab,ac){var Y=P(O[h],O[V]),Z=Y!=O[h],ad,aa,X,t,W;if(Y==ab){return M(Y,Z,E,ac)}ad=Y.parentNode;aa=M(ad,S,E,ac);while(ad){while(Y){X=Y.nextSibling;t=M(Y,Z,E,ac);if(ac!=j){aa.appendChild(t)}Z=E;Y=X}if(ad==ab){return aa}Y=ad.nextSibling;ad=ad.parentNode;W=M(ad,S,E,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function M(t,Z,ac,ad){var Y,X,aa,W,ab;if(Z){return z(t,ad)}if(t.nodeType==3){Y=t.nodeValue;if(ac){W=O[V];X=Y.substring(W);aa=Y.substring(0,W)}else{W=O[A];X=Y.substring(0,W);aa=Y.substring(W)}if(ad!=F){t.nodeValue=aa}if(ad==j){return}ab=c.clone(t,S);ab.nodeValue=X;return ab}if(ad==j){return}return c.clone(t,S)}function z(W,t){if(t!=j){return t==F?c.clone(W,E):W}W.parentNode.removeChild(W)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)==0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)==0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var u,t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{if(u.canHaveHTML){u.innerHTML="\uFEFF";t=u.firstChild;x.moveToElementText(t);x.collapse(f)}}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1){if(!k.hasChildNodes()){k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";return}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

                  ";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="
                  ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x"+(h.item?h.item(0).outerHTML:h.htmlText);l.removeChild(l.firstChild)}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(g,i){var n=this,f=n.getRng(),j,k=n.win.document,m,l;i=i||{format:"html"};i.set=true;g=i.content=g;if(!i.no_events){n.onBeforeSetContent.dispatch(n,i)}g=i.content;if(f.insertNode){g+='_';if(f.startContainer==k&&f.endContainer==k){k.body.innerHTML=g}else{f.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=g}else{if(f.createContextualFragment){f.insertNode(f.createContextualFragment(g))}else{m=k.createDocumentFragment();l=k.createElement("div");m.appendChild(l);l.outerHTML=g;f.insertNode(m)}}}j=n.dom.get("__caret");f=k.createRange();f.setStartBefore(j);f.setEndBefore(j);n.setRng(f);n.dom.remove("__caret");try{n.setRng(f)}catch(h){}}else{if(f.item){k.execCommand("Delete",false,null);f=n.getRng()}if(/^\s+/.test(g)){f.pasteHTML('_'+g);n.dom.remove("__mce_tmp")}else{f.pasteHTML(g)}}if(!i.no_events){n.onSetContent.dispatch(n,i)}},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(r,s){var v=this,m=v.dom,g,j,i,n,h,o,p,l="\uFEFF",u;function f(x,y){var t=0;d(m.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function k(){var x=v.getRng(true),t=m.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}if(v.tridentSel){return v.tridentSel.getBookmark(r)}return k()}if(r){return{rng:v.getRng()}}g=v.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();try{g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);g.moveToElementText(j.parentElement());if(g.compareEndPoints("StartToEnd",j)==0){j.move("character",-1)}j.pasteHTML(''+l+"")}}catch(q){return null}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=v.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}if(g.startContainer.nodeType==9){return}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_end",style:u},l))}g.collapse(true);g.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_start",style:u},l))}v.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){y=t[0];for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(t[v]>u.length-1){return}x=u[t[v]]}if(x.nodeType===3){y=Math.min(t[0],x.nodeValue.length)}if(x.nodeType===1){y=Math.min(t[0],x.childNodes.length)}if(z){f.setStart(x,y)}else{f.setEnd(x,y)}}return true}if(r.tridentSel){return r.tridentSel.moveToBookmark(n)}if(g(true)&&g()){r.setRng(f)}}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(l.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'
                  ':" "}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;if(k){f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g)}return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var h=this,g=h.getRng(),i;if(g.item){i=g.item(0);g=h.win.document.body.createTextRange();g.moveToElementText(i)}g.collapse(!!f);h.setRng(g)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;try{h.removeAllRanges()}catch(f){}h.addRange(i);g.selectedRange=h.rangeCount>0?h.getRangeAt(0):null}}else{if(i.cloneRange){try{g.tridentSel.addRange(i);return}catch(f){}}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),i=h.getSel(),l,k=g.startContainer,f=g.endContainer;if(!g){return h.dom.getRoot()}if(g.setStart){l=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.endOffset-g.startOffset<2){if(g.startContainer.hasChildNodes()){l=g.startContainer.childNodes[g.startOffset]}}}if(k.nodeType===3&&f.nodeType===3){function j(p,m){var o=p;while(p&&p.nodeType===3&&p.length===0){p=m?p.nextSibling:p.previousSibling}return p||o}if(k.length===g.startOffset){k=j(k.nextSibling,true)}else{k=k.parentNode}if(g.endOffset===0){f=j(f.previousSibling,false)}else{f=f.parentNode}if(k&&k===f){return k}}}if(l&&l.nodeType==3){return l.parentNode}return l}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(o,g){var m=this,j=m.dom,l,k,h,i=[];l=j.getParent(o||m.getStart(),j.isBlock);k=j.getParent(g||m.getEnd(),j.isBlock);if(l){i.push(l)}if(l&&k&&l!=k){h=l;var f=new c.dom.TreeWalker(l,j.getRoot());while((h=f.next())&&h!=k){if(j.isBlock(h)){i.push(h)}}}if(k&&l!=k){i.push(k)}return i},normalize:function(){var g=this,f,i;if(c.isIE){return}function h(p){var k,o,n,m=g.dom,j=m.getRoot(),l;k=f[(p?"start":"end")+"Container"];o=f[(p?"start":"end")+"Offset"];if(k.nodeType===9){k=k.body;o=0}if(k===j){if(k.hasChildNodes()){k=k.childNodes[Math.min(!p&&o>0?o-1:o,k.childNodes.length-1)];o=0;if(k.hasChildNodes()){l=k;n=new c.dom.TreeWalker(k,j);do{if(l.nodeType===3){o=p?0:l.nodeValue.length-1;k=l;i=true;break}if(/^(BR|IMG)$/.test(l.nodeName)){o=m.nodeIndex(l);k=l.parentNode;if(l.nodeName=="IMG"&&!p){o++}i=true;break}}while(l=(p?n.next():n.prev()))}}}if(i){f["set"+(p?"Start":"End")](k,o)}}f=g.getRng();h(true);if(!f.collapsed){h()}if(i){g.setRng(f)}},destroy:function(g){var f=this;f.win=null;if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var g=this.dom,m=g.doc,h=m.body,j,n,f;m.documentElement.unselectable=true;function i(o,r){var p=h.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function l(p){var o;if(p.button){o=i(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",n)>0){o.setEndPoint("StartToStart",n)}else{o.setEndPoint("EndToEnd",n)}o.select()}}else{k()}}function k(){var o=m.selection.createRange();if(n&&!o.item&&o.compareEndPoints("StartToEnd",o)===0){n.select()}g.unbind(m,"mouseup",k);g.unbind(m,"mousemove",l);n=j=0}g.bind(m,["mousedown","contextmenu"],function(o){if(o.target.nodeName==="HTML"){if(j){k()}f=m.documentElement;if(f.scrollHeight>f.clientHeight){return}j=1;n=i(o.x,o.y);if(n){g.bind(m,"mouseup",k);g.bind(m,"mousemove",l);g.win.focus();n.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(m.getInner?o.innerHTML:a.trim(i.getOuterHTML(o),m),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(i,h,f){var g=this;g.parent(i,h,f);g.items=[];g.onChange=new a(g);g.onPostRender=new a(g);g.onAdd=new a(g);g.onRenderMenu=new d.util.Dispatcher(this);g.classPrefix="mceListBox";g.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==undefined){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var h=this,i,j,g;h.marked={};if(f!=h.selectedIndex){i=c.get(h.id+"_text");g=c.get(h.id+"_voiceDesc");j=h.items[f];if(j){h.selectedValue=j.value;h.selectedIndex=f;c.setHTML(i,c.encode(j.title));c.setHTML(g,h.settings.title+" - "+j.title);c.removeClass(i,"mceTitle");c.setAttrib(h.id,"aria-valuenow",j.title)}else{c.setHTML(i,c.encode(h.settings.title));c.setHTML(g,c.encode(h.settings.title));c.addClass(i,"mceTitle");h.selectedValue=h.selectedIndex=null;c.setAttrib(h.id,"aria-valuenow",h.settings.title)}i=0}},mark:function(f){this.marked[f]=true},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='';i+="";i+="";i+="";return i},showMenu:function(){var g=this,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;e(g.items,function(j){if(f.items[j.id]){f.items[j.id].setSelected(0)}});e(g.items,function(j){if(f.items[j.id]&&g.marked[j.value]){f.items[j.id].setSelected(1)}if(j.value===g.selectedValue){f.items[j.id].setSelected(1)}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){c.removeClass(f.id,f.classPrefix+"Selected");if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(function(){g.hideMenu();g.focus()});f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.role="option";h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id,"keydown",function(h){if(h.keyCode==32){f.showMenu(h);b.cancel(h)}});b.add(f.id,"focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id,"keydown",function(h){if(h.keyCode==40){f.showMenu();b.cancel(h)}});f.keyPressHandler=b.add(f.id,"keypress",function(i){var h;if(i.keyCode==13){h=f.selectedValue;f.selectedValue=null;b.cancel(i);f.settings.onselect(h)}})}f._focused=1});b.add(f.id,"blur",function(){b.remove(f.id,"keydown",f.keyDownHandler);b.remove(f.id,"keypress",f.keyPressHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f;this.setAriaProperty("disabled",f)},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox","aria-labelledby":f.id+"_aria"},g);g+=c.createHTML("span",{id:f.id+"_aria",style:"display: none"},f.settings.title);return g},postRender:function(){var g=this,h,i=true;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);i=false;j=b.add(g.id,"blur",function(){if(i){return}i=true;b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(d.isWebKit&&(k.keyCode==37||k.keyCode==39)){return b.prevent(k)}if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
                  ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
                  ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(v){var u=this,o,n=j.ScriptLoader,r,l=[],q;function p(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(y,z,t){var x=y[z];if(!x){return}if(j.is(x,"string")){t=x.replace(/\.\w+$/,"");t=t?j.resolve(t):0;x=j.resolve(x)}return x.apply(t||this,Array.prototype.slice.call(arguments,2))}v=d({theme:"simple",language:"en"},v);u.settings=v;i.bind(window,"ready",function(){var s,x;m(v,"onpageload");switch(v.mode){case"exact":s=v.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){q=new j.Editor(y,v);l.push(q);q.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);q=new j.Editor(y,v);l.push(q);q.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(z,y){return y.constructor===RegExp?y.test(z.className):k.hasClass(z,y)}g(k.select("textarea"),function(y){if(v.editor_deselector&&t(y,v.editor_deselector)){return}if(!v.editor_selector||t(y,v.editor_selector)){q=new j.Editor(p(y),v);l.push(q);q.render(1)}});break;default:if(v.types){g(v.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(p(A),j.extend({},v,y));l.push(z);z.render(1)})})}else{if(v.selector){g(k.select(v.selector),function(z){var y=new j.Editor(p(z),v);l.push(y);y.render(1)})}}}if(v.oninit){s=x=0;g(l,function(y){x++;if(!y.initialized){y.onInit.add(function(){s++;if(s==x){m(v,"oninit")}})}else{s++}if(s==x){m(v,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside",validate:true,entity_encoding:"named",url_converter:q.convertURL,url_converter_scope:q,ie7_compat:true},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=n.baseURI;q.contentCSS=[];q.execCallback("setup",q)},render:function(u){var v=this,x=v.settings,y=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(window,"ready",function(){v.render()});return}tinyMCE.settings=x;if(!v.getElement()){return}if(n.isIDevice&&!n.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&x.hidden_input&&o.getParent(y,"form")){o.insertAfter(o.create("input",{type:"hidden",name:y}),y)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(x.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(x.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(x.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(x.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){n.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(x.language&&x.language_load!==false){q.add(n.baseURL+"/langs/"+x.language+".js")}if(x.theme&&x.theme.charAt(0)!="-"&&!h.urls[x.theme]){h.load(x.theme,"themes/"+x.theme+"/editor_template"+n.suffix+".js")}i(g(x.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(A){var z={prefix:"plugins/",resource:A,suffix:"/editor_plugin"+n.suffix+".js"};var A=c.createUrl(z,A);c.load(A.resource,A)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+n.suffix+".js"})}}});q.loadQueue(function(){if(!v.removed){v.init()}})}r()},init:function(){var v,I=this,J=I.settings,F,B,E=I.getElement(),r,q,G,z,D,H,A,x=[];n.add(I);J.aria_label=J.aria_label||o.getAttrib(E,"aria-label",I.getLang("aria.rich_text_area"));if(J.theme){J.theme=J.theme.replace(/-/,"");r=h.get(J.theme);I.theme=new r();if(I.theme.init&&J.init_theme){I.theme.init(I,h.urls[J.theme]||n.documentBaseURL.replace(/\/$/,""))}}function C(K){var L=c.get(K),t=c.urls[K]||n.documentBaseURL.replace(/\/$/,""),s;if(L&&n.inArray(x,K)===-1){i(c.dependencies(K),function(u){C(u)});s=new L(I,t);I.plugins[K]=s;if(s.init){s.init(I,t);x.push(K)}}}i(g(J.plugins.replace(/\-/g,"")),C);if(J.popup_css!==false){if(J.popup_css){J.popup_css=I.documentBaseURI.toAbsolute(J.popup_css)}else{J.popup_css=I.baseURI.toAbsolute("themes/"+J.theme+"/skins/"+J.skin+"/dialog.css")}}if(J.popup_css_add){J.popup_css+=","+I.documentBaseURI.toAbsolute(J.popup_css_add)}I.controlManager=new n.ControlManager(I);if(J.custom_undo_redo){I.onBeforeExecCommand.add(function(t,K,u,L,s){if(K!="Undo"&&K!="Redo"&&K!="mceRepaint"&&(!s||!s.skip_undo)){I.undoManager.beforeChange()}});I.onExecCommand.add(function(t,K,u,L,s){if(K!="Undo"&&K!="Redo"&&K!="mceRepaint"&&(!s||!s.skip_undo)){I.undoManager.add()}})}I.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){I.nodeChanged()}});if(a){function y(s,t){if(!t||!t.initial){I.execCommand("mceRepaint")}}I.onUndo.add(y);I.onRedo.add(y);I.onSetContent.add(y)}I.onBeforeRenderUI.dispatch(I,I.controlManager);if(J.render_ui){F=J.width||E.style.width||E.offsetWidth;B=J.height||E.style.height||E.offsetHeight;I.orgDisplay=E.style.display;H=/^[0-9\.]+(|px)$/i;if(H.test(""+F)){F=Math.max(parseInt(F)+(r.deltaWidth||0),100)}if(H.test(""+B)){B=Math.max(parseInt(B)+(r.deltaHeight||0),100)}r=I.theme.renderUI({targetNode:E,width:F,height:B,deltaWidth:J.delta_width,deltaHeight:J.delta_height});I.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:F,height:B});if(J.content_css){n.each(g(J.content_css),function(s){I.contentCSS.push(I.documentBaseURI.toAbsolute(s))})}B=(r.iframeHeight||B)+(typeof(B)=="number"?(r.deltaHeight||0):"");if(B<100){B=100}I.iframeHTML=J.doctype+'';if(J.document_base_url!=n.documentBaseURL){I.iframeHTML+=''}if(J.ie7_compat){I.iframeHTML+=''}else{I.iframeHTML+=''}I.iframeHTML+='';for(A=0;A'}I.contentCSS=[];z=J.body_id||"tinymce";if(z.indexOf("=")!=-1){z=I.getParam("body_id","","hash");z=z[I.id]||z}D=J.body_class||"";if(D.indexOf("=")!=-1){D=I.getParam("body_class","","hash");D=D[I.id]||""}I.iframeHTML+='
                  ";if(n.relaxedDomain&&(b||(n.isOpera&&parseFloat(opera.version())<11))){G='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+I.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}v=o.add(r.iframeContainer,"iframe",{id:I.id+"_ifr",src:G||'javascript:""',frameBorder:"0",allowTransparency:"true",title:J.aria_label,style:{width:"100%",height:B,display:"block"}});I.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=I.orgDisplay;o.get(I.id).style.display="none";o.setAttrib(I.id,"aria-hidden",true);if(!n.relaxedDomain||!G){I.setupIframe()}E=v=r=null},setupIframe:function(){var r=this,x=r.settings,y=o.get(r.id),z=r.getDoc(),v,q;if(!b||!n.relaxedDomain){z.open();z.write(r.iframeHTML);z.close();if(n.relaxedDomain){z.domain=n.relaxedDomain}}q=r.getBody();q.disabled=true;if(!x.readonly){q.contentEditable=true}q.disabled=false;r.schema=new n.html.Schema(x);r.dom=new n.dom.DOMUtils(r.getDoc(),{keep_values:true,url_converter:r.convertURL,url_converter_scope:r,hex_colors:x.force_hex_style_colors,class_filter:x.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:r.schema});r.parser=new n.html.DomParser(x,r.schema);if(!r.settings.allow_html_in_named_anchor){r.parser.addAttributeFilter("name",function(s,t){var B=s.length,D,A,C,E;while(B--){E=s[B];if(E.name==="a"&&E.firstChild){C=E.parent;D=E.lastChild;do{A=D.prev;C.insert(D,E);D=A}while(D)}}})}r.parser.addAttributeFilter("src,href,style",function(s,t){var A=s.length,C,E=r.dom,D,B;while(A--){C=s[A];D=C.attr(t);B="data-mce-"+t;if(!C.attributes.map[B]){if(t==="style"){C.attr(B,E.serializeStyle(E.parseStyle(D),C.name))}else{C.attr(B,r.convertURL(D,t,C.name))}}}});r.parser.addNodeFilter("script",function(s,t){var A=s.length,B;while(A--){B=s[A];B.attr("type","mce-"+(B.attr("type")||"text/javascript"))}});r.parser.addNodeFilter("#cdata",function(s,t){var A=s.length,B;while(A--){B=s[A];B.type=8;B.name="#comment";B.value="[CDATA["+B.value+"]]"}});r.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,A){var B=t.length,C,s=r.schema.getNonEmptyElements();while(B--){C=t[B];if(C.isEmpty(s)){C.empty().append(new n.html.Node("br",1)).shortEnded=true}}});r.serializer=new n.dom.Serializer(x,r.dom,r.schema);r.selection=new n.dom.Selection(r.dom,r.getWin(),r.serializer);r.formatter=new n.Formatter(this);r.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(s){return true},onformat:function(A,s,t){i(t,function(C,B){r.dom.setAttrib(A,B,C)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){r.formatter.register(s,{block:s,remove:"all"})});r.formatter.register(r.settings.formats);r.undoManager=new n.UndoManager(r);r.undoManager.onAdd.add(function(t,s){if(t.hasUndo()){return r.onChange.dispatch(r,s,t)}});r.undoManager.onUndo.add(function(t,s){return r.onUndo.dispatch(r,s,t)});r.undoManager.onRedo.add(function(t,s){return r.onRedo.dispatch(r,s,t)});r.forceBlocks=new n.ForceBlocks(r);r.enterKey=new n.EnterKey(r);r.editorCommands=new n.EditorCommands(r);r.serializer.onPreProcess.add(function(s,t){return r.onPreProcess.dispatch(r,t,s)});r.serializer.onPostProcess.add(function(s,t){return r.onPostProcess.dispatch(r,t,s)});r.onPreInit.dispatch(r);if(!x.gecko_spellcheck){r.getBody().spellcheck=0}if(!x.readonly){r._addEvents()}r.controlManager.onPostRender.dispatch(r,r.controlManager);r.onPostRender.dispatch(r);r.quirks=new n.util.Quirks(this);if(x.directionality){r.getBody().dir=x.directionality}if(x.nowrap){r.getBody().style.whiteSpace="nowrap"}if(x.handle_node_change_callback){r.onNodeChange.add(function(t,s,A){r.execCallback("handle_node_change_callback",r.id,A,-1,-1,true,r.selection.isCollapsed())})}if(x.save_callback){r.onSaveContent.add(function(s,A){var t=r.execCallback("save_callback",r.id,A.content,r.getBody());if(t){A.content=t}})}if(x.onchange_callback){r.onChange.add(function(t,s){r.execCallback("onchange_callback",r,s)})}if(x.protect){r.onBeforeSetContent.add(function(s,t){if(x.protect){i(x.protect,function(A){t.content=t.content.replace(A,function(B){return""})})}})}if(x.convert_newlines_to_brs){r.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"
                  ")}})}if(x.preformatted){r.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='
                  '+t.content+"
                  "}})}if(x.verify_css_classes){r.serializer.attribValueFilter=function(C,A){var B,t;if(C=="class"){if(!r.classesRE){t=r.dom.getClasses();if(t.length>0){B="";i(t,function(s){B+=(B?"|":"")+s["class"]});r.classesRE=new RegExp("("+B+")","gi")}}return !r.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(A)||r.classesRE.test(A)?A:""}return A}}if(x.cleanup_callback){r.onBeforeSetContent.add(function(s,t){t.content=r.execCallback("cleanup_callback","insert_to_editor",t.content,t)});r.onPreProcess.add(function(s,t){if(t.set){r.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){r.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});r.onPostProcess.add(function(s,t){if(t.set){t.content=r.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=r.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(x.save_callback){r.onGetContent.add(function(s,t){if(t.save){t.content=r.execCallback("save_callback",r.id,t.content,r.getBody())}})}if(x.handle_event_callback){r.onEvent.add(function(s,t,A){if(r.execCallback("handle_event_callback",t,s,A)===false){k.cancel(t)}})}r.onSetContent.add(function(){r.addVisual(r.getBody())});if(x.padd_empty_editor){r.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                  [\r\n]*)$/,"")})}if(a){function u(s,t){i(s.dom.select("a"),function(B){var A=B.parentNode;if(s.dom.isBlock(A)&&A.lastChild===B){s.dom.add(A,"br",{"data-mce-bogus":1})}})}r.onExecCommand.add(function(s,t){if(t==="CreateLink"){u(s)}});r.onSetContent.add(r.selection.onSetContent.add(u))}r.load({initial:true,format:"html"});r.startContent=r.getContent({format:"raw"});r.undoManager.add();r.initialized=true;r.onInit.dispatch(r);r.execCallback("setupcontent_callback",r.id,r.getBody(),r.getDoc());r.execCallback("init_instance_callback",r);r.focus(true);r.nodeChanged({initial:1});i(r.contentCSS,function(s){r.dom.loadCSS(s)});if(x.auto_focus){setTimeout(function(){var s=n.get(x.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}y=null},focus:function(v){var z,r=this,u=r.selection,y=r.settings.content_editable,s,q,x=r.getDoc();if(!v){s=u.getRng();if(s.item){q=s.item(0)}r._refreshContentEditable();if(!y){r.getWin().focus()}if(n.isGecko){r.getBody().focus()}if(q&&q.ownerDocument==x){s=x.body.createControlRange();s.addElement(q);s.select()}}if(n.activeEditor!=r){if((z=n.activeEditor)!=null){z.onDeactivate.dispatch(z,r)}r.onActivate.dispatch(r,z)}n._setActive(r)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=n.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return n.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(x,s,q){var t=n.trim,r=d(this.settings[x])?this.settings[x]:s,u;if(q==="hash"){u={};if(d(r,"string")){i(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(y){y=y.split("=");if(y.length>1){u[t(y[0])]=t(y[1])}else{u[t(y[0])]=t(y)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getStart()||q.getBody();if(q.initialized){u=u||{};v=b&&v.ownerDocument!=q.getDoc()?q.getBody():v;u.parents=[];q.dom.getParent(v,function(s){if(s.nodeName=="BODY"){return true}u.parents.push(s)});q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(q,s,r){this.execCommands[q]={func:s,scope:r||this}},addQueryStateHandler:function(q,s,r){this.queryStateCommands[q]={func:s,scope:r||this}},addQueryValueHandler:function(q,s,r){this.queryValueCommands[q]={func:s,scope:r||this}},addShortcut:function(s,v,q,u){var r=this,x;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){x=q;q=function(){r.execCommand(x,false,null)}}if(d(q,"object")){x=q;q=function(){r.execCommand(x[0],x[1],x[2])}}i(g(s),function(t){var y={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(z){switch(z){case"alt":case"ctrl":case"shift":y[z]=true;break;default:y.charCode=z.charCodeAt(0);y.keyCode=z.toUpperCase().charCodeAt(0)}});r.shortcuts[(y.ctrl?"ctrl":"")+","+(y.alt?"alt":"")+","+(y.shift?"shift":"")+","+y.keyCode]=y});return true},execCommand:function(y,x,A,q){var u=this,v=0,z,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(y)&&(!q||!q.skip_focus)){u.focus()}q=f({},q);u.onBeforeExecCommand.dispatch(u,y,x,A,q);if(q.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}if(z=u.execCommands[y]){r=z.func.call(z.scope,x,A);if(r!==true){u.onExecCommand.dispatch(u,y,x,A,q);return r}}i(u.plugins,function(s){if(s.execCommand&&s.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}if(u.editorCommands.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}u.getDoc().execCommand(y,x,A);u.onExecCommand.dispatch(u,y,x,A,q)},queryCommandState:function(v){var r=this,x,u;if(r._isHidden()){return}if(x=r.queryStateCommands[v]){u=x.func.call(x.scope);if(u!==true){return u}}x=r.editorCommands.queryCommandState(v);if(x!==-1){return x}try{return this.getDoc().queryCommandState(v)}catch(q){}},queryCommandValue:function(x){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[x]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(x);if(d(v)){return v}try{return this.getDoc().queryCommandValue(x)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=false;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){i(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(v,t){var s=this,r,q=s.getBody(),u;t=t||{};t.format=t.format||"html";t.set=true;t.content=v;if(!t.no_events){s.onBeforeSetContent.dispatch(s,t)}v=t.content;if(!n.isIE&&(v.length===0||/^\s+$/.test(v))){u=s.settings.forced_root_block;if(u){v="<"+u+'>
                  "}else{v='
                  '}q.innerHTML=v;s.selection.select(q,true);s.selection.collapse(true);return}if(t.format!=="raw"){v=new n.html.Serializer({},s.schema).serialize(s.parser.parse(v))}t.content=n.trim(v);s.dom.setHTML(q,t.content);if(!t.no_events){s.onSetContent.dispatch(s,t)}s.selection.normalize();return t.content},getContent:function(r){var q=this,s;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){q.onBeforeGetContent.dispatch(q,r)}if(r.format=="raw"){s=q.getBody().innerHTML}else{s=q.serializer.serialize(q.getBody(),r)}r.content=n.trim(s);if(!r.no_events){q.onGetContent.dispatch(q,r)}return r.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,y,x){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,x,true,y)}if(!v.convert_urls||(x&&x.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}i(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();if(!q.removed){q.removed=1;q.hide();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement);k.unbind(r);q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];n.remove(q);o.remove(r)}},destroy:function(r){var q=this;if(q.destroyed){return}if(a){k.unbind(q.getDoc());k.unbind(q.getWin());k.unbind(q.getBody())}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy()}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var B=this,u,C=B.settings,r=B.dom,y={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function q(t,D){var s=t.type;if(B.removed){return}if(B.onEvent.dispatch(B,t,D)!==false){B[y[t.fakeType||t.type]].dispatch(B,t,D)}}i(y,function(t,s){switch(s){case"contextmenu":r.bind(B.getDoc(),s,q);break;case"paste":r.bind(B.getBody(),s,function(D){q(D)});break;case"submit":case"reset":r.bind(B.getElement().form||o.getParent(B.id,"form"),s,q);break;default:r.bind(C.content_editable?B.getBody():B.getDoc(),s,q)}});r.bind(C.content_editable?B.getBody():(a?B.getDoc():B.getWin()),"focus",function(s){B.focus(true)});if(n.isGecko){r.bind(B.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=B.documentBaseURI.toAbsolute(s)}})}if(a){function v(){var E=this,G=E.getDoc(),F=E.settings;if(a&&!F.readonly){E._refreshContentEditable();try{G.execCommand("styleWithCSS",0,false)}catch(D){if(!E._isHidden()){try{G.execCommand("useCSS",0,true)}catch(D){}}}if(!F.table_inline_editing){try{G.execCommand("enableInlineTableEditing",false,false)}catch(D){}}if(!F.object_resizing){try{G.execCommand("enableObjectResizing",false,false)}catch(D){}}}}B.onBeforeExecCommand.add(v);B.onMouseDown.add(v)}B.onMouseUp.add(B.nodeChanged);B.onKeyUp.add(function(s,t){var D=t.keyCode;if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45||D==46||D==8||(n.isMac&&(D==91||D==93))||t.ctrlKey){B.nodeChanged()}});B.onKeyDown.add(function(t,D){if(D.keyCode!=j.BACKSPACE){return}var s=t.selection.getRng();if(!s.collapsed){return}var F=s.startContainer;var E=s.startOffset;while(F&&F.nodeType&&F.nodeType!=1&&F.parentNode){F=F.parentNode}if(F&&F.parentNode&&F.parentNode.tagName==="BLOCKQUOTE"&&F.parentNode.firstChild==F&&E==0){t.formatter.toggle("blockquote",null,F.parentNode);s.setStart(F,0);s.setEnd(F,0);t.selection.setRng(s);t.selection.collapse(false)}});B.onReset.add(function(){B.setContent(B.startContent,{format:"raw"})});if(C.custom_shortcuts){if(C.custom_undo_redo_keyboard_shortcuts){B.addShortcut("ctrl+z",B.getLang("undo_desc"),"Undo");B.addShortcut("ctrl+y",B.getLang("redo_desc"),"Redo")}B.addShortcut("ctrl+b",B.getLang("bold_desc"),"Bold");B.addShortcut("ctrl+i",B.getLang("italic_desc"),"Italic");B.addShortcut("ctrl+u",B.getLang("underline_desc"),"Underline");for(u=1;u<=6;u++){B.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}B.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);B.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);B.addShortcut("ctrl+9","",["FormatBlock",false,"address"]);function x(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(B.shortcuts,function(D){if(n.isMac&&D.ctrl!=t.metaKey){return}else{if(!n.isMac&&D.ctrl!=t.ctrlKey){return}}if(D.alt!=t.altKey){return}if(D.shift!=t.shiftKey){return}if(t.keyCode==D.keyCode||(t.charCode&&t.charCode==D.charCode)){s=D;return false}});return s}B.onKeyUp.add(function(s,t){var D=x(t);if(D){return k.cancel(t)}});B.onKeyPress.add(function(s,t){var D=x(t);if(D){return k.cancel(t)}});B.onKeyDown.add(function(s,t){var D=x(t);if(D){D.func.call(D.scope);return k.cancel(t)}})}if(n.isIE){r.bind(B.getDoc(),"controlselect",function(D){var t=B.resizeInfo,s;D=D.target;if(D.nodeName!=="IMG"){return}if(t){r.unbind(t.node,t.ev,t.cb)}if(!r.hasClass(D,"mceItemNoResize")){ev="resizeend";s=r.bind(D,ev,function(F){var E;F=F.target;if(E=r.getStyle(F,"width")){r.setAttrib(F,"width",E.replace(/[^0-9%]+/g,""));r.setStyle(F,"width","")}if(E=r.getStyle(F,"height")){r.setAttrib(F,"height",E.replace(/[^0-9%]+/g,""));r.setStyle(F,"height","")}})}else{ev="resizestart";s=r.bind(D,"resizestart",k.cancel,k)}t=B.resizeInfo={node:D,ev:ev,cb:s}})}if(n.isOpera){B.onClick.add(function(s,t){k.prevent(t)})}if(C.custom_undo_redo){function A(){B.undoManager.typing=false;B.undoManager.add()}var z=n.isGecko?"blur":"focusout";r.bind(B.getDoc(),z,function(s){if(!B.removed&&B.undoManager.typing){A()}});B.dom.bind(B.dom.getRoot(),"dragend",function(s){A()});B.onKeyUp.add(function(s,D){var t=D.keyCode;if((t>=33&&t<=36)||(t>=37&&t<=40)||t==13||t==45||D.ctrlKey){A()}});B.onKeyDown.add(function(s,E){var D=E.keyCode,t;if(D==8){t=B.getDoc().selection;if(t&&t.createRange&&t.createRange().item){B.undoManager.beforeChange();s.dom.remove(t.createRange().item(0));A();return k.cancel(E)}}if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45){if(n.isIE&&D==13){B.undoManager.beforeChange()}if(B.undoManager.typing){A()}return}if((D<16||D>20)&&D!=224&&D!=91&&!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.typing=true;B.undoManager.add()}});B.onMouseDown.add(function(){if(B.undoManager.typing){A()}})}},_refreshContentEditable:function(){var r=this,q,s;if(r._isHidden()){q=r.getBody();s=q.parentNode;s.removeChild(q);s.appendChild(q);q.focus()}},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return b}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return b}function u(v,x){x=x||"exec";d(v,function(z,y){d(y.toLowerCase().split(","),function(A){j[x][A]=z})})}c.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===e){x=b}if(v===e){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:e)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);d("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=c.explode(k.font_size_style_values);v=c.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return b}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new c.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[p.getNode()]:p.getSelectedBlocks();var y=c.map(v,function(A){return !!q.matchNode(A,x)});return c.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");if(k.custom_undo_redo){u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(f){var d,e=0,h=[],c;function g(){return b.trim(f.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}return d={typing:false,onAdd:new a(d),onUndo:new a(d),onRedo:new a(d),beforeChange:function(){c=f.selection.getBookmark(2,true)},add:function(m){var j,k=f.settings,l;m=m||{};m.content=g();l=h[e];if(l&&l.content==m.content){return null}if(h[e]){h[e].beforeBookmark=c}if(k.custom_undo_redo_levels){if(h.length>k.custom_undo_redo_levels){for(j=0;j0){k=h[--e];f.setContent(k.content,{format:"raw"});f.selection.moveToBookmark(k.beforeBookmark);d.onUndo.dispatch(d,k)}return k},redo:function(){var i;if(e0||this.typing},hasRedo:function(){return e0){g.moveEnd("character",p)}g.select()}catch(n){}}c.nodeChanged()}c.onKeyUp.add(f);c.onClick.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(W){var N={},Q=a.each,c=W.dom,q=W.selection,t=a.dom.TreeWalker,L=new a.dom.RangeUtils(c),d=W.schema.isValidChild,G=c.isBlock,l=W.settings.forced_root_block,s=c.nodeIndex,F=a.isGecko?"\u200B":"\uFEFF",e=/^(src|href|style)$/,T=false,C=true,p;function x(Y){var X=Y.getAttribute("data-mce-contenteditable");if(X&&X!=="inherit"){return X}return Y.contentEditable!=="inherit"?Y.contentEditable:null}function A(X){return X instanceof Array}function m(Y,X){return c.getParents(Y,X,c.getRoot())}function b(X){return X.nodeType===1&&X.id==="_mce_caret"}function S(X){return X?N[X]:N}function k(X,Y){if(X){if(typeof(X)!=="string"){Q(X,function(aa,Z){k(Z,aa)})}else{Y=Y.length?Y:[Y];Q(Y,function(Z){if(Z.deep===p){Z.deep=!Z.selector}if(Z.split===p){Z.split=!Z.selector||Z.inline}if(Z.remove===p&&Z.selector&&!Z.inline){Z.remove="none"}if(Z.selector&&Z.inline){Z.mixed=true;Z.block_expand=true}if(typeof(Z.classes)==="string"){Z.classes=Z.classes.split(/\s+/)}});N[X]=Y}}}var i=function(Y){var X;W.dom.getParent(Y,function(Z){X=W.dom.getStyle(Z,"text-decoration");return X&&X!=="none"});return X};var J=function(X){var Y;if(X.nodeType===1&&X.parentNode&&X.parentNode.nodeType===1){Y=i(X.parentNode);if(W.dom.getStyle(X,"color")&&Y){W.dom.setStyle(X,"text-decoration",Y)}else{if(W.dom.getStyle(X,"textdecoration")===Y){W.dom.setStyle(X,"text-decoration",null)}}}};function U(aa,ah,ac){var ad=S(aa),ai=ad[0],ag,Y,af,ae=q.isCollapsed();function X(am,al){al=al||ai;if(am){if(al.onformat){al.onformat(am,al,ah,ac)}Q(al.styles,function(ao,an){c.setStyle(am,an,r(ao,ah))});Q(al.attributes,function(ao,an){c.setAttrib(am,an,r(ao,ah))});Q(al.classes,function(an){an=r(an,ah);if(!c.hasClass(am,an)){c.addClass(am,an)}})}}function ab(){function an(au,ar){var at=new t(ar);for(ac=at.current();ac;ac=at.prev()){if(ac.childNodes.length>1||ac==au){return ac}}}var am=W.selection.getRng();var aq=am.startContainer;var al=am.endContainer;if(aq!=al&&am.endOffset==0){var ap=an(aq,al);var ao=ap.nodeType==3?ap.length:ap.childNodes.length;am.setEnd(ap,ao)}return am}function Z(ao,au,ar,aq,am){var al=[],an=-1,at,aw=-1,ap=-1,av;Q(ao.childNodes,function(ay,ax){if(ay.nodeName==="UL"||ay.nodeName==="OL"){an=ax;at=ay;return false}});Q(ao.childNodes,function(ay,ax){if(ay.nodeName==="SPAN"&&c.getAttrib(ay,"data-mce-type")=="bookmark"){if(ay.id==au.id+"_start"){aw=ax}else{if(ay.id==au.id+"_end"){ap=ax}}}});if(an<=0||(awan)){Q(a.grep(ao.childNodes),am);return 0}else{av=c.clone(ar,T);Q(a.grep(ao.childNodes),function(ay,ax){if((awan&&ax>an)){al.push(ay);ay.parentNode.removeChild(ay)}});if(awan){ao.insertBefore(av,at.nextSibling)}}aq.push(av);Q(al,function(ax){av.appendChild(ax)});return av}}function aj(am,ao,ar){var al=[],aq,an,ap=true;aq=ai.inline||ai.block;an=c.create(aq);X(an);L.walk(am,function(at){var au;function av(aw){var aB,az,ax,ay,aA;aA=ap;aB=aw.nodeName.toLowerCase();az=aw.parentNode.nodeName.toLowerCase();if(aw.nodeType===1&&x(aw)){aA=ap;ap=x(aw)==="true";ay=true}if(g(aB,"br")){au=0;if(ai.block){c.remove(aw)}return}if(ai.wrapper&&y(aw,aa,ah)){au=0;return}if(ap&&!ay&&ai.block&&!ai.wrapper&&H(aB)){aw=c.rename(aw,aq);X(aw);al.push(aw);au=0;return}if(ai.selector){Q(ad,function(aC){if("collapsed" in aC&&aC.collapsed!==ae){return}if(c.is(aw,aC.selector)&&!b(aw)){X(aw,aC);ax=true}});if(!ai.inline||ax){au=0;return}}if(ap&&!ay&&d(aq,aB)&&d(az,aq)&&!(!ar&&aw.nodeType===3&&aw.nodeValue.length===1&&aw.nodeValue.charCodeAt(0)===65279)&&!b(aw)){if(!au){au=c.clone(an,T);aw.parentNode.insertBefore(au,aw);al.push(au)}au.appendChild(aw)}else{if(aB=="li"&&ao){au=Z(aw,ao,an,al,av)}else{au=0;Q(a.grep(aw.childNodes),av);if(ay){ap=aA}au=0}}}Q(at,av)});if(ai.wrap_links===false){Q(al,function(at){function au(ay){var ax,aw,av;if(ay.nodeName==="A"){aw=c.clone(an,T);al.push(aw);av=a.grep(ay.childNodes);for(ax=0;ax1||!G(av))&&at===0){c.remove(av,1);return}if(ai.inline||ai.wrapper){if(!ai.exact&&at===1){av=au(av)}Q(ad,function(ax){Q(c.select(ax.inline,av),function(az){var ay;if(ax.wrap_links===false){ay=az.parentNode;do{if(ay.nodeName==="A"){return}}while(ay=ay.parentNode)}V(ax,ah,az,ax.exact?az:null)})});if(y(av.parentNode,aa,ah)){c.remove(av,1);av=0;return C}if(ai.merge_with_parents){c.getParent(av.parentNode,function(ax){if(y(ax,aa,ah)){c.remove(av,1);av=0;return C}})}if(av&&ai.merge_siblings!==false){av=u(D(av),av);av=u(av,D(av,C))}}})}if(ai){if(ac){if(ac.nodeType){Y=c.createRng();Y.setStartBefore(ac);Y.setEndAfter(ac);aj(o(Y,ad),null,true)}else{aj(ac,null,true)}}else{if(!ae||!ai.inline||c.select("td.mceSelected,th.mceSelected").length){var ak=W.selection.getNode();if(!l&&ad[0].defaultBlock&&!c.getParent(ak,c.isBlock)){U(ad[0].defaultBlock)}W.selection.setRng(ab());ag=q.getBookmark();aj(o(q.getRng(C),ad),ag);if(ai.styles&&(ai.styles.color||ai.styles.textDecoration)){a.walk(ak,J,"childNodes");J(ak)}q.moveToBookmark(ag);O(q.getRng(C));W.nodeChanged()}else{R("apply",aa,ah)}}}}function B(Z,ai,ab){var ac=S(Z),ak=ac[0],ag,af,Y,ah=true;function aa(aq){var ap,ao,an,am,at,ar;if(aq.nodeType===1&&x(aq)){at=ah;ah=x(aq)==="true";ar=true}ap=a.grep(aq.childNodes);if(ah&&!ar){for(ao=0,an=ac.length;ao=0;Y--){X=ad[Y].selector;if(!X){return C}for(ac=Z.length-1;ac>=0;ac--){if(c.is(Z[ac],X)){return C}}}}return T}a.extend(this,{get:S,register:k,apply:U,remove:B,toggle:E,match:j,matchAll:v,matchNode:y,canApply:z});function h(X,Y){if(g(X,Y.inline)){return C}if(g(X,Y.block)){return C}if(Y.selector){return c.is(X,Y.selector)}}function g(Y,X){Y=Y||"";X=X||"";Y=""+(Y.nodeName||Y);X=""+(X.nodeName||X);return Y.toLowerCase()==X.toLowerCase()}function M(Y,X){var Z=c.getStyle(Y,X);if(X=="color"||X=="backgroundColor"){Z=c.toHex(Z)}if(X=="fontWeight"&&Z==700){Z="bold"}return""+Z}function r(X,Y){if(typeof(X)!="string"){X=X(Y)}else{if(Y){X=X.replace(/%(\w+)/g,function(aa,Z){return Y[Z]||aa})}}return X}function f(X){return X&&X.nodeType===3&&/^([\t \r\n]+|)$/.test(X.nodeValue)}function P(Z,Y,X){var aa=c.create(Y,X);Z.parentNode.insertBefore(aa,Z);aa.appendChild(Z);return aa}function o(X,ai,aa){var al,aj,ad,Z=X.startContainer,ae=X.startOffset,an=X.endContainer,ag=X.endOffset,al,aj,ad,ah;function ak(au){var ao,ar,at,aq,ap;ao=ar=au?Z:an;ap=au?"previousSibling":"nextSibling";root=c.getRoot();if(ao.nodeType==3&&!f(ao)){if(au?ae>0:agaj?aj:ae];if(Z.nodeType==3){ae=0}}if(an.nodeType==1&&an.hasChildNodes()){aj=an.childNodes.length-1;an=an.childNodes[ag>aj?aj:ag-1];if(an.nodeType==3){ag=an.nodeValue.length}}function am(ap){var ao=ap;while(ao){if(ao.nodeType===1&&x(ao)){return x(ao)==="false"?ao:ap}ao=ao.parentNode}return ap}Z=am(Z);an=am(an);if(I(Z.parentNode)||I(Z)){Z=I(Z)?Z:Z.parentNode;Z=Z.nextSibling||Z;if(Z.nodeType==3){ae=0}}if(I(an.parentNode)||I(an)){an=I(an)?an:an.parentNode;an=an.previousSibling||an;if(an.nodeType==3){ag=an.length}}if(ai[0].inline){if(X.collapsed){function af(ap,au,aw){var at,aq,av,ao;function ar(ay,aA){var aB,ax,az=ay.nodeValue;if(typeof(aA)=="undefined"){aA=aw?az.length:0}if(aw){aB=az.lastIndexOf(" ",aA);ax=az.lastIndexOf("\u00a0",aA);aB=aB>ax?aB:ax;if(aB!==-1&&!aa){aB++}}else{aB=az.indexOf(" ",aA);ax=az.indexOf("\u00a0",aA);aB=aB!==-1&&(ax===-1||aB0&&ad.node.nodeType===3&&ad.node.nodeValue.charAt(ad.offset-1)===" "){if(ad.offset>1){an=ad.node;an.splitText(ad.offset-1)}else{if(ad.node.previousSibling){}}}}}if(ai[0].inline||ai[0].block_expand){if(!ai[0].inline||(Z.nodeType!=3||ae===0)){Z=ak(true)}if(!ai[0].inline||(an.nodeType!=3||ag===an.nodeValue.length)){an=ak()}}if(ai[0].selector&&ai[0].expand!==T&&!ai[0].inline){function ab(ap,ao){var aq,ar,au,at;if(ap.nodeType==3&&ap.nodeValue.length==0&&ap[ao]){ap=ap[ao]}aq=m(ap);for(ar=0;arZ?Z:ab]}if(X.nodeType===3&&ac&&ab>=X.nodeValue.length){X=new t(X,W.getBody()).next()||X}if(X.nodeType===3&&!ac&&ab==0){X=new t(X,W.getBody()).prev()||X}return X}function R(ag,X,ae){var ah="_mce_caret",Y=W.settings.caret_debug;function Z(ak){var aj=c.create("span",{id:ah,"data-mce-bogus":true,style:Y?"color:red":""});if(ak){aj.appendChild(W.getDoc().createTextNode(F))}return aj}function af(ak,aj){while(ak){if((ak.nodeType===3&&ak.nodeValue!==F)||ak.childNodes.length>1){return false}if(aj&&ak.nodeType===1){aj.push(ak)}ak=ak.firstChild}return true}function ac(aj){while(aj){if(aj.id===ah){return aj}aj=aj.parentNode}}function ab(aj){var ak;if(aj){ak=new t(aj,aj);for(aj=ak.current();aj;aj=ak.next()){if(aj.nodeType===3){return aj}}}}function aa(al,ak){var am,aj;if(!al){al=ac(q.getStart());if(!al){while(al=c.get(ah)){aa(al,false)}}}else{aj=q.getRng(true);if(af(al)){if(ak!==false){aj.setStartBefore(al);aj.setEndBefore(al)}c.remove(al)}else{am=ab(al);if(am.nodeValue.charAt(0)===F){am=am.deleteData(0,1)}c.remove(al,1)}q.setRng(aj)}}function ad(){var al,aj,ap,ao,am,ak,an;al=q.getRng(true);ao=al.startOffset;ak=al.startContainer;an=ak.nodeValue;aj=ac(q.getStart());if(aj){ap=ab(aj)}if(an&&ao>0&&ao=0;an--){al.appendChild(c.clone(ar[an],false));al=al.firstChild}al.appendChild(c.doc.createTextNode(F));al=al.firstChild;c.insertAfter(aq,at);q.setCursorLocation(al,1)}}if(!self._hasCaretEvents){W.onBeforeGetContent.addToTop(function(){var aj=[],ak;if(af(ac(q.getStart()),aj)){ak=aj.length;while(ak--){c.setAttrib(aj[ak],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(aj){W[aj].addToTop(function(){aa()})});W.onKeyDown.addToTop(function(aj,al){var ak=al.keyCode;if(ak==8||ak==37||ak==39){aa(ac(q.getStart()))}});self._hasCaretEvents=true}if(ag=="apply"){ad()}else{ai()}}function O(Y){var X=Y.startContainer,ad=Y.startOffset,ac,ab,Z,aa;if(X.nodeType==3&&ad>=X.nodeValue.length){X=X.parentNode;ad=s(X)+1}if(X.nodeType==1){Z=X.childNodes;X=Z[Math.min(ad,Z.length-1)];ac=new t(X,c.getParent(X,c.isBlock));if(ad>Z.length-1){ac.next()}for(ab=ac.current();ab;ab=ac.next()){if(ab.nodeType==3&&!f(ab)){aa=c.create("a",null,F);ab.parentNode.insertBefore(aa,ab);Y.setStart(ab,0);q.setRng(Y);c.remove(aa);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_legacy_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(x){var t=d.getRng(true),A,v,s,n,m,i,k,r,C,u;function z(E){return E&&h.isBlock(E)&&!/^(TD|TH|CAPTION)$/.test(E.nodeName)&&!/^(fixed|absolute)/i.test(E.style.position)}function l(F){var J,H,E,K,I,G=F;E=h.createRng();if(F.hasChildNodes()){J=new a(F,F);while(H=J.current()){if(H.nodeType==3){E.setStart(H,0);E.setEnd(H,0);break}if(/^(BR|IMG)$/.test(H.nodeName)){E.setStartBefore(H);E.setEndBefore(H);break}G=H;H=J.next()}if(!H){E.setStart(G,0);E.setEnd(G,0)}}else{if(F.nodeName=="BR"){E.setStartAfter(F);E.setEndAfter(F)}else{E.setStart(F,0);E.setEnd(F,0)}}d.setRng(E);I=h.getViewPort(e.getWin());K=h.getPos(F).y;if(KI.y+I.h){e.getWin().scrollTo(0,K"}return I}function o(G){var F,E;if(v.nodeType==3&&(G?s>0:s=v.nodeValue.length){if(!b.isIE&&!y()){G=h.create("br");t.insertNode(G);t.setStartAfter(G);t.setEndAfter(G);F=true}}G=h.create("br");t.insertNode(G);E=h.doc.documentMode;if(b.isIE&&r=="PRE"&&(!E||E<8)){G.parentNode.insertBefore(h.doc.createTextNode("\r"),G)}if(!F){t.setStartAfter(G);t.setEndAfter(G)}else{t.setStartBefore(G);t.setEndBefore(G)}d.setRng(t);g.add()}function q(E){do{if(E.nodeType===3){E.nodeValue=E.nodeValue.replace(/^[\r\n]+/,"")}E=E.firstChild}while(E)}if(!t.collapsed){e.execCommand("Delete");return}if(x.isDefaultPrevented()){return}v=t.startContainer;s=t.startOffset;u=c.forced_root_block;u=u?u.toUpperCase():"";if(v.nodeType==1&&v.hasChildNodes()){v=v.childNodes[Math.min(s,v.childNodes.length-1)]||v;s=0}g.beforeChange();v=j(v,s);n=h.getParent(v,h.isBlock);k=n?h.getParent(n.parentNode,h.isBlock):null;r=n?n.nodeName.toUpperCase():"";C=k?k.nodeName.toUpperCase():"";if(r=="LI"&&h.isEmpty(n)){if(/^(UL|OL|LI)$/.test(k.parentNode.nodeName)){return false}B();return}if(r=="PRE"&&c.br_in_pre!==false){if(!x.shiftKey){D();return}}else{if((!u&&!x.shiftKey&&r!="LI")||(u&&x.shiftKey)){D();return}}u=u||"P";if(o()){if(/^(H[1-6]|PRE)$/.test(r)&&C!="HGROUP"){m=p(u)}else{m=p()}if(c.end_container_on_empty_block&&z(k)&&h.isEmpty(n)){m=h.split(k,n)}else{h.insertAfter(m,n)}}else{if(o(true)){m=n.parentNode.insertBefore(p(),n)}else{A=t.cloneRange();A.setEndAfter(n);i=A.extractContents();q(i);m=i.firstChild;h.insertAfter(i,n)}}h.setAttrib(m,"id","");l(m);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/static/grappelli_orig/tinymce/jscripts/tiny_mce/tiny_mce_popup.js b/static/grappelli_orig/tinymce/jscripts/tiny_mce/tiny_mce_popup.js new file mode 100644 index 00000000..4d9ffc03 --- /dev/null +++ b/static/grappelli_orig/tinymce/jscripts/tiny_mce/tiny_mce_popup.js @@ -0,0 +1,5 @@ + +// Uncomment and change this document.domain value if you are loading the script cross subdomains +// document.domain = 'moxiecode.com'; + +var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(' + {% include 'autocomplete_light/static.html' %} +{% endblock %} diff --git a/templates/bda/inscription-bda.html.save b/templates/bda/inscription-bda.html.save new file mode 100644 index 00000000..c387943f --- /dev/null +++ b/templates/bda/inscription-bda.html.save @@ -0,0 +1,116 @@ +{% extends "base_title.html" %} + +{% block extra_head %} + + + + + +{% endblock %} + +{% block realcontent %} + + +

                  Inscription au tirage au sort du BDA

                  + {% if success %} +

                  Votre inscription a été mise à jour avec succès !

                  + {% endif %} +
                  + {% csrf_token %} + {% include "inscription-formset.html" %} + + + + Prix total actuel : {{ total_price }}€ +
                  +

                  + 1: demander deux places pour ce spectacle
                  + 2: abandonner une place si impossible d'en obtenir une seconde pour ce spectacle (si vous avez coché l'option Deux places pour ce spectacle)
                  + 3: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu
                  +

                  +
                  +{% endblock %} diff --git a/templates/bda/inscription-bda2.html b/templates/bda/inscription-bda2.html new file mode 100644 index 00000000..91b08b93 --- /dev/null +++ b/templates/bda/inscription-bda2.html @@ -0,0 +1,120 @@ +{% extends "base_title.html" %} + +{% block extra_head %} + + + + + +{% endblock %} + +{% block realcontent %} + + +

                  Inscription au tirage au sort du BdA

                  + {% if success %} +

                  Votre inscription a été mise à jour avec succès !

                  + {% endif %} + {% if stateerror %} +

                  Impossible d'enregistrer vos modifications: vous avez apporté d'autres modifications entre temps

                  + {% endif %} +
                  + {% csrf_token %} + {% include "inscription-formset.html" %} + + + + + Prix total actuel : {{ total_price }}€ +
                  +

                  + 1: demander deux places pour ce spectable
                  + 2: abandonner une place si impossible d'en obtenir une seconde pour ce spectacle (si vous avez coché l'option Deux places pour ce spectacle)
                  + 3: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu
                  +

                  +
                  +{% endblock %} diff --git a/templates/bda/inscription-bda3.html b/templates/bda/inscription-bda3.html new file mode 100644 index 00000000..bf77bac8 --- /dev/null +++ b/templates/bda/inscription-bda3.html @@ -0,0 +1,120 @@ +{% extends "base_title.html" %} + +{% block extra_head %} + + + + + +{% endblock %} + +{% block realcontent %} + + +

                  Inscription au tirage au sort du BdA

                  + {% if success %} +

                  Votre inscription a été mise à jour avec succès !

                  + {% endif %} + {% if stateerror %} +

                  Impossible d'enregistrer vos modifications: vous avez apporté d'autres modifications entre temps

                  + {% endif %} +
                  + {% csrf_token %} + {% include "inscription-formset.html" %} + + + + + Prix total actuel : {{ total_price }}€ +
                  +

                  + 1: demander deux places pour ce spectable
                  + 2: abandonner une place si impossible d'en obtenir une seconde pour ce spectacle (si vous avez coché l'option Deux places pour ce spectacle)
                  + 3: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu
                  +

                  +
                  +{% endblock %} diff --git a/templates/bda/liste_spectacles.ics b/templates/bda/liste_spectacles.ics new file mode 100644 index 00000000..1ce599f3 --- /dev/null +++ b/templates/bda/liste_spectacles.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//GESTIOCOF/bda//EN +{% for spectacle in spectacles %}BEGIN:VEVENT +DTSTART;TZID=Europe/Paris:{{ spectacle.date|date:'Ymd\\THis' }} +DTEND;TZID=Europe/Paris:{{ spectacle.dtend|date:'Ymd\\THis' }} +SUMMARY:{{ spectacle.title|safe }} +LOCATION:{{ spectacle.location.name|safe }} +END:VEVENT +{% endfor %}END:VCALENDAR \ No newline at end of file diff --git a/templates/bda/resume_inscription.html b/templates/bda/resume_inscription.html new file mode 100644 index 00000000..2e0531ca --- /dev/null +++ b/templates/bda/resume_inscription.html @@ -0,0 +1,16 @@ +{% extends "base_title.html" %} + +{% block realcontent %} +

                  {{ error_title }}

                  +

                  {{ error_description }}

                  + {% if choices %} +

                  Vos vœux:

                  +
                    + {% for choice in choices %} +
                  1. {{ choice.spectacle }}{% if choice.double %} (deux places{% if autoquit %}, abandon automatique{% endif %}){% endif %}
                  2. + {% endfor %} +
                  + {% else %} +

                  Vous n'avez enregistré aucun vœu pour le tirage au sort

                  + {% endif %} +{% endblock %} diff --git a/templates/bda/resume_places.html b/templates/bda/resume_places.html new file mode 100644 index 00000000..4d9a8294 --- /dev/null +++ b/templates/bda/resume_places.html @@ -0,0 +1,19 @@ +{% extends "base_title.html" %} + +{% block realcontent %} +

                  Places attribuées

                  + {% if warning %} +

                  Attention, vous avez reçu plusieurs places pour des spectacles différents à la même date !

                  + {% endif %} + {% if places %} +
                    + {% for place in places %} +
                  1. {{ place.spectacle }}{% if place.double %} (deux places){% endif %}
                  2. + {% endfor %} +
                  +

                  Total à payer : {{ total|floatformat }}€

                  +

                  Exporter au format calendrier (.ics, compatible avec tous les logiciels d'agenda)

                  + {% else %} +

                  Vous n'avez aucune place :(

                  + {% endif %} +{% endblock %} diff --git a/templates/bda/resume_places.ics b/templates/bda/resume_places.ics new file mode 100644 index 00000000..72aa4347 --- /dev/null +++ b/templates/bda/resume_places.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//GESTIOCOF/bda//EN +{% for place in places %}BEGIN:VEVENT +DTSTART;TZID=Europe/Paris:{{ place.spectacle.date|date:'Ymd\\THis' }} +DTEND;TZID=Europe/Paris:{{ place.spectacle.dtend|date:'Ymd\\THis' }} +SUMMARY:{{ place.spectacle.title|safe }}{% if place.double %} (deux places){% endif %} +LOCATION:{{ place.spectacle.location.name|safe }} +END:VEVENT +{% endfor %}END:VCALENDAR \ No newline at end of file diff --git a/templates/bda3/spectacle_list.html b/templates/bda3/spectacle_list.html new file mode 100644 index 00000000..a4a67998 --- /dev/null +++ b/templates/bda3/spectacle_list.html @@ -0,0 +1,11 @@ +{% extends "base_title.html" %} + +{% block realcontent %} +

                  Spectacles

                  + +{% endblock %} diff --git a/templates/gestioncof/admin/index.html b/templates/gestioncof/admin/index.html new file mode 100644 index 00000000..965c71fa --- /dev/null +++ b/templates/gestioncof/admin/index.html @@ -0,0 +1,78 @@ +{% extends "admin/base_site.html" %} + + +{% load i18n grp_tags log %} + + +{% block javascripts %} + {{ block.super }} +{% endblock %} + + +{% block breadcrumbs %} +
                    +
                  • {% trans "Home" %}
                  • +
                  +{% endblock %} +{% block content_title %} + {% if title %} +

                  {{ title }}

                  + {% endif %} +{% endblock %} + + +{% block content %} +
                  +
                  + + {% for app in app_list %} +
                  +

                  {% trans app.name %}

                  + {% for model in app.models %} +
                  + {% if model.perms.change %}{{ model.name }}{% else %}{{ model.name }}{% endif %} + {% if model.perms.add or model.perms.change %} + + {% endif %} +
                  + {% endfor %} +
                  + {% empty %} +

                  {% trans "You don´t have permission to edit anything." %}

                  + {% endfor %} +
                  +
                  +
                  +

                  {% trans 'Recent Actions' %}

                  +
                  +

                  {% trans 'My Actions' %}

                  + {% get_admin_log 20 as admin_log for_user user %} + {% if not admin_log %} +

                  {% trans 'None available' %}

                  + {% else %} +
                    + {% for entry in admin_log %} +
                  • + {% if entry.is_deletion %} + {{ entry.object_repr }} + {% else %} + {{ entry.object_repr }} + {% endif %} + {% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %} +
                  • + {% endfor %} +
                  + {% endif %} +
                  +
                  +
                  +
                  +{% endblock %} + diff --git a/templates/gestioncof/base_title_petitscours.html b/templates/gestioncof/base_title_petitscours.html new file mode 100644 index 00000000..2c15ae6f --- /dev/null +++ b/templates/gestioncof/base_title_petitscours.html @@ -0,0 +1,3 @@ +{% extends "base_title.html" %} + +{% block title %}{{ site.name }}: Gestion des petits cours{% endblock %} diff --git a/templates/gestioncof/cof-denied.html b/templates/gestioncof/cof-denied.html new file mode 100644 index 00000000..b2a12717 --- /dev/null +++ b/templates/gestioncof/cof-denied.html @@ -0,0 +1,5 @@ +{% extends "base_title.html" %} + +{% block realcontent %} +

                  Section réservée aux membres du COF -- merci de vous inscrire au COF ou de passer au COF/nous envoyer un mail si vous êtes déjà membre :)

                  +{% endblock %} diff --git a/templates/gestioncof/demande-petit-cours-raw.html b/templates/gestioncof/demande-petit-cours-raw.html new file mode 100644 index 00000000..c2fcf85a --- /dev/null +++ b/templates/gestioncof/demande-petit-cours-raw.html @@ -0,0 +1,11 @@ +{% if success %} +

                  Votre demande a été enregistrée avec succès !

                  +{% else %} +
                  + {% csrf_token %} + + {{ form.as_table }} +
                  + +
                  +{% endif %} diff --git a/templates/gestioncof/details_demande_petit_cours.html b/templates/gestioncof/details_demande_petit_cours.html new file mode 100644 index 00000000..b30e3187 --- /dev/null +++ b/templates/gestioncof/details_demande_petit_cours.html @@ -0,0 +1,35 @@ +{% extends "base_title_petitscours.html" %} + +{% block realcontent %} +

                  Demande de petits cours

                  + {% include "details_demande_petit_cours_infos.html" %} +
                  +
                    +
                  • Traitée:
                  • + {% if demande.traitee %} +
                  • Traitée par: {{ demande.traitee_par }}
                  • +
                  • Traitée le: {{ demande.processed }}
                  • +
                  • + Attributions: +
                      + {% for attrib in attributions %} +
                    • {{ attrib.user.get_full_name }} pour {{ attrib.matiere }}, {{ attrib.date|date:"d E Y" }}
                    • + {% endfor %} +
                    +
                  • + {% endif %} +
                  + {% if demande.traitee %} +
                  +
                  + +
                  +
                  + {% else %} +
                  +
                  + +
                  +
                  + {% endif %} +{% endblock %} diff --git a/templates/gestioncof/details_demande_petit_cours_infos.html b/templates/gestioncof/details_demande_petit_cours_infos.html new file mode 100644 index 00000000..90a62f8b --- /dev/null +++ b/templates/gestioncof/details_demande_petit_cours_infos.html @@ -0,0 +1,13 @@ +
                    +
                  • Date: {{ demande.created }}
                  • +
                  • Nom/prénom: {{ demande.name }}
                  • +
                  • Email: {{ demande.email }}
                  • +
                  • Téléphone: {{ demande.phone }}
                  • +
                  • Lieu: {{ demande.lieu }}
                  • +
                  • Quand: {{ demande.quand }}
                  • +
                  • Fréquence: {{ demande.freq }}
                  • +
                  • Matières: {% for matiere in demande.matieres.all %}{% if forloop.counter0 > 0 %}, {% endif %}{{ matiere }}{% endfor %}
                  • +
                  • Niveau souhaité: {{ demande.get_niveau_display }}
                  • +
                  • Agrégé requis:
                  • +
                  • Remarques: {{ demande.remarques }}
                  • +
                  diff --git a/templates/gestioncof/event_status.html b/templates/gestioncof/event_status.html index 29d2bf67..fa0e6be3 100644 --- a/templates/gestioncof/event_status.html +++ b/templates/gestioncof/event_status.html @@ -20,7 +20,6 @@ {% for choice in option.choices.all %}
                • {{ choice.value }} : {{ choices_count|key:choice.id }}
                • {% endfor %} -
                • Total : {{ total }}
                • {% endfor %}

                  Réponses individuelles

                  diff --git a/templates/gestioncof/home.html b/templates/gestioncof/home.html index 34baca69..f83233fe 100644 --- a/templates/gestioncof/home.html +++ b/templates/gestioncof/home.html @@ -31,22 +31,22 @@
                • Mes places du premier tirage
                • Revendre une place du premier tirage

                • -
                • Mes places du deuxième tirage
                • Revendre une place du deuxième tirage

                • Troisième tirage -
                • Inscription au troisième tirage au sort du BdA
                • -
                • État des demandes
                • +
                • Mes places du troisième tirage
                • Revendre une place du troisième tirage

                • - --> + {% endif %}

                  Divers

                  diff --git a/templates/gestioncof/inscription-petit-cours-formset.html b/templates/gestioncof/inscription-petit-cours-formset.html new file mode 100644 index 00000000..3ce7a40c --- /dev/null +++ b/templates/gestioncof/inscription-petit-cours-formset.html @@ -0,0 +1,40 @@ +{{ formset.non_form_errors.as_ul }} + +{{ formset.management_form }} +{% for form in formset.forms %} + {% if forloop.first %} + + {% for field in form.visible_fields %} + + {% endfor %} + + + {% endif %} + + {% for field in form.visible_fields %} + {% if field.name != "DELETE" and field.name != "priority" %} + + {% endif %} + {% endfor %} + + +{% endfor %} + +
                  + {% if field.name != "DELETE" %} + {{ field.label|safe|capfirst }} + {% endif %} + {{ forloop.counter }} +
                  + {% if forloop.first %} + {{ form.non_field_errors }} + {% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %} + {% endif %} + {{ field.errors.as_ul }} + {{ field }} +
                  + + +
                  +
                  +
                  diff --git a/templates/gestioncof/liste_mails.html b/templates/gestioncof/liste_mails.html new file mode 100644 index 00000000..2cc7e150 --- /dev/null +++ b/templates/gestioncof/liste_mails.html @@ -0,0 +1,7 @@ +{% extends "base_title.html" %} + +{% block realcontent %} +

                  {{ titre }}

                  + +{% endblock %} diff --git a/templates/gestioncof/petits-cours-mail-demandeur.txt b/templates/gestioncof/petits-cours-mail-demandeur.txt new file mode 100644 index 00000000..8c20834e --- /dev/null +++ b/templates/gestioncof/petits-cours-mail-demandeur.txt @@ -0,0 +1,17 @@ +Bonjour, + +Je vous contacte au sujet de votre annonce passée sur le site du COF pour rentrer en contact avec un élève normalien pour des cours particuliers. Voici les coordonnées d'élèves qui sont motivés par de tels cours et correspondent aux critères que vous nous aviez transmis : + +{% for matiere, proposed in proposals %}¤ {{ matiere }} :{% for user in proposed %} + ¤ {{ user.get_full_name }}{% if user.profile.phone %}, {{ user.profile.phone }}{% endif %}{% if user.email %}, {{ user.email }}{% endif %}{% endfor %} + +{% endfor %}{% if unsatisfied %}Nous n'avons cependant pas pu trouver d'élève disponible pour des cours de {% for matiere in unsatisfied %}{% if forloop.counter0 > 0 %}, {% endif %}{{ matiere }}{% endfor %}. + +{% endif %}Si pour une raison ou une autre ces numéros ne suffisaient pas, n'hésitez pas à répondre à cet e-mail et je vous en ferai parvenir d'autres sans problème. +{% if extra|length > 0 %} +{{ extra|safe }} +{% endif %} +Cordialement, + +-- +Le COF, BdE de l'ENS diff --git a/templates/gestioncof/petits-cours-mail-eleve.txt b/templates/gestioncof/petits-cours-mail-eleve.txt new file mode 100644 index 00000000..f75fb33f --- /dev/null +++ b/templates/gestioncof/petits-cours-mail-eleve.txt @@ -0,0 +1,28 @@ +Salut, + +Le COF a reçu une demande de petit cours qui te correspond. Tu es en haut de la liste d'attente donc on a transmis tes coordonnées, ainsi que celles de 2 autres qui correspondaient aussi (c'est la vie, on donne les numéros 3 par 3 pour que ce soit plus souple). Voici quelques infos sur l'annonce en question : + +¤ Nom : {{ demande.name }} + +¤ Période : {{ demande.quand }} + +¤ Fréquence : {{ demande.freq }} + +¤ Lieu (si préféré) : {{ demande.lieu }} + +¤ Niveau : {{ demande.get_niveau_display }} + +¤ Remarques diverses (désolé pour les balises HTML) : {{ demande.remarques }} + +{% if matieres|length > 1 %}¤ Matières : +{% for matiere in matieres %} ¤ {{ matiere }} +{% endfor %}{% else %}¤ Matière : {% for matiere in matieres %}{{ matiere }} +{% endfor %}{% endif %} +Voilà, cette personne te contactera peut-être sous peu, tu pourras voir les détails directement avec elle (prix, modalités, ...). Pour indication, 30 Euro/h semble être la moyenne. + +Si tu te rends compte qu'en fait tu ne peux pas/plus donner de cours en ce moment, ça serait cool que tu décoches la case "Recevoir des propositions de petits cours" sur GestioCOF. Ensuite dès que tu voudras réapparaître tu pourras recocher la case et tu seras à nouveau sur la liste. + +À bientôt, + +-- +Le COF, pour les petits cours diff --git a/templates/gestioncof/petits_cours_demandes_list.html b/templates/gestioncof/petits_cours_demandes_list.html new file mode 100644 index 00000000..8674f4aa --- /dev/null +++ b/templates/gestioncof/petits_cours_demandes_list.html @@ -0,0 +1,46 @@ +{% extends "base_title_petitscours.html" %} + +{% block realcontent %} +

                  Demandes de petits cours

                  +{% if object_list %} + + + + + + + + + + + {% for demande in object_list %} + + + + + + + + + {% endfor %} + +
                  NomMatièresDateTraitéepar
                  {{ demande.name }}{% for matiere in demande.matieres.all %}{% if forloop.counter0 > 0 %}, {% endif %}{{ matiere }}{% endfor %}{{ demande.created|date:"d E Y" }}{% if demande.traitee_par %}{{ demande.traitee_par.username }}{% else %}{% endif %}Détails
                  + {% if is_paginated %} + + {% endif %} +{% else %} +

                  Aucune demande :(

                  +{% endif %} +{% endblock %} diff --git a/templates/gestioncof/traitement_demande_petit_cours.html b/templates/gestioncof/traitement_demande_petit_cours.html new file mode 100644 index 00000000..eb858faa --- /dev/null +++ b/templates/gestioncof/traitement_demande_petit_cours.html @@ -0,0 +1,45 @@ +{% extends "base_title_petitscours.html" %} + +{% block realcontent %} +

                  Traitement de la demande de petits cours {{ demande.id }}

                  + {% include "details_demande_petit_cours_infos.html" %} +
                  + {% if errors %} +
                  + Attention: +
                    {% for error in errors %}
                  • {{ error }}
                  • {% endfor %}
                  +
                  + {% endif %} + {% if unsatisfied %} +
                  + Attention: Impossible de trouver des propositions pour les matières suivantes: +
                    + {% for matiere in unsatisfied %}
                  • {{ matiere }}
                  • {% endfor %} +
                  +
                  + {% endif %} + {% if proposals %} +
                  + {% csrf_token %} + Propositions: +
                    + {% for proposeduser, matieres in proposed_for %} +
                  • {{ proposeduser }} pour {% for matiere in matieres %}{% if forloop.counter0 > 0 %}, {% endif %}{{ matiere }}{% endfor %}
                  • + {% endfor %} +
                  +

                  Mails pour les membres proposés :

                  + {% for proposeduser, mail in proposed_mails %} +
                  Pour {{ proposeduser }}:
                  +
                  {{ mail }}
                  + {% endfor %} +

                  Mail pour l'auteur de la demande :

                  +
                  {{ mainmail|safe }}
                  + + {% if redo %}{% endif %} + +
                  + {% else %} +

                  Impossible de trouver des propositions pour cette demande

                  +
                  Traitement manuel obligatoire !
                  + {% endif %} +{% endblock %} diff --git a/templates/gestioncof/traitement_demande_petit_cours_autre_niveau.html b/templates/gestioncof/traitement_demande_petit_cours_autre_niveau.html new file mode 100644 index 00000000..5b7967ab --- /dev/null +++ b/templates/gestioncof/traitement_demande_petit_cours_autre_niveau.html @@ -0,0 +1,58 @@ +{% extends "base_title_petitscours.html" %} + +{% block realcontent %} +

                  Traitement de la demande de petits cours {{ demande.id }}

                  + {% include "details_demande_petit_cours_infos.html" %} +
                  +
                  + Attention: demande de petits cours spécifiant le niveau "Autre niveau": choisissez les candidats correspondant aux remarques de la demande. S'il y a moins de 3 candidats adaptés, ne mettre que ceux qui conviennent, pas besoin de faire du bourrage :) +
                  + {% if unsatisfied %} +
                  + Attention: Impossible de trouver des propositions pour les matières suivantes: +
                    + {% for matiere in unsatisfied %}
                  • {{ matiere }}
                  • {% endfor %} +
                  +
                  + {% endif %} + + {% if proposals %} +
                  + {% csrf_token %} + {% for matiere, users in proposals %} +

                  {{ matiere }}

                  + {% for i in "012"|make_list %}{% if i|add:"0" < users|length %} +
                  + Proposition {{ i|add:"1" }}: + +
                  +

                  +
                  + +
                  + {% endif %} + {% endfor %} + {% endfor %} + + {% if redo %}{% endif %} + +
                  + {% else %} +

                  Impossible de trouver des propositions pour cette demande

                  +
                  Traitement manuel obligatoire !
                  + {% endif %} +{% endblock %} diff --git a/templates/gestioncof/traitement_demande_petit_cours_success.html b/templates/gestioncof/traitement_demande_petit_cours_success.html new file mode 100644 index 00000000..4dbbb201 --- /dev/null +++ b/templates/gestioncof/traitement_demande_petit_cours_success.html @@ -0,0 +1,7 @@ +{% extends "base_title_petitscours.html" %} + +{% block realcontent %} +

                  Traitement de la demande de petits cours {{ demande.id }}

                  +
                  Demande {{ demande.id }} de {{ demande.name }} {% if redo %}re{% endif %}traitée avec succès !
                  + Retour à la liste des demandes +{% endblock %} diff --git a/templates/gestioncof/utile_bda.html b/templates/gestioncof/utile_bda.html index 4ef4545a..d2195fa7 100644 --- a/templates/gestioncof/utile_bda.html +++ b/templates/gestioncof/utile_bda.html @@ -5,10 +5,28 @@ {% block realcontent %}

                  Liens utiles du BdA

                  +

                  Listes mail

                  +

                  Premier tirage

                  +
                • Etat des voeux
                • +
                • Mailing list par spectacle
                • +
                • Mailing list des impayés
                • +
                • Calendrier des spectacles (.ics)
                • + +

                  Deuxième tirage

                  + +

                  Troisième tirage

                  + {% endblock %} diff --git a/templates/gestioncof/utile_cof.html b/templates/gestioncof/utile_cof.html index 2db93b6b..51180390 100644 --- a/templates/gestioncof/utile_cof.html +++ b/templates/gestioncof/utile_cof.html @@ -8,6 +8,7 @@

                  COF

                  Mega

                  diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html new file mode 100644 index 00000000..f83a781b --- /dev/null +++ b/templates/registration/password_change_done.html @@ -0,0 +1,9 @@ +{% extends "base_title.html" %} + +{% block homelink %} +{% endblock %} + +{% block realcontent %} +

                  Mot de passe modifié avec succès !

                  +

                  Retour au menu principal

                  +{% endblock %} diff --git a/templates/registration/password_change_form.html b/templates/registration/password_change_form.html new file mode 100644 index 00000000..34aef6f7 --- /dev/null +++ b/templates/registration/password_change_form.html @@ -0,0 +1,13 @@ +{% extends "base_title.html" %} + +{% block homelink %} +{% endblock %} + +{% block realcontent %} +

                  Changement de mot de passe

                  +
                  + {% csrf_token %} + {{ form.as_p }} + +
                  +{% endblock %} diff --git a/tirage_bda.py b/tirage_bda.py new file mode 100644 index 00000000..d73b3e0a --- /dev/null +++ b/tirage_bda.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# coding: utf-8 +import os +import sys +import time + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings") + from django.conf import settings + settings.DEBUG = True + from bda.models import Spectacle, Participant, ChoixSpectacle, Attribution + from bda.algorithm import Algorithm + from django.db.models import Sum + from django.db import connection + start = time.time() + shows = Spectacle.objects.all() + members = Participant.objects.all() + choices = ChoixSpectacle.objects.order_by('participant', 'priority').select_related().all() + available_slots = Spectacle.objects.aggregate(Sum('slots'))['slots__sum'] + cursor = connection.cursor() + cursor.execute("SELECT SUM(`slots` * `price`) AS `total` FROM `bda_spectacle`;") + total_price = cursor.fetchone()[0] + print "%d spectacles" % len(shows) + print "%d places" % available_slots + print "%d participants" % len(members) + print "%d demandes" % len(choices) + print "%d places demandées" % (len(choices) + len(choices.filter(double = True).all())) + print "%.02f€ à brasser" % total_price + print "Récupération: %.2fs" % (time.time() - start) + start_init = time.time() + algo = Algorithm(shows, members, choices) + print "Initialisation: %.2fs" % (time.time() - start_init) + start_algo = time.time() + results = algo(sys.argv[1]) + print "Traitement: %.2fs" % (time.time() - start_algo) + print len(connection.queries), "requêtes SQL effectuées" + queries = list(connection.queries) + total_slots = 0 + total_losers = 0 + for (_, members, losers) in results: + total_slots += len(members) + total_losers += len(losers) + print "Placés %d\nDécus %d" % (total_slots, total_losers) + print "Total %d" % (total_slots + total_losers) + members2 = {} + members_uniq = {} + for (show, members, _) in results: + for (member, _, _, _) in members: + if member.id not in members_uniq: + members_uniq[member.id] = member + members2[member] = [] + member.total = 0 + member = members_uniq[member.id] + members2[member].append(show) + member.total += show.price + if len(members) < show.slots: + print "%d place(s) invendue(s) pour %s" % (show.slots - len(members), show) + members2 = members2.items() + print "Temps total: %.2fs" % (time.time() - start) + print "Requêtes SQL:" + for query in queries: + print query['sql']